10 years, 7 months ago.

Newbie to mbed and ARM

Hello fellow engineers,

I have worked with small 8bit AVR microcontrollers for several years. But I find the need to upscale the processor for some projects. Then I found the mbed which is exactly what I was looking for. I am a complete newbie to ARM and have a few questions that I couldn't quite resolve yet. Perhaps someone has experience and can help me.

I have started making projects with the mbed module. That is great and easy and development is fast using all the libraries. But at some point I will want to put the project to a real prototype with own PCB. How would I then get the program in the controller? I found a cheap JTAG programer the Ulink 2 from "real view" on ebay. Would that work? What programming software would work with that? Can the mbed libraries be used on any LPC1768 on an own board or is it limited to the mbed module (and all the libraries)? Is it really possible to export the program and libraries to work with the GNU ARM GCC (as that is free too)? I suppose the libraries would only be usable for the NXP1768? Is it also possible to export the program to the CooCox environment?

Thanks for now!

Regards

Markus

3 Answers

10 years, 7 months ago.

Hi, thanks a lot for the answers! Have I read it correct that the bootloader for flashmagic is integrated in the NXP automatically? that would be a great feature.

Accepted Answer

That's correct, the LPC1768 has a serial bootloader burned into a separate ROM right from the factory. You just need to hold a pin low on reset in order to enter it. In fact, it may even enter it automatically if the chip is blank, but you'll have to check the datasheet to make sure. The LPC11U24 chips have both a serial bootloader, and a USB bootloader. If VBUS is present it enumerates as a mass storage device. This is especially nice since it's just drag and drop, no software needed!

posted by Neil Thiessen 19 Sep 2013
10 years, 7 months ago.

I'm fairly new to mbed as well, but I'll take a crack anyway:

  • As far as I know, all ARM Cortex-M chips use SWD for programming and debugging. This is a simplified variant of JTAG which has reduced pin requirements, and is usually wired to a 2x5 pin .050" micro pitch connector. You're most cost effective SWD interface is probably NXP's LPC-Link 2, which can run different firmware images to emulate different manufacturer's debuggers. This will allow you to support many different toolchains.
  • As far as software is concerned, most mbed guys recommend Keil µVision, but unless you only have 32KB of code you'll be paying through the nose for it. I've used LPCXpresso (an NXP-only variant of code_red's Red Suite) with good success, but I haven't tried exported to it from the online compiler.
  • You shouldn't have a problem using the mbed libraries on your custom board. The magic "interface chip" is just another micro that acts as an SWD programmer, serial to USB bridge, and a CMSIS-DAP debugger (for Keil). Therefore, when you implement your custom board the only features you'll really lose are the serial to USB bridge (but you can still use the serial interface), and any features that use semihosting to communicate with the interface chip, most notably LocalFileSystem.
  • I've never used GNU ARM GCC so I can't speak for it. I can say, however, that the online compiler is much, MUCH, more efficient than the version of GCC that ships with LPCXpresso. Therefore, if you export to GCC, expect a code size increase.
  • If you're referring to the mbed libraries, they actually support quite a few more targets than the LPC1768, most notably the LPC11UXX series, LPC800 series, and even the Freescale KL25Z freedom board.
  • I can't speak for CooCox either since I've never used it, but I would kind of doubt it will work without some major hacking.

10 years, 7 months ago.

Hi Markus, in addition to the above reply: you can also download the executable code produced by the online mbed compiler to your targetboard using the serial port and a free pc application called flashmagic. This first needs a conversion of the bin file to hex using free bin2hex. You may also want to use a USB to serial interface like those offered by FTDI. They support printf and keyboard as well as flashing code through flashmagic. Checkout my notebook on the lpc1768 landtiger for more info.

Also pay attention to what bin2hex tools you use as some of them don't create correct binary output. see this post for a free tool that works : https://mbed.org/users/frankvnk/notebook/lpc1768-mini-dk/#c4753

posted by Frank Vannieuwkerke 17 Sep 2013