NXP bootloader does not work with .bin files from mbed compiler

11 Nov 2013

Hi guys I've been programming with the mbed for a while now and own another devboard with the identical processor on it. The landtiger board which is also mentioned on this website. I programmed it with a bootloader in order to copy bin files as fimware. But the ones I download from the mbed compiler do not work? Are there any configurations that I are missing? Does anyone have some expierence and can help me out of my mess?

The programm i wrote is a simple hello world one over the serial connection. When I export it as uvision project it works fine after i configure the ide for the lpc1768 in the right way. but why does the same programm not work from the mbed compiler as bin file?

thank you for your attention

gangben

11 Nov 2013

The USB bootloader approach requires some modification to the addressmap of the compiled code. This is needed since the bootloader itself resides in memory also. There is more info somewhere on this site. However, I would not bother with that when you have the landtiger board. Just use the serial bootloader with flash magic or even better use the on-board j-link programmer to flash your mbed compiled bin directly into the lpc1768. Check my landtiger page and the link to my landtiger manual.

11 Nov 2013

First thanks for the information but im actually looking for a general solution for selfmade pcbs. I like the plug and play solution of the mbed. I will look up the suggested ways of yours. which one would you guys suggest for my purpose. Id really love to use rather the online compiler then other ides that are not totally free to use.

12 Nov 2013

The jtag/swd solution and the serial bootloader will allow you to use the mbed online compiler. They are however less plug and play than the regular mbed. This is not a big issue when you rarely need to update the code. Full mbed compatibility can be achieved when you include the mbed sda interface. The hardware and software has now been open sourced by mbed. Search the site for details.

12 Nov 2013

Thank you. With serial bootloader you mean the bootloader mentioned in the cookbook right?

http://mbed.org/cookbook/lpc-bootloader

ben

12 Nov 2013

Benjamin Richter wrote:

Thank you. With serial bootloader you mean the bootloader mentioned in the cookbook right?

http://mbed.org/cookbook/lpc-bootloader

ben

You could do it that way (with an mbed in between the online compiler and the target), but actually the lpc1768 on your targetboard has an internal bootloader that accepts a program that is downloaded through its serial port. You can save the online compiled binary on your pc, convert the bin file to a hex file and then run NXPs "flash magic" application on your pc. The free flash magic tool will download the code to the target using a serial port (possibly with a USB to serial converter in between).

26 Nov 2013

Since i passed out for a while to some health issues I'm trying now to use the serial. Please tell me how do i convert a downloaded bin file to an hex file?

Furthermore Id like to know in what condition my targetboard has to be? Do I have to erase the chip first or do I have to load the nxp bootloader first?

gangBen

26 Nov 2013

What you want is the bin2hex utility. Now there are a ton of them around, and some of them have some issues with code size and stuff. With that a search here on the site give options, such as: https://mbed.org/questions/1147/Bin2Hex-Utility-for-64bit-Windows-7/.

Your target board needs to work, so the basic stuff such as power supply. Then you need to put it in ISP mode, don't have this board myself, but a somewhat similar one I do have has a reset button and an ISP button, there I had to press ISP button, and reset it while keeping the ISP button pressed. Then it loaded in serial bootloader mode.

Next connect it via UART0 with your PC (apparantly the board has no Serial <> USB converter, so either you need a serial port, or a seperate Serial<>USB bridge). Launch flashmagic and you are good to go.

27 Nov 2013

Thank you very much it worked. But one last thing Id like you to ask is there a bin2hex converter and flashmagic available for ubuntu? Im thinking of changing my os.

27 Nov 2013

Some years ago I used lpc21isp with a LPC2138: this is the flashmagic for linux.
The typical syntax is
lpc21isp -bin combo.bin /dev/ttyS0 115200 14746
(where /dev/ttyS0 is the serial port I am using and 115200 is the baud rate and 14746 is the speed is crystal in KHz of the board ...... YES : .bin is supported)
Look at http://sourceforge.net/projects/lpc21isp/
Robert