PlatformIO Community

Compile AmazonFreeRTOS project inside platformio

Hi everyone,

I’ve been trying to do this about a week now, and I’d like to understand if it’s actually possible, the idea is to take a sample FreeRTOS project available in the AWS freertos console and compile it using platformio.

So, basically you download FreeRTOS with some specific libraries for a board, compile it, flash and run some demos.

I managed to follow the AWS tutorials to compile and flash my device with it, but no luck so far on trying to do the same with platformio, the biggest struggle being ‘adapting’ the libraries to a format that platformio can find the correct dependencies.

pio_3

I’m trying to run the coremqtt mutual auth demo to connect with AWS just for reference.

Has anyone done that? It would be very helpful if you guys could point me in the right direction.

Thanks!

I see you haven’t had a reply for 4 days. Can you zip up your project directory, assuming there’s nothing confidential in it, and put it somewhere (Dropbox? Google Drive?) where I can download it please. I might have a board that will work!

I’ve not used Amazon’s RTOS at all, so it could be that I’m raising your hopes, but I’ll give it a try.

Oh yes, this will probably be no help to you at all: AWS FreeRTOS with PlatformIO IDE? :wink: as it is FreeRTOS, just not the AWS version. (Question, what’s the difference?)

Cheers,
Norm.

Hello @NormanDunbar

Thanks for your response, actually I have ‘downgraded’ this example to a simpler one and try to work it from the ground up, so instead of trying to compile the mqtt mutual auth demo, I first compiled and flashed a blink example (which worked) and now I’m trying the mqtt mutual auth once again.

There’s nothing confidential in my directory, I’ll have it zipped here, no problem.

https://drive.google.com/file/d/1M8pDwXYGdceCqjrS7gMES45wRYRh1FsX/view?usp=sharing

You will see it’s basically the esp-idf-blink example with a few changes in it.

The current state is it shows an error " Invalid method for loading certs" which seems like a sdkconfig thing, I’m also trying to figure out how to fix that.

WhatsApp Image 2021-06-07 at 16.58.43

Thanks in advance.

I think this error is coming from the file subscribe_publish_sample.c in your src directory. Anything in src will be compiled by default. In src you have main.cpp and this file, both should compile using the C++ or C compiler as appropriate, but possibly the linker might have problems if function name mangling gets involved.

I renamed it to subscribe_publish_sample.c.txt to exclude it from the compilation, but I’m not sure if it should be part of the compilation or not, but the project compiled without errors. There are a few warnings though that may need looking into.

Unfortunately, I don’t appear to have a suitable board to check that the code actually runs. Sorry. :frowning_face: This means that I’m unlikely to be able to help much further – but I will try.

Cheers,
Norm.

1 Like

Hello there,

You managed to do exatcly as I did, the main.cpp is the blink example, which I managed to build and flash with no problem.

The idea here is to run the subcribe_publish_sample (which is the AWS demo) and then add blink to it just to see if I can add Arduino code to the ESP-IDF demo.

Just for reference, I’m using a basic ESP32 NodeMCU as a board for this project.

I’ll keep trying to see what is happening, but I still believe it has to do with the sdkconfig file.

Thanks.

Good luck! Sorry I wasn’t any help.

Cheers,
Norm.

1 Like