32b MCU famiy with cheap programmers, cheap HW debug, and open tools - Page 1
Forum section: electronics / general

author: djacobow
author_rank: Super Contributor
timestamp: February 09, 2014, 01:59:15 am
content: I really don't want to initiate a flame war, but I have another question about MCU families. I've been working on AVRs quite happily but want to move to a 32b machine, preferably ARM, for mostly performance reasons.After Googling around it seems that for some targets there are expensive IDEs, cheap IDEs, and free IDEs, cheap and expensive device programmers, and cheap and expensive JTAG or other HW debug tools that may or may not work with gdb, eclipse, etc.Can anyone give me a very quick education on what is the most well-supported family in the open-source world and what tools (HW and SW) work best?Ideally, I'd be happiest with a gnu compiler toolchain, a cheap programmer and a command line tool I can use to run it, and a cheap JTAG device that works with gdb -- all running on linux. Non gnu software is OK, but I'm allergic to machine-locked license keys.For a background, I used to be a pretty sophisticated microprocessor guy (circuit designer at Intel, application engineer at Cadence, Tensilica, others) but am getting back into it after about 10 years away -- now as a hobbyist, and my patience/budget for closed tools and single-family dongles and programmers isn't what it was.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: February 09, 2014, 04:06:13 am
content: 1 vote forSt Micro, Eclipse CDT, Yagarto, and the open debugger(I forgot its name ODB or something).STLinkV2 for the cut down version of JTAG, but its sort of already on the discovery devel boards.I had a quick look at the TI and the Energy Micro devel boards too, they were easy to get going, compiling, debugging but that was with the limited licence tools.

author: hans
author_rank: Super Contributor
timestamp: February 09, 2014, 09:45:52 am
content: The STM32 controllers seem to become pretty widely used. The STM32F1 series are pretty cheap at the low end, the STM32F4 are pretty powerful (but more expensive), with USB HiSpeed, 100Mbit ethernet, etc, (though if you add Phy's).Their ST Discovery boards are also very cheap to get and have the STLINKv2 debugger built in. You can also use it for your own boards with a simple 5-pin cable. In my experience it works very well, it's loads quick and I have had little quirks so far.An obvious limitation is, of course, the STLINKv2 only works on STM32 devices. For me it was so cheap and low-entry I couldn't resist rolling a project with a ST microcontroller on it , and see how it works out.Not sure about the STLINKv2 driver & linux neither.Otherwise I'd recommended looking at NXP or Atmel for general purpose projects. At work we use NXP, their chips are okay, but sometimes I feel their peripherals are a bit limiting for a big 32-bit Cortex core (like only supplying 4 timers, 4 or 8 A/D channels on a 100-pin QFP, etc.)NXP has got LPCxpresso development boards, kinda similar at the STMDiscovery with onboard debugger. Their old boards were completely locked into CodeRed IDE's (another Eclipse Java IDE), which is a pity. I believe their newer debuggers implement a J-Link debugger protocol though, not sure which models.IDE's is a bit harder, can be very personal. Maybe this page will help:http://www.emcu.it/STM32/What_should_I_use_to_develop_on_STM32/What_should_I_use_to_develop_on_STM32.htmlCandidates seem to be: CooCox, Code::Blocks and emIDE. The others are 32kB Limited versions of big vendor tools, which I guess will work very well, but is quite a contrast to "open tools".As a general rant: in general ARM tools are not very open. There was this very interesting article onHackadayandDangerousPrototypesabout a very simple CMSIS-DAP (Cortex general purpose debugging protocol) adapter, using a 1$ USB PIC part.All great and all, except for the fact the source code is not allowed to be released because you get the CMSIS-DAP specification from ARM under "license", which says you may not release your implementation/source code.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 09, 2014, 10:57:02 am
content: I've been using the PIC32MX1xx chips a lot recently. Tools are not open but the free compiler is perfectly OK. Parts are cheap, readily available and have a wide range of packages - DIP (yes, really!) , SO, SSOP, QFN and VTLA. For production you can get them pre-programmed and marked via MicrochipDirect. That alone has been the reason for using them in one design recently.You can program and debug using the cheap PicKit 3, though the more expensive ICD3 is significantly faster. Pickit3 can also work as a standalone programmer which can be handy for small production batches.I'm still using MPLAB8 out of habit, but am told that MPLABX is pretty good nowA few minor downsides - pin remappablity isn't as good as the PIC24's, but a least as good as NXP and others I've looked at. Interrupt latency could be better (seems to save a lot of context ), and UART FIFO implementation is a bit lacking (short FIFO and no timeour interrupt). And no pin pullups/pulldowns - WTF is that about?

author: dannyf
author_rank: Super Contributor
timestamp: February 09, 2014, 12:48:17 pm
content: I would vote for CoIDE on a short budget. Both emblocks and emide are also worthy candidates.On chips, those STM discovery boards are nice for general purposes. TI's launchpads are very feature rich. Freescale's boards are incredible in terms of mixed signal stuff.

author: djacobow
author_rank: Super Contributor
timestamp: February 10, 2014, 08:05:13 pm
content: Thanks for the replies, guys. It looks like in short I got a different answer with each response, which is fine. I think I'll just need to pick one and roll with it for awhile. I'll report back when I am up and running with gcc based tools in linux and a working debugger.

author: casinada
author_rank: Frequent Contributor
timestamp: February 10, 2014, 08:15:17 pm
content: Texas Instruments, Freescale, Renesas, NXP, etc on top of the other ones mentioned already.Lots of choices from many manufacturers.Welcome to the confusing world of choices

author: GiskardReventlov
author_rank: Frequent Contributor
timestamp: February 11, 2014, 04:49:28 am
content: @djacobow,I'm on a similar path, I haven't decided on whether I want to do PIC or atmel. For PIC it seems that you have to buy a pickit3 to do pic32 but it seems that for atmel there is a device called usbasp that is very cheap <$10. For me money's not the only issue. I just don't like paying for something to find out later that it's limited in some way that requires spending more money. The pickit3 has had some legitimate complaints like requiring separate target power.Your questions:cheap programmer: atmel and the usbaspcheap hw debug: this I'm not sure about but I think JTAG for both worksopen tools: I think there are open source tools for bothI think I'm leaning toward atmel unless there's a usbasp-like solution for PIC.You never defined cheap and that's a wide range because some people think $100 is cheap.I look forward to hearing about your search.I'll let you know if I find out any more useful bits.

author: bernroth
author_rank: Regular Contributor
timestamp: February 11, 2014, 06:31:08 am
content: Some time ago I was faced with a similar decision to make and I finally have chosen the STM32 family of Cortex MCUs.Here are my reasons:- GCC available (you can use Eclipse if you want or sublime text/vim/make like me)- OpenOCD JTAG debugger for GDB and programming using FTDI based JTAG interface- Cheapo DEV boards (STN32xx discovery)- Dev board comes with integrated ST-Link which you can use to program your target board using the SWD interface (ST Link works for STM8 too)- Open source software for ST-Link is available (unlike LPC-Link from NXP which is bound to their eclipse IDE)- C Libaries for peripherals come from ST- Advanced features of peripherals- Good documentation- There are some real time operating systems which support STM32 very well likehttp://www.chibios.org/JM2C

author: poorchava
author_rank: Super Contributor
timestamp: February 11, 2014, 07:03:41 am
content: STM32 + CoIDE. Use any discovery board as JTAG adapter and you're set.

author: true
author_rank: Frequent Contributor
timestamp: February 11, 2014, 07:15:45 am
content: Quote from: mikeselectricstuff on February 09, 2014, 10:57:02 amSeems to not be a problem with me. Just used PIC32 in two projects (2xx same thing and 4xx) actually because the previous chips I tried couldn't handle the low latency I needed... that said I didn't try ARM stuff yet, but other parts of PIC32 seemed to fit exactly what I needed, so I went with it...Quote from: mikeselectricstuff on February 09, 2014, 10:57:02 amYeah FIFO is short but I was able to deal with it, though I thought there were a few interrupt options... maybe I am misremembering, I ended up working with it well enough even with tough constraints that I didn't need it...Quote from: mikeselectricstuff on February 09, 2014, 10:57:02 amYeah, this one really sucks.Quote from: poorchavaBasically this.djacobowI am another that will tell you for general purpose ARM and specifically STM32 will be the cheapest (money investment more than time) to develop with and can be developed with on Linux with open source tools. You aren't terribly trapped with one vendor (though standard libraries can get you) and $10 to program/debug is cheap, who cares if it's vendor specific. At that price, if you want to migrate to non-vendor specific, do it when/if you need to move. I don't know ST's reasons but they are targeting cheapskates and it worked for me, at least one thing in development for me is using STM32

author: djacobow
author_rank: Super Contributor
timestamp: February 12, 2014, 06:37:58 pm
content: OK, the center of gravity seems to have moved towards STM32 in this thread.The parts really don't have controllable internal pullups/downs? Not tragic, but highly annoying!

author: djacobow
author_rank: Super Contributor
timestamp: February 12, 2014, 06:42:53 pm
content: I also should have been more clear by what I mean as "cheap."Yeah, I have no problem shelling out, say, up to $150 for a programmer or OCD device.I don't want to have to shell out $150+ for tools, though, including the driver and utility to use the programmer or OCD device. The problem with that, is that you end up paying over and over with version upgrades, new computers, etc.

author: dannyf
author_rank: Super Contributor
timestamp: February 12, 2014, 10:13:46 pm
content: -The parts really don't have controllable internal pullups/downs?-some of them do.

author: cv007
author_rank: Frequent Contributor
timestamp: February 12, 2014, 10:51:30 pm
content: QuoteI belive the pic32mx1/2 do have pullups/pulldowns- look under change notification in the io ports sections of the datasheet. Good luck finding any concrete evidence, though. The errata has more info on it than the datasheets (you may still end up needing your own pullups).

author: true
author_rank: Frequent Contributor
timestamp: February 13, 2014, 05:38:03 am
content: Quote from: djacobow on February 12, 2014, 06:37:58 pmPIC32 doesn't (at least on 1xx/2xx and maybe 3xx/4xx that works). STM32 does.Quote from: cv007It's in the datasheet. It doesn't work.

author: nctnico
author_rank: Super Contributor
timestamp: February 13, 2014, 08:59:34 am
content: Quote from: poorchava on February 11, 2014, 07:03:41 amI still prefer NXP's ARM chips. No JTAG needed. A (USB) serial port is enough to program them.

author: cv007
author_rank: Frequent Contributor
timestamp: February 13, 2014, 10:39:50 am
content: QuoteI have been playing around with them, but have not even tried it yet. A good example of a nice arm chip is the lpc1114- good documentation, things work as described, few if any errata. Too bad these type of examples are not common.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 13, 2014, 08:50:32 pm
content: Quote from: true on February 13, 2014, 05:38:03 amNot sure where I got the no pullups idea from, but as you say the errata shows that pullups may not be strong enough, however it doesn't mention any issues with pulldowns.Just skimming the datasheet it's easy to miss, as no pullups are shown on the port diagram , and there is no description of the CNPU/CNPD registers in the section with the other register descriptions.

author: Jeroen3
author_rank: Super Contributor
timestamp: February 13, 2014, 09:09:12 pm
content: Quote from: nctnico on February 13, 2014, 08:59:34 amYou can't use USB to debug, you have to use the serial interface.Otherwise, STM is really the cheapest in throwing out dev boards. You can get them everywhere, even on eBay for less than $30 for the advanced one with lcd and ext mem.There are plenty IDE's and open source software available for stm, (chibios is a good example).Also separate chips are avaiable on sample and several resellers for private projects.ST is the preferred platform at my university, since they delivered a full pallet of STM32Fxxx boards for free.Next in line for me would be NXP with mbed and lpcxpresso, however nxp boards are expensive and you'll need an jtag segger/ulink (clone) to program them comfortable, those go from $700 to over $9000 (or $50 *Arrr*)Separate chips cannot be sampled and only the most popular ones can be bought online for private projects. Their new LPC800 family would be ideal for hobby projects, but you can't buy them anywhere!There also is TI, they have had some major issues with their 32 bit families. They recently withdrawn full families and create new ones. Won't step into those right now.And there are the other mcu's rarely found in the open source world like freescale, infineon, silabs, renesas

author: nctnico
author_rank: Super Contributor
timestamp: February 13, 2014, 09:38:11 pm
content: NXP boards don't have to be expensive. I used this one for a project:http://www.ebay.com/itm/New-NXP-ARM-Cortex-M3-LPC1768-Development-Board-3-2-TFT-LCD-Module-64KB-SRAM-/270962249071And this is not the cheapest one around. It has on-board debugging through USB. Dunno if that works though.

author: andersm
author_rank: Super Contributor
timestamp: February 13, 2014, 10:02:08 pm
content: Quote from: Jeroen3 on February 13, 2014, 09:09:12 pmFreescale were pushing their Kinetis Freedom boards pretty hard some time ago. There's boards with Cortex-M0+ and Cortex-M4 MCUs (no M4F though), costing in the range of $15-20.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 14, 2014, 12:20:31 am
content: Quote from: Jeroen3 on February 13, 2014, 09:09:12 pmFarnell have plenty in stock

author: nowlan
author_rank: Frequent Contributor
timestamp: February 14, 2014, 01:07:41 am
content: Is it mbed that drives everyone away? I recall someone at school saying they want to lock you out of everything.Been meaning to move into ARM chips at some point.Does the STM boards make the segger thing obsolete?I get the impression that m0 is the next step from AVR.However I see everyone mention m3/m4 which are full cpu, which need O/S from what I understand.

author: dannyf
author_rank: Super Contributor
timestamp: February 14, 2014, 02:48:05 am
content: QuoteIt only makes the segger thing obsolete for the type of chip on the board.If you want to program other chips or other families of chips from ST, you are (technically) out of luck.

author: andersm
author_rank: Super Contributor
timestamp: February 14, 2014, 07:20:48 am
content: Quote from: nowlan on February 14, 2014, 01:07:41 amCortex-M are "m"icrocontrollers. Cortex-A are "a"pplication processors, which you'll probably want to use an OS with.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: February 14, 2014, 08:52:05 am
content: Quote from: nowlan on February 14, 2014, 01:07:41 amNo CPUneedsan OS.m3 core parts cover a fairly wide range of capabilities - NXP do some fairly low-end m3 parts (LPC13xx)

author: benjamin
author_rank: Newbie
timestamp: February 16, 2014, 12:44:42 pm
content: I think the cheapest and easiest way of starting 32 bit programming is buying a STM32 disco board and download emblocks (+/- 40Mb download). Emblocks can import coIDE projects (also mplab8 and X) so you can also start using all the coIDE examples. Installing emblocks will give you a complete development environment with the GCC toolchain pre-installed and an asynchronous GDB server for STlink. It is the most simple setup because everything is in the distribution.The advantage of this asynchronous GDB server is that you can watch variable values while the target is running. Just hover with the mouse over a variable in the code editor.A very nice board, and also very cheap, is the F429-Disco boards with touch LCD. There are plenty examples as an oscilloscope, pacman etc.

author: dannyf
author_rank: Super Contributor
timestamp: February 16, 2014, 01:01:11 pm
content: QuoteemBlocks is my exclusive ide for anything pic24. I have been a user since its beta days and could not have been happier.It is what MPLAB X could have been and should have been. emBlocks was developed by one guy over a short period of time and it has been stable for a long time, the exact opposite of MPLAB X.