Skip to content

Commit

Permalink
Merge pull request #18 from ARMmbed/release-1.3.3
Browse files Browse the repository at this point in the history
mbed-cloud-client-example 1.3.3
  • Loading branch information
teetak01 authored Jun 11, 2018
2 parents b1fe3df + 8c1774b commit 26e1b73
Show file tree
Hide file tree
Showing 11 changed files with 271 additions and 54 deletions.
35 changes: 20 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
# Changelog for Mbed Cloud Client Reference Example

## Release 1.3.3 (11.06.2018)
* Updated to Mbed OS 5.8.5.
* The example application prints information about the validity of the stored Cloud credentials (including Connect and Update certificates).
* Added a start-up delay of two seconds as a workaround for the SD driver initialization [issue](https://github.com/ARMmbed/sd-driver/issues/93).
* Fixed the heap corruption that took place with `print_m2mobject_stats()` when building the code with the MBED_HEAP_STATS_ENABLED flag.
* Added the `-DMBED_STACK_STATS_ENABLED` flag. It enables printing information on the application thread stack usage.

## Release 1.3.2 (22.05.2018)
* Update easy-connect to v1.2.9
* Update to Mbed OS 5.8.4
* Configuration partition_mode is added, which is enabled by default. This is supposed to be used with storage for data e.g. SD card.
* Linux: Update Mbedtls to 2.7.1 in pal-platform.
* Linux: Fix for CMake generation and generic cleanup in pal-platform.
* Updated easy-connect to v1.2.9
* Updated to Mbed OS 5.8.4
* Added the `partition_mode` configuration. It is enabled by default and supposed to be used with a data storage, such as an SD card.
* Linux: Updated Mbedtls to 2.7.1 in pal-platform.
* Linux: Fixed CMake generation and performed generic cleanup in pal-platform scripts.

#### Platform Adaptation Layer (PAL)
* Linux: Converted all timers to use signal-based timer (SIGEV_SIGNAL) instead of (SIGEV_THREAD).
* Linux: Converted all timers to use signal-based timer (`SIGEV_SIGNAL`) instead of (`SIGEV_THREAD`).
* This fixes the Valgrind warnings for possible memory leaks caused by LIBC's internal timer helper thread.
<span class="notes">**Note**: If the client application is creating a pthread before instantiating MbedCloudClient,
it needs to block the PAL_TIMER_SIGNAL from it. Otherwise the thread may get an exception caused
by the default signal handler with a message such as "Process terminating with default action
of signal 34 (SIGRT2)". For a suggested way to handle this please see `mcc_platform_init()` in
https://github.com/ARMmbed/mbed-cloud-client-example/blob/master/source/platform/Linux/common_setup.c.</span>
of signal 34 (`SIGRT2`)". For a suggested way to handle this please see `mcc_platform_init()` in [here](https://github.com/ARMmbed/mbed-cloud-client-example/blob/master/source/platform/Linux/common_setup.c).</span>

## Release 1.3.1.1 (27.04.2018)
* No changes.

## Release 1.3.1 (19.04.2018)
* Convert LED blinking callback from a blocking loop to event based tasklet.
* Update to Mbed OS 5.8.1.
* Rewrite platform-specific code to have common implementation which can be shared between other Cloud applications (source/platform/).
* enable multipartition support for application.
* enable LittleFS support.
* enable autoformat/autopartition for storage (controllable via compile-time flags).
* Converted LED blinking callback from a blocking loop to event based tasklet.
* Updated to Mbed OS 5.8.1.
* Rewrote platform-specific code to have common implementation which can be shared between other Cloud applications (source/platform/).
* enabled multipartition support for application.
* enabled LittleFS support.
* enabled autoformat/autopartition for storage (controllable via compile-time flags).

## Release 1.3.0 (27.3.2018)

Initial public release.

33 changes: 30 additions & 3 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,36 @@ void factory_reset(void *)

void main_application(void)
{
// https://github.com/ARMmbed/sd-driver/issues/93 (IOTMORF-2327)
// SD-driver initialization can fails with bd->init() -5005. This wait will
// allow the board more time to initialize.
#ifdef TARGET_LIKE_MBED
wait(2);
#endif
mcc_platform_sw_build_info();
// run_application() will first initialize the program and then call main_application()

if (mcc_platform_storage_init() != 0) {
printf("Failed to initialize storage\n" );
return;
}

if(mcc_platform_init() != 0) {
printf("ERROR - platform_init() failed!\n");
return;
}

// Print some statistics of the object sizes and their heap memory consumption.
// NOTE: This *must* be done before creating MbedCloudClient, as the statistic calculation
// creates and deletes M2MSecurity and M2MDevice singleton objects, which are also used by
// the MbedCloudClient.
#ifdef MBED_HEAP_STATS_ENABLED
print_m2mobject_stats();
#endif

// SimpleClient is used for registering and unregistering resources to a server.
SimpleM2MClient mbedClient;

// application_init() runs the following initializations:
// 1. trace initialization
// 2. platform initialization
Expand All @@ -124,16 +151,16 @@ void main_application(void)
return;
}

// SimpleClient is used for registering and unregistering resources to a server.
SimpleM2MClient mbedClient;

// Save pointer to mbedClient so that other functions can access it.
client = &mbedClient;

#ifdef MBED_HEAP_STATS_ENABLED
printf("Client initialized\r\n");
print_heap_stats();
#endif
#ifdef MBED_STACK_STATS_ENABLED
print_stack_statistics();
#endif

// Create resource for button count. Path of this resource will be: 3200/0/5501.
button_res = mbedClient.add_cloud_resource(3200, 0, 5501, "button_resource", M2MResourceInstance::INTEGER,
Expand Down
2 changes: 1 addition & 1 deletion mbed-cloud-client.lib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/ARMmbed/mbed-cloud-client/#d37a136be84216afb90f1bd3b00b1ac9d33d52a1
https://github.com/ARMmbed/mbed-cloud-client/#3137b3d7c8da10bae38749a9384e5e5c77a55012
2 changes: 1 addition & 1 deletion mbed-os.lib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/ARMmbed/mbed-os/#ae6c7c60f91c89cbf755a2f3c8ec9c66635849fd
https://github.com/ARMmbed/mbed-os/#367dbdf5145f4d6aa3e483c147fe7bda1ce23a36
30 changes: 23 additions & 7 deletions profiles/debug_size.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,43 @@
"-fmessage-length=0", "-fno-exceptions", "-fno-builtin",
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
"-MMD", "-fno-delete-null-pointer-checks",
"-fomit-frame-pointer", "-O1", "-g"],
"-fomit-frame-pointer", "-O1", "-g3", "-DMBED_DEBUG",
"-DMBED_TRAP_ERRORS_ENABLED=1"],
"asm": ["-x", "assembler-with-cpp"],
"c": ["-std=gnu99"],
"cxx": ["-std=gnu++98", "-fno-rtti", "-Wvla"],
"ld": ["-Wl,--gc-sections", "-Wl,--wrap,main", "-Wl,--wrap,_malloc_r",
"-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r",
"-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit"]
"-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r", "-Wl,--wrap,_memalign_r",
"-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit",
"-Wl,-n"]
},
"ARMC6": {
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-g", "-O1",
"-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions",
"-DMULADDC_CANNOT_USE_R7", "-fdata-sections",
"-fno-exceptions", "-MMD"],
"asm": [],
"c": ["-D__ASSERT_MSG", "-std=gnu99"],
"cxx": ["-fno-rtti", "-std=gnu++98"],
"ld": ["--verbose", "--remove", "--legacyalign", "--no_strict_wchar_size",
"--no_strict_enum_size"]
},
"ARM": {
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
"--apcs=interwork", "--brief_diagnostics", "--restrict",
"--multibyte_chars", "-O1", "-g"],
"--multibyte_chars", "-O1", "-g", "-DMBED_DEBUG",
"-DMBED_TRAP_ERRORS_ENABLED=1"],
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
"ld": []
"ld": ["--show_full_path"]
},
"uARM": {
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
"--apcs=interwork", "--brief_diagnostics", "--restrict",
"--multibyte_chars", "-O1", "-D__MICROLIB", "-g",
"--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD"],
"--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", "-DMBED_DEBUG",
"-DMBED_TRAP_ERRORS_ENABLED=1"],
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
Expand All @@ -35,7 +50,8 @@
"IAR": {
"common": [
"--no_wrap_diagnostics", "-e",
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Ol", "-r"],
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Ol", "-r", "-DMBED_DEBUG",
"-DMBED_TRAP_ERRORS_ENABLED=1", "--enable_restrict"],
"asm": [],
"c": ["--vla"],
"cxx": ["--guard_calls", "--no_static_destruction"],
Expand Down
19 changes: 15 additions & 4 deletions profiles/size.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,19 @@
"c": ["-std=gnu99"],
"cxx": ["-std=gnu++98", "-fno-rtti", "-Wvla"],
"ld": ["-Wl,--gc-sections", "-Wl,--wrap,main", "-Wl,--wrap,_malloc_r",
"-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r",
"-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit"]
"-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r", "-Wl,--wrap,_memalign_r",
"-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit",
"-Wl,-n"]
},
"ARMC6": {
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Os",
"-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions",
"-DMULADDC_CANNOT_USE_R7", "-fdata-sections",
"-fno-exceptions", "-MMD"],
"asm": [],
"c": ["-D__ASSERT_MSG", "-std=gnu99"],
"cxx": ["-fno-rtti", "-std=gnu++98"],
"ld": ["--legacyalign", "--no_strict_wchar_size", "--no_strict_enum_size"]
},
"ARM": {
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
Expand All @@ -20,7 +31,7 @@
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
"ld": []
"ld": ["--show_full_path"]
},
"uARM": {
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
Expand All @@ -35,7 +46,7 @@
"IAR": {
"common": [
"--no_wrap_diagnostics", "-e",
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Ohz"],
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Ohz", "--enable_restrict"],
"asm": [],
"c": ["--vla"],
"cxx": ["--guard_calls", "--no_static_destruction"],
Expand Down
Loading

0 comments on commit 26e1b73

Please sign in to comment.