GoogleCloudPlatform / iot-device-sdk-embedded-c

Cloud IoT Device SDK for Connectivity to IoT Core.
Other
246 stars 82 forks source link

using linux-arm #79

Open bulbage opened 5 years ago

bulbage commented 5 years ago

Hello, I have been able to test the Linux version successfully. However, when I try to cross-compile for arm I receive the following error:

iot-device-sdk-embedded-c/src/bsp/platform/posix/iotc_bsp_io_fs_posix.c:25:20: fatal error: memory.h: No such file or directory

My make command:

make CONFIG=posix_fs-posix_platform-tls_bsp-memory_limiter TARGET=arm-linux-static-release 

Any help would be much appreciated. Thank you.

atigyi commented 5 years ago

For this particular error changing the memory.h include to string.h include in iotc_bsp_io_fs_posix.c:25 solves the issue, see PR70.

Although the root problem is the lack of the port on any GNU Arm Embedded Toolchain. This means running again the make ... command above will result in further compiler errors (in iotc_bsp_io_net_posix.c) since it uses the POSIX port src/bsp/platform/posix. The solution would be to write the port on the preferred Arm Embedded Toolchain in a new directory e.g. src/bsp/platform/arm_my_preferred_toolchain_id. This means implementing the NET, MEM, RNG, TIME and TLS BSP modules (mbedtls or wolfssl might be reusable), FS isn't mandatory.

And then change the ARM_REL target in mt-presets.mk to use arm_my_preferred_toolchain_id as IOTC_BSP_PLATFORM.