Wednesday, January 9, 2013

An Adventure in CooCox and Cortex M4 (STM32F4)

From the outset I think this is going to be a multipart blog of my journey though a new IDE and processor.  As before, this series will serve partially as my notebook of how to do it again and your more-or-less guide to how to do it the right way, including visibility of some pitfalls which might try to grab you.

Project Goals

A little intro to what I am trying to achieve.  I've come up with a brilliant idea for a product that until recently could only be done on a PC or single board computer (SBC) at great cost and inconvenience...at least when you come from a microcontroller and consumer product background like me.  I recently discovered the ARM Cortex M4 with integrated floating point unit (FPU) and realized that something like this running at 168MHz is exceeding the performance of my old Intel 486DX and possibly even my first Pentium MMX.  I decided it was time to go for it and created my shopping list:

  • Cortex M4
  • Development board with Ethernet connectivity
  • JTAG hardware
  • IDE and compiler that wouldn't limit my solution size
  • Schematic capture and board layout software suitable for a distributed development team
  • Be as cheap as possible since we don't have a customer yet!

My preferred flavor of ARM is the ST Microelectronics family so I started with the STM32F4 and chose the Olimex STM32-E407 development board. Olimex, based out of the eastern European country of Bulgaria, has great products, at great prices, with valuable support, and cheap shipping to the US.  Olimex also has great FTDI-based JTAG options, like the ARM-USB-TINY-H, that are very inexpensive and yet very powerful.  In the past I've used the TINY with IAR and Eclipse via the OpenOCD GDB Server so I was prepared for the manual process of starting the server and messing around with config files...but I was in for a treat.

Now enter the IDE choice.  I was going to use IAR Embedded Workbench for ARM because it is always easy to get started and the support is great.  In the past I've gotten away with the 32KB Kickstart version because my STM32F103 projects were never really that crazy, even with USB.  I started estimating my solution size and I knew 32KB wouldn't cut it, so I checked the prices on the full versions of IAR and immediately started thinking Eclipse again : )  Started Googling for new things that I may have missed in the past year and I found CooCox.org which is a free commercial (aka closed source) product based on Eclipse.  Now, you'll have to excuse me, but I don't really understand how free and commercial go together nor do I get how they close-sourced something based on Eclipse.  However, the product is amazing.  Incredible support for all the ARMs I care about, uses the ARM compiler, natively employs the Olimex JTAG, great community of developers, and actively being improved.  After a few months with it I actually prefer it over IAR thanks to the great text editor and debugger.  The only downside is that the Java-based engine is a bit slow to spool up the debugger in Windows (the only supported OS) on my aging MacBook Pro 2.4GHz Core2Duo.  Did I mention it is free and completely unlimited in code size?  Much more on all of this later.

Briefly on schematic and layout: I used to use OrCAD Capture and Layout.  Well, Layout was retired in 16.2 and I decided if I had to learn something new (like 16.3+ PCB Editor) then I better be smart about where I spend my time learning.  OrCAD isn't cheap, but its not expensive.  Until you have three engineers who want to share files and co-develop.  I'll save the EDA comparison for later, but for now go read about KiCAD at their website and on Wikipedia.  Perfect? No.  Free? Yes.  Cross platform? Mostly...stick to Windows or Linux.

Ok, that's the project intro. Time to delve into CooCox so I can save some of my thoughts and get back to work.

No comments:

Post a Comment