# Absolute cheapest, (easy) way of starting programming on ARM microcontrollers [closed]

I want to start using ARM processors, migrating from PICs which I've been using for too long. 8 bit models were available for under $1, programmers for under$10, and I have been spoilt by the ease and low cost of getting started. But seeing that their power is dwarfed by some ARM chips at the same price, and being fed up with closed-source software, I want to make the switch.

I would rather avoid getting any development boards, and instead get straight into it with a cheap generic break-out pcb ($1), and on a breadboard using whatever external components are essential to get it going. What are my options for programming ARM chips in this way? Are there programmers such as the PICKit2 which use USB to connect to a PC, programming via a simple serial connection (like ICSP) with the chip? How much of a difference in setups is required for different ARM manufacturs, ARM versions and individual chips? (ST, Atmel...) E.g. does each manufacturer need their own compilers, programmers, IDE etc? Or are there common tools for all? EDIT: Alright so after more research I believe I have come up with a relatively cheap solution, an stm32 dev board can be flashed with DAPLINK firmware, but I dont believe that the official github firmware will work natively(all of this is speculation until I get my stm32 dev board in the mail). But I found that the daplink_usb board included with the readbear mk20 is running an stm32 chip, they have released the firmware, which needs to have a line changed to make it compatible with the 8mhz crystal(Detailed in forum post linked below). Otherwise change out the crystal with a 16 mhz one. Ill update once I've confirmed this when my dev kit arrives. GITHUB REPO Redbear Github fork ## closed as primarily opinion-based by Bence Kaulics, Voltage Spike, Leon Heller, duskwuff, Sparky256Jul 20 '16 at 20:18 Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question. • It's good to realize that$5 gets you a Raspberry Pi Zero, which is supported by a perfectly normal (and free!) GCC. And if you just got over the shock how much faster ARM microcontrollers are, the RPi will stun you again. The main problem IMO is that no ARM manufacturer understand the message underneath the RPi. You're not going to earn much on ARM micrcontrolllers anymore, but there is much more to be made by supplying ready-to-use CPU modules. – MSalters Jul 20 '16 at 12:52
• Sometimes it is overkill to use a ready-to-use CPU module in an embedded application. – Bence Kaulics Jul 20 '16 at 13:20
• @MSalters, RPI is bulky... I just don't need the extras it comes with. I need bare-bones stuff in a very compact space for fast real-time processing. Also, RPI consumes a LOT more power than would be acceptable. – CL22 Jul 20 '16 at 13:22
• Sure, but most dev boards will be that way. But one of the great things about MCU development is that the hardware and software development can each be isolated up to a point. – Ignacio Vazquez-Abrams Jul 20 '16 at 14:13
• Consider getting a low cost dev board which comes with an integrated USB-SWD bridge. This will give you access to debug features as well as code download. You can split out the SWD access to any other target when it suits you. – Sean Houlihane Jul 20 '16 at 15:05

The stm32F0 and stm32L0 line have discovery boards running about $10, and Keil will provide a full function IDE for this line at zero cost. The Keil free pro MDK install instructions are HERE Also, ARM has a white sheet on migrating to Cortex M3 from PIC that you might find helpful • +1 But also worth noting that most (all) of the discovery boards have a built-in STLINK that can also be used to program standalone devices by configuring jumpers. – Roger Rowland Jul 20 '16 at 11:30 • @RogerRowland -- great point. I have used the on board programmers for my own boards before. Discovery is a great line, in general. I wish they have mounting holes! – Scott Seidman Jul 20 '16 at 12:54 • Would you recommend Nucleo or Discovery? They seem to be the same price and both feature ST-LINK. – David Jul 20 '16 at 19:36 • @david, haven't used the nucleo, but I can say the Discoveries have served me well. At that price point, get one of each (though I'd go with two Discoveries!) – Scott Seidman Jul 20 '16 at 21:24 • Dave Jones recently made a EEVblog video about a dev board for an ARM32 low power MCU. Maybe is relevant. – Lorenzo Donati Jul 21 '16 at 0:23 Easiest way- shell out >$10K USD for a full-functioned Keil Pro compiler, buy their JLINK debugger (another $1K maybe- there are cheaper ones with some limitations). IAR is another expensive possibility (examples are provided for STM32F7 Cortex M7 processor that work on the 30-day IAR demo) Cheapest way- download and install a (free) GCC-ARM + Eclipse toolchain with JLINK debugger plugins. Get a JLINK clone for$20 or so, which I think will work okay- not tested yet, for debugging.

There are detailed instructions for the latter on the net, however they make certain assumptions. Expect to spend a day or more getting it going, especially under Windows. Don't expect to be able to use many of the examples provided for other IDEs without some work. Impressively, the free toolchain can use 'packs' ('experimental' right now).

There are other systems such as Rowley Crossworks (which uses gcc, I believe) which are less painful financially. Atmel Studio is another, but I've had bitter complaints from my very experienced firmware developer about it (have only briefly played with it myself).

If your code needs are less than 32K you can use the same Keil system for free (code limited version), but be aware the upgrade path is easy but rather expensive. For example, it won't compile the simple Ethernet examples for the SAME70. Fine if you're replacing PICs or AVRs with low-end ARMs, but not so great if you are going ARM because you actually need to talk to LCD displays and run complex communication protocols (possibly pre-compiled modules can be included without affecting the 32K limit, I've not investigated that particular angle).

Here's what I use:

• STM32F103 "minimum system board" (see e.g. here, Cortex-M3 core), runs on 3.3V or USB power without any external components, clones come for about US$3 each. This fits nicely your request to "get straight into it with a cheap generic break-out pcb, and on a breadboard". • ST-Link V2 USB programmer clone (looks like this one), starts at about US$2 and supports on-chip debugging aswell.
• EmBitz (formerly Em::Blocks) as IDE with gcc toolchain, US$0 • STM's CubeMX to help getting started with new projects, US$0

The easiest start probably is one of the third-party clone boards. Random example from ST. That requires a programmer using the 'SWD' protocol. ST make 'ST-LINK' branded ones, I'm not sure if you have to use ST-LINK ones with ST devices or if it's really generic.

Some combination of SWD and JTAG plays the role of ICSP on ARM systems, giving you programming and debug capabilities.

Software-wise, it's usually possible to work with GCC and OpenOCD on most chips. The details are slightly different for each device. Professionals often use the Keil toolchain, which is quite expensive.

Some devices (e.g. of the Kinetis series) have USB bootloaders: the device appears as a mass storage device, you download a BIN file onto it and press a button. Easiest possible solution, no programmer required. Atmel AT91 have a USB bootloader that works with a proprietary protocol called SAM-BA.

• the st discovery and nucleo boards have an stlink on them and cost 30% less than the standalone stlink dongles. plus you get at least one mcu to play with. Getting an stlink is still good and you can use it with openocd to connect via swd to other st or non-st cortex-m chips. – old_timer Jul 20 '16 at 22:42
• Interesting the Kenetisis chip I tried I cant use (yet) because it has no bootloader is swd only and wont connect up using an stlink, need a cmsis-dap supposedly. likewise the samd21 no longer carries a bootloader, you can add one but it is essentially in application flash space and quite trivial to accidentally erase. stm32s still have a bootloader as do nxp, maybe that is going away too... – old_timer Jul 20 '16 at 22:43

On the IDE front, Silicon Labs provides Simplicity Studio, which is based on Eclipse. It comes as standard with GCC.

There is built-in support for all the starter kits they sell, making getting started relatively painless.

Programming uses a Segger J-Link driver for the starter kits (free). Just connect the kit to USB and go.

Atmel have their Studio which is based on the Visual Studio IDE and can connect to any of the Atmel debuggers. This also ships with GCC.

Both vendors have numerous (very numerous) examples to drive their devices.

I have used both and although the documentation is not perfect (it never is), it was certainly sufficient to get me going relatively painlessly.

Many of the ST kits (and others) are mbed enabled.

Cypress makes PSOC-4200-based (ARM Cortex M0) breakout boards with a DIP-40 form factor that include a USB-based programming adapter in a break-off portion. Price for the breakout board and attached (detachable) programming adapter is a whopping US\$3.99 from Digi-Key.

I would recommend CooCox - it is the same GCC + Eclipse combination, but no need to configure toolchain manually, just install it and start coding.

• Looks nice, I guess Atmel is not supported. Is ST M7 core supported? – Spehro Pefhany Jul 20 '16 at 18:00
• Seems Atmel is not supported, there are some libraries for STM32F7 series in components. Have to say that the future of CoIDE is not clear - web site is mess, updates are rare now, but still great choice for starting with ARM programming (specially with STM32). – Flanker Jul 23 '16 at 8:33

In my believes TI,NXP(consist of NXP+Freescale) & ST are major role player in cortex M world,especially ST and NXP offers a really competitive tools for newcomers,one another important parameter is popularity in open source community which cause amount of tutorials,libraries,device drivers,tools & etc.

then :

1. mbed online compiler + a mbed board
2. A STM32 discovery board(like STM32F407discovery) + built in st-link debugger +SPL or HAL (STM CUBE) framework + free license keil IDE.
3. A LPC discovery board + LPC-link 2 debugger + LPCOPEN framework +LPCXPRESSO free license IDE.

Number 2 & 3 are better choice for upper level than hobby. Also remember with using free license of professional tools like IAR,Keil or even LPCXPRESSO you have less pain while moving to the professional area.