Converting code from Arduino to C++ on Eclipse

RA5040
Posts: 26
Joined: Mon Jul 30, 2018 1:20 pm

Converting code from Arduino to C++ on Eclipse

Postby RA5040 » Sun Aug 26, 2018 11:17 am

I have Arduino sketches that I would like to convert to C++ on Eclipse. I could go through each sketch and convert all of the Arduino framework commands to their C++ equivalent, but this would be a very big job.

What I would really like to be able to do is to include the relevant Arduino libraries into the C++ project so that I could continue to use Arduino classes. I presume that there is no real obstacle to doing this ... except that I don't know how to (I've had a go and failed).

Help appreciated!!

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Converting code from Arduino to C++ on Eclipse

Postby kolban » Mon Aug 27, 2018 3:22 am

Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

RA5040
Posts: 26
Joined: Mon Jul 30, 2018 1:20 pm

Re: Converting code from Arduino to C++ on Eclipse

Postby RA5040 » Mon Aug 27, 2018 9:37 am

Wow ... the energy in this whole Arduino/ESP32/Eclipse project is amazing! Many thanks!

I've created a basic project using the esp-idf-template and I'll use your excellent tutorial to convert that to a C++ project, Arduino-style and see how I get on.

BTW ... I seem to be getting back into this at a nice time, when so much of the work has already been done ... when I started in embedded system development (MANY ages ago!), it was a bit different, as I'm sure you know.

RA5040
Posts: 26
Joined: Mon Jul 30, 2018 1:20 pm

Re: Converting code from Arduino to C++ on Eclipse

Postby RA5040 » Mon Aug 27, 2018 11:43 am

I've had a go at that and got a long way (I think). The blink arduino app I used showed no errors (which is a miracle of sorts!).

But at this point when I build the project I get the following error:

make[1]: Entering directory 'F:/eclipse-cpp-workspace/eita/build/app_update'
make[1]: execvp: xtensa-esp32-elf-gcc: Argument list too long
make[1]: *** [/home/Robert/esp/esp-idf/make/component_wrapper.mk:274: cores/esp32/libb64/cencode.o] Error 127
make: *** [C:/msys32/home/Robert/esp/esp-idf/make/project.mk:450: component-arduino-build] Error 2

I've followed the instructions in https://github.com/espressif/arduino-esp32/issues/1142 and updated the arduino and esp-idf as per iberstone's directions but I still get the same error.

What I did, btw, is the following (which is taken from your video on making an ESP32 C++ app on Eclipse, with changes for Arduino): http://www.irelandupclose.com/customer/ ... LIPSE.html
Attachments
app_update.jpg
app_update.jpg (16.8 KiB) Viewed 10334 times

Who is online

Users browsing this forum: Bing [Bot], MicroController and 165 guests