Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross Compile AWS IoT Embedded C SDk #435

Closed
agilesai1294 opened this issue May 17, 2019 · 10 comments
Closed

Cross Compile AWS IoT Embedded C SDk #435

agilesai1294 opened this issue May 17, 2019 · 10 comments

Comments

@agilesai1294
Copy link

Hi,

Can anyone provide me with the steps on how to cross compile Embedded C SDK using arm-none-linux-gnueabi-gcc?

@lt72
Copy link
Contributor

lt72 commented May 17, 2019

Hi @agilesai1294, the C-SDK does not directly support cross-compiling for a ARM target. Although we may be adding this feature sometimes in the near future we cannot offer you a solution in the short term.
The C-SDK is compiled and tested for Linux only.
The reason is that the C-SDK is meant to be embedded into another SDK (such as the one provided by the silicon vendors for your own development board).
My suggestion is for you to start from the SDK or tool chain for your target HW, and add the C-SDK files to the build system of your target HW.

@yuhui-zheng
Copy link
Member

@agilesai1294 Please reach out again if you have further issue integrating C-SDK with targeted platform. I'd close this thread for now.

@cobusve cobusve closed this as completed May 24, 2019
@agilesai1294
Copy link
Author

Hi @lt72 If i want to test pubsub in my target HW. what all dependent files do I need to port?

@lt72
Copy link
Contributor

lt72 commented May 30, 2019

You will need to fill the implementation for platform abstractions here: (note: only in v4_beta branch)
https://github.com/aws/aws-iot-device-sdk-embedded-C/tree/v4_beta/platform/ports/template
For network, you can recycle OpenSSL port or mbedTLS ports here:
https://github.com/aws/aws-iot-device-sdk-embedded-C/tree/v4_beta/platform/ports/posix/source
https://github.com/aws/aws-iot-device-sdk-embedded-C/tree/v4_beta/platform/network

@agilesai1294
Copy link
Author

agilesai1294 commented May 30, 2019

Hi @lt72
I tried cross compiling using the following command:
cmake .. -DCMAKE_C_COMPILER=/home/$USER/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc

It successfully completes cmake and when I tried to make after cmake. I got the following error. Can you please tell me what should I change to make it work with arm-none-linux-gnueabi-gcc compiler
Capture1

@lt72
Copy link
Contributor

lt72 commented May 31, 2019

Hi @agilesai1294, as a matter of fact this is actually part of our roadmap and we may have a solution faster than we can agree and implement all necessary steps, if you can wait a couple of days.

@agilesai1294
Copy link
Author

Hi, @lt72 Is the solution ready for cross compiling this SDK with arm-linux-gnueabi-gcc?

@lt72
Copy link
Contributor

lt72 commented Jun 20, 2019

Not yet.
@gordonwang0: can we give @agilesai1294 what we have so far for cross compiling? Would that be useful?

@gordonwang0
Copy link
Contributor

Hi @agilesai1294,

In addition to setting the compiler, you will also have to port the SDK to your platform. The errors you're seeing are because the SDK is trying to build with the POSIX port but can't find the POSIX functions.

Ports of the SDK are implemented in the ports directory. You can set the port to use by setting the CMake variable IOT_PLATFORM_NAME.

cmake .. -DCMAKE_C_COMPILER=/home/$USER/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc -DIOT_PLATFORM_NAME=template

The command above allows you to build with the "template" port, which is empty function stubs. Once you have that building, you should implement your port based on the directions in the template.

@gordonwang0 gordonwang0 reopened this Jun 20, 2019
@dcgaws
Copy link
Contributor

dcgaws commented Dec 23, 2019

@agilesai1294 please reopen this if the above issue did not unblock you.

@dcgaws dcgaws closed this as completed Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants