Learning more about Arduino on the ARM Cortex M series of chips

I've been developing custom Arduino-based boards for about a year now, but have primarily been relying on the trusty ATMEGA328 and the ATMEGA32u4 for most of my projects. Once in a while I'll dabble with the ATTiny45/85, but I generally stick to the bigger chips for most things. Recently I've come across an opportunity that requires me to use a more powerful chip (more IO, faster clock speed, etc.) and am wanting to learn more about using Arduino on more powerful chips.

I'm not very interested in diving deep into low-level embedded C, since I've fallen in love with the speed at which I can develop using the Arduino framework. Plus, I open-source almost all of my projects and would like to keep them as easy to build as possible so that other beginner or intermediate engineers like me can jump in without having to pick up a huge amount of new information.

Can anyone point me to some resources for learning about how work with the ARM Cortex M series chips using Arduino? I think I may be most interested in M3 and M4, but I'm also keen to know if any of these chips can be used without an external UART USB chip like I see on the Due.

Maybe you know of some open-source projects that use these chips that I can grab the schematics from and study?

There is a new Arduino (using an M0+) coming out, that would fit the bill I think, but it's still in beta.

I did an Arduino port to an LPC1227 (M0) ages ago (hardly got out of alpha though).

Then there's the Seeeduino Arch pro (LPC11U24, M0).


Rob

There is also the Teensy3.1 @ PJRC
MK20DX256
32 bit ARM
Cortex-M4
72 MHz
https://www.pjrc.com/teensy/index.html

Doc

I suppose I'm specifically looking for a bootloader that I can flash onto these chips to make them compatible with the standard Arduino IDE/framework.

The Seeed Arch board doesn't look like it is Arduino compatible, just that it has headers that match Arduino shields. They say it is a combination of mbed and Arduino, but don't say anything about it working with the Arduino IDE/framework, and I don't see a bootloader anywhere.

The Teensy 3.1 is incredible, but it uses a separate MIN54 chip as a USB UART buffer, and they don't release the bootloader. You have to buy a MIN54 chip from them directly with the bootloader pre-flashed, which gets impractical for my projects.

Currently the only officially supported Cortex M chip is the Due, but the SAM3X package is rather large. It does have the advantage of builtin (ROM) bootloader, so it can be programmed in standalone projects using Arduino IDE.

Arduino Zero is promising, no idea when it will be launched. The EDBG may give some real debug, but the BGA chip is not great for non-professionals. I don't know if the SAM D20 has built in bootloader.

Teensy 3x is well supported with a patch to Arduino IDE, albeit an old version. It's also not Open Source, as you noted. The Freescale Kinetis chips do not generally have a builtin bootloader, AFAIK.

After that, Leaflabs Maple was a nice system, but leaflabs seems to be winding down on Maple, they are still sold but the Maple IDE is based on an ancient version of Arduino. On the plus side, there are really cheap Maple clones about, the STM32 chips have ROM bootloaders, are easy to use and widely used in hobby apps.

I am porting the Maple code into Arduino 1.5.x add-on package, currently I can compile and download to Maple and Maple mini compatible boards. There is a Maple DFU bootloader which is a bit problematic, however I think the STM32 native bootloader would be a better option.

NXP have a bunch of chips which are easy to use, with ROM bootloaders. They also have a couple in a DIP package. Recently ChrisMicro ported Microbuilder.eu code to an Arduino API, and I wrapped it up into a package for Arduino 1.5.x.

Awesome, thanks for the response!

I feel like I'm seeing a lot of Cortex-based Arduino-compatible boards coming out (via Kickstarter and other random projects), but it's sounding like there isn't much mainstream momentum for these chips just yet. Perhaps for now the best route for me is to simply integrate full Teensy 3.1 boards into my projects as daughterboards (good thing they are nice and small!).

Another real option is to do as little processing as possible on my system and transmit raw data at a high rate to a more powerful base station somewhere (like a full PC or RasPi) that can do the more complex calculations needed for my project. Either way there was going to be a base station of some sort, it's just a matter of distributing the computing load that I was interested in.

FWIW the Teensy is much more powerful than the original PC-XT...
I've purchased three and as yet... I've not developed any complex code for them but I have no issues in programming them with simple code transferred from code I wrote for a Attiny85 in Arduino Ver 1.05 to the Teensy...
It is also possible to make a small board for the MN54 to program the MK20DX256.. In the PJRC forum there is a thread addressing this but I don't remember the outcome... You might start there..

Doc

Oh yes, the Teensy is most definitely incredibly powerful (hence why I'm looking to use a similar chip in my project). But my project also requires more computing power than an ancient computer could provide. My main issue with using a full Teensy as a daughterboard is the extra height that would add to my project. I'd prefer to make a single PCB with as small of a footprint as I can get (and still be hand-solderable) that also has a few other things for my project integrated on-board.

I will see if I can find that forum topic, I didn't realize PJRC had a forum!

I suppose I'm specifically looking for a bootloader that I can flash onto these chips to make them compatible with the standard Arduino IDE/framework.

  1. A bootloader has very little to do with making a chip compatible with the Arduino framework. Once the code is loaded, the bootloader is ignored (it is NOT used as any sort of library, for instance.)
  2. MANY of the more powerful ARM chips come with some sort of serial bootloader in ROM. TI and ST CM3/CM4 chips, for instance. It's just a small matter of getting the IDE to use those bootloaders for the "upload" task.
  3. with the new 1.5.x multi-platform mechanisms, that should be relatively easy.
  4. There are currently a LOT of ARM boards coming out with Arduino-style headers. ST Nucleo. NXP LPCXpresso. Cypress Pioneer. TI Launchpad. Freescale Freedom.
  5. There is the Leaflabs Maple; the first ARM-Arduino (with an ST CM3), and what they did to get things working on the IDE.
  6. there are currently several threads on EEVBLOG forums about putting together "Ghetto" ARM development boards for very little money ($2-5)...
  7. Don't forget Energia; the Arduino-compatible IDE for the TI Launchpads. Includes the ARM Launchpads...

If I were you, I'd be doing development with either the TI or Teensy (those would require the least SW development) and looking finding another bootloader as a "future project"; writing a bootloader is probably easier than doing the Arduino core and libraries for a currently unsupported chip.

Hmm. I'd be very interested in seeing the 1.5.x stuff for the Maple Mini.
I have a couple of them sat doing nothing at the moment...

SteveS

You're right, it looks like I'm more specifically looking to learn how to set up a M3/M4 chip so that I can use the standard Arduino IDE (patched like the Teensy is fine) and develop sketches more easily for it. I suppose that means that I am looking for a port of the Arduino codebase that runs on these chips, and some examples (schematics/tutorials) of how to wire them up.

I'm not really looking for dev boards, I'm looking for information about how to get a M3/M4 chip working with Arduino. I'm hoping to design some custom PCBs for a project that use the more powerful chip.

Thanks, I will check out the TI Launchpad (not sure if it is open-source) and hunt around on the EEVBlog forums.

Like I said, using a full Teensy as a daughterboard adds height to my project because of the headers, so I'm really looking to learn how to integrate the relevant chipset on a custom PCB with other parts for my project.

I've just started using the LPC1549, it's an M3 and maybe the best little chip I've seen for a long time, almost all functions can be MUXed to all pins, almost all pins 5v tolerant, 2 ADCs (24 analog IPs), DAC, 28 PWMs, USB built it (virtual UART or if you like drag and drop a bin file onto the external "drive"), inbuilt booltloader for UART, USB and CAN, all examples so far work, Arduino form factor board.

AFAIK no Arduino port exists but I ported to the LPC1227 before so think I will repeat that for the 1549.


Rob

This little board looks interesting. Kind of like an Arduino Zero only smaller.
https://code.google.com/p/arduino-to-xmc/wiki/FirstSteps

I love that the debug chip is 2x the size of the main CPU :slight_smile:


Rob

Yeah, seems crazy ... an ARM® Cortex®-M4 / 80MHz, 256KB Flash / CAN, I²C, LIN, SPI, UART/USART, USB / DMA, I²S, LED, POR, PWM, WDT / A/D 16x12b, D/A 2x12b. (cut and paste from Digi-Key)

Oh well, should do a good job debugging the XMC1100.

Yeah, I would honestly be fine with using the M4 alone. I won't do much UART over USB (except for debugging), so I don't see the need to have a bridge if the USB functionality is included in the chip.

Just figuring out how to run Arduino sketches on these things is what I've been most interested in.

I just tried the drag-n-drop programming on the 1549, works a treat just hold the ISP0 pin low during reset and viola, an external drive. Delete the old "file" and drag the new BIN file onto the drive. Job done.

Now I've never been a big fan of needing a mouse to perform functions that 1-2 keystrokes would do faster, but I reckon this would be easy to codify in a BAT file and maybe even have the IDE run that after each build.

This would be great for infield updates as the punter doesn't need any special programming code.


Rob