PelionIoT / pelion-ready-example

Pelion Device Ready example - deprecated
https://github.com/ARMmbed/pelion-ready-example
Apache License 2.0
2 stars 18 forks source link

Link error for non Cortex-M target #7

Closed toyowata closed 6 years ago

toyowata commented 6 years ago

In the porting to Renesas GR-LYCHEE (Cortex-A9 based target), we got following link errors:

Link: simple-mbed-cloud-client-example-restricted
BUILD/gr_lychee/GCC_ARM/simple-mbed-cloud-client/mbed-cloud-client/update-client-hub/modules/atomic-queue/source/critical.o: In function `aq_critical_section_enter':
/Users/toywat01/test/simple-mbed-cloud-client-example-restricted/./simple-mbed-cloud-client/mbed-cloud-client/update-client-hub/modules/atomic-queue/source/critical.c:42: undefined reference to `__get_PRIMASK'
BUILD/gr_lychee/GCC_ARM/simple-mbed-cloud-client/mbed-cloud-client/update-client-hub/modules/atomic-queue/source/critical.o: In function `aq_critical_section_exit':
/Users/toywat01/test/simple-mbed-cloud-client-example-restricted/./simple-mbed-cloud-client/mbed-cloud-client/update-client-hub/modules/atomic-queue/source/critical.c:72: undefined reference to `__get_PRIMASK'
collect2: error: ld returned 1 exit status
[ERROR] BUILD/gr_lychee/GCC_ARM/simple-mbed-cloud-client/mbed-cloud-client/update-client-hub/modules/atomic-queue/source/critical.o: In function `aq_critical_section_enter':
/Users/toywat01/test/simple-mbed-cloud-client-example-restricted/./simple-mbed-cloud-client/mbed-cloud-client/update-client-hub/modules/atomic-queue/source/critical.c:42: undefined reference to `__get_PRIMASK'
BUILD/gr_lychee/GCC_ARM/simple-mbed-cloud-client/mbed-cloud-client/update-client-hub/modules/atomic-queue/source/critical.o: In function `aq_critical_section_exit':
/Users/toywat01/test/simple-mbed-cloud-client-example-restricted/./simple-mbed-cloud-client/mbed-cloud-client/update-client-hub/modules/atomic-queue/source/critical.c:72: undefined reference to `__get_PRIMASK'
collect2: error: ld returned 1 exit status

The code should care about non Cortex-M target. e.g. __get_PRIMASK() function calls has be replaced to __get_CPSR() for Cortex-A target like this:

https://github.com/ARMmbed/mbed-os/blob/671c2d7e90d347657d4fb53c0d16c0ceb0461423/hal/mbed_critical_section_api.c#L28-L32

MarceloSalazar commented 6 years ago

Internal reference: IOTPART-5125

toyowata commented 6 years ago

https://github.com/ARMmbed/update-client-hub/pull/234 should fix this.

toyowata commented 6 years ago

Closed this by fix https://github.com/ARMmbed/update-client-hub/pull/234