views:

133

answers:

4

I will embark on the ARM Cortex M3 bandwagon soon with an official training (CPU side).

Now, I did a bit of Arduino and AVR before and have some basics in electronics but I am mostly a software developer. I've read most topics in here and quite a bit elsewhere regarding the tools available and they have been really helpful. What I need is something to connect all those answer elements together.

I would like to equip myself with a starter kit that is general enough to get me going and that at least allows me to experiment different hardware/software combinations (Steppers, CAN-Bus, SPI etc...). I am looking at the following list (please feel free to add more items!):

  • Cortex M3 Chip
  • Evaluation board
  • Tool Chain
  • JTAG tools

For the chip I would like one of the higher-end models to be able to try a bit of everything. The NXP LPC1768 seems like a good choice but there is also STM and Stellaris to consider.

Interesting candidates for the board right now are the Keil MCP1760, the STM3210E-EVAL but I am afraid of vendor lock-in as I would like to be able to try various toolchains on a single board. mBed is very attractive but out of the equation because of it's online compiler (unless a regular compiler can be used as well)

For the Toolchain, I have a "feeling" towards IAR, Rowley Associates. I would prefer ease of use/well-doneness vs open source and preferably tools that could be used on multiple targets.

Do I really need a JTAG unit? If it's a "standard industry tool" like it seems to be I would like to at least get some experience on it. It looks like another source of vendor lock-in tough. Would I be better of using an external one I can familiarize myself with or just using one included on the evaluation board?

Basically, I need help in choosing a winning combination for the aforementioned categories. Is it even possible or am I being naive and should look at saving costs because I will end up buying one of each in the end?

Thank you.

+1  A: 

I'm also a software developer originally. I used a couple of different kits, but the one I found most easy to use and did most with is mbed. You can literally get it up and running in five minutes from opening the box. No need to install any IDEs from the CD, no need for the JTAG dongles, no need to pour over datasheets - just write the code, compile and run.
Yes, some complain that it's "tied" to the online compiler. But I only heard that from people who did not actually try it. And it's just not true - you can still use any other toolchain that can produce binaries for LPC1768: IAR, Keil, CodeSourcery, Yagarto, or your own toolchain. I did not myself yet find a case for that, but it's certainly possible.
Probably the biggest disadvantage of mbed is that it does not expose the JTAG interface and so you cannot debug interactively. So far I did not find this critical but it might be important if you do a lot of low-level work.

Igor Skochinsky
One big drawback to the cortex-m3 is that ARM changed to a jtag interface that uses fewer pins (some serial thing even though jtag is already serial) and they wont release the documentation on it with out an NDA, at least that was the case when I tried earlier this year. So going with something like the mbed or stellaris where you are not locked into a sandbox, but have a way to load your programs is desireable for a cortex-m3.
dwelch
Actually, SWD (two-wire JTAG) is an option on Cortex-M3, not requirement. For example, LPC17xx still has the full four-wire JTAG (but LPC11xx and LPC13xx are indeed SWD-only). And the SWD docs are definitely available without NDA, though you might have to register at arm.com to download them.
Igor Skochinsky
The mbed would have been my first choice for home projects, mainly because of the price. I am currently looking at training from Doulos and would eventually like to have some custom boards manufactured to save on costs. In a learning experience I was thinking of going with the full outfit (in-depth M3 learning, jtag, source debugging etc.) Maybe I should not rule it out just yet?
Zot Ditz Myo
You can definitely go lower level later. With mbed you can start with provided C++ classes, then switch to direct register access/your own interrupt handler (possible with mbed/online compiler), then for example make your own board with an LPC1768. You can even reuse firmware you made for mbed. See also http://mbed.org/users/chris/notebook/prototype-to-hardware/
Igor Skochinsky
+1  A: 

You might want to look at the Atmel ATSAM3U-EK dev kit (approx. $200 from Digi-Key). It has an LCD touchscreen, accelerometer, temperature sensor, analog inputs, JTAG, two serial ports, and USB 2.0 (built into the SAM3U).

The thing I like about the SAM3 series is the easy bring-up. It has an on-board ROM as well as flash for program storage. From the factory, it boots the ROM (you later change it to boot from flash), which fires up the USB port, which declares itself to be a USB Communication Device Class (CDC), and runs the SAM-BA boot monitor. It also has an on-chip ERASE pin that resets the whole thing to factory settings.

So all you have to do, to reprogram from scratch, is:

  • Jumper ERASE for at least 200 ms with the power on
  • reset and plug the board into a USB port
  • run Atmel's SAM-BA program on either Windows or Linux
  • select the serial port
  • enable flash writing
  • select your binary file and send it
  • set it to boot from flash
  • unhook the USB and hit reset again.

No dongle or JTAG box needed. I know that reprogramming via JTAG through IAR is probably fewer steps, but I like knowing that there's a way to get to a known state if the other tools break.

The IAR toolchain supports the SAM3 series, and there is a port of FreeRTOS to SAM3U + IAR (which I'm now trying to port to SAM3U + GCC since IAR's $5K licenses are too rich for us).

Another neat thing about the SAM3U-EK: It has a NAND flash on board, and if you plug the board into a computer while it's running the demo, it will mount the flash on your computer as a "flash drive". On this flash you will find the documentation, schematics, demo programs and libraries for GCC, IAR, and Keil toolchains, and instructions and files for restoring the demo program to the board (useful in case you think you broke something).

Mike DeSimone
This really looks like a nice board. If I am to have a loaded board though, Ethernet and CANbus are high are my list of priorities and not present here.
Zot Ditz Myo
+1  A: 

I have a thumb simulator http://github.com/dwelch67/thumbulator/wiki/thumbulator this is only thumb and not thumb 2 but the cortex-m3 does both thumb and thumb2. You wont need to worry about the differences for a while. The regress directory has a make file for both gcc and llvm examples. The readme might even cover the topic.

both llvm and gcc are perfectly fine, no need to buy any software. Most folks out here providing free help are going to be gcc users. Codesourcery is the current place to get the newer/better gcc (for arm). The lite version is perfectly fine. Rolling your own gcc is a relatively easy thing, but maybe not something you are into. A nice thing about llvm is that it is always a cross compiler and pre-builts usually have several/all targets.

I also have stellaris and mbed and other cortex-m3 examples out there. I like stellaris, not a fan of lpc, avoid the expresso, the mbed is actually not bad. The crazy bright blue leds give me a migrane so I replaced them with green, otherwise it works just fine, easy to use. Igor is right you are not locked into their sandbox like you are with the expresso, I have an example blink the leds using gcc to compile out there somewhere. you simply copy the .bin file to the thing which looks like a flash thumb drive and press the reset button to load the new file.

sparkfun.com has the stm32 header board for under $50 plus the mbed and who knows what else. The stellaris boards are in the sub $100 range and are perfectly fine. I bricked my 811 almost immediately by accidentally doing exactly what the warning said not to do. Turned my jtag gpio pins the wrong way and...game over. The 1968 and other non-811 series are either non-brickable or not as easy to brick. The stellaris boards chew up all the io with onboard peripherals which is fun for a while, but not if you want to do something other than just how to use those peripherals. You will want a jtag wiggler if you are using the stm32 header (avoid the stm primers) amontek makes a good one, the jtag-tiny, and the olimex one should work fine, but I actually dont know that I ever got mine out of the box. In theory one stellaris board can be used as a jtag wiggler for another or for other cortex-m3s. if you have a stellaris board you wont need anything else, everything you need comes in the box for one price, well if you dont want to use that toolchain then you can download one listed above.

dwelch
It's true that getting the chip out of an evaluation board is my goal in the medium term. Starting out with a board full of gadgets really appeals to me in order to focus on learning the CPU and not how to interconnect things. That stm32 Header sure looks good though! PS: what's the difference between a JTAG and a wiggler? if any?
Zot Ditz Myo
Same thing. What I call wigglers are bit banged jtag, vs having a purpose designed jtag interface. Used to use parallel ports, but now use usb to parallel port type chips.
dwelch