0

Programming Circuit Playground Express in C++?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Programming Circuit Playground Express in C++?

by c3po on Fri Jun 01, 2018 6:32 pm

Does anyone know of a step-by-step walk-through available for cross-compiling C++ for specific ARM targets like the SAMD21G18A?

I'd really like students to be able to program the Circuit Playground Express in plain old C++, without Arduino's setup( ) and loop( ). It's also important that students not be required to work on a specific OS or in a specific IDE. Ideally, we'd use a minimalistic text editor to write a standard *.cpp with a main( ) function, import a library like mbed.h or simba.h, and build with a makefile. Then either convert to UF2 and drag and drop onto the external drive, or use bossa.

I've spent a few days dredging the atmel / mbed / platformio docs and can't quite get this to work for the Circuit Playground Express. The closest I've come is platformio using the SAMD21G18A target and the Arduino framework, but that still requires setup( ) and loop( ). When I try to use platformio with the mbed or simba frameworks, it says they are not supported for the Circuit Playground Express.

Alternatively: Is there an AVR-based dev board similar in shininess to the CPE? Where diversity of built-in peripherals is a metric for shininess. It would be great to find a board that allows students to meet C++ and #makerobotfriend with minimal breadboarding.

Thank you for your time and guidance :)

c3po
 
Posts: 1
Joined: Fri May 18, 2018 3:42 pm

Re: Programming Circuit Playground Express in C++?

by danhalbert on Mon Jun 04, 2018 9:46 pm

Well, we write CircuitPython in C, use arm-none-eabi-gcc to compile, and create .uf2's to load. All from the command-line, on a Mac or Linux. But the build framework is extensive to get this to work.

We used to use ASF3 (see the 2.x branch) and now use ASF4, which is less pleasant.

You could take our code as a starting point of some kind: https://github.com/adafruit/circuitpython, and https://learn.adafruit.com/building-circuitpython

danhalbert
 
Posts: 908
Joined: Tue Aug 08, 2017 12:37 pm

Please be positive and constructive with your questions and comments.