Linux & MAC DipCortex Bootloader - LPC11U24 LPC1347

Talk about our 40 Pin Dip ARM Cortex M3 / M0 Here

Linux & MAC DipCortex Bootloader - LPC11U24 LPC1347

Postby Carl-SolderSplash » Sun Dec 08, 2013 1:47 pm

The built in boot loader is designed to work with windows, Linux and Mac OSx write to mass storage devices slightly differently which can cause corruption.

The fix for Mac OSx seems to be overwriting the firmware.bin with your own. So when using mbed you will need to rename the download .bin to firmware.bin and copy it accross, dont delete the firmware.bin on the DipCortex first.

OSx also likes to write system files to any directory or drive it touches which is unwanted in this case, this guide shows you how to disable this behavior http://apple.stackexchange.com/question ... ds-and-usb

For Linux If the method above doesn't work you can try using the dd command to copy it :
sudo dd if=your_new.bin of=/dev/disk/by-label/CRPx20DISABLD seek=4

More details can be found here :
AN11305: USB In-System Programming with the LPC11U3X/LPC11U2X - http://www.nxp.com/documents/software/AN11305.zip
AN11305v.1.pdf
User avatar
Carl-SolderSplash
Site Admin
 
Posts: 223
Joined: Sun Mar 17, 2013 11:15 pm

Re: Linux & MAC DipCortex Bootloader - LPC11U24 LPC1347

Postby ahochan » Tue Jan 28, 2014 4:38 am

Hi,

I am using OS X Mavericks, and I have tried the method outlined in the AN11305 note.

However, when I try to run the included tool, I just get this:

NXPISP will flash firmware.bin into the next NXP ISP device connected to this mac.
Reprogramming device...
There was an error updating the firmware.

Any ideas?

If I use a LPC-Link2 to upload a .bin file created with mbed, will this kill the bootloader, or is this safe?
ahochan
 
Posts: 4
Joined: Tue Jan 28, 2014 4:33 am

Re: Linux & MAC DipCortex Bootloader - LPC11U24 LPC1347

Postby Carl-SolderSplash » Tue Jan 28, 2014 9:03 pm

Hi,

The boot loader is in ROM, so there's nothing you can do wrong to remove it.
You can flash with an LPC-LINK2.

From other Mac Users, They managed to get the USB bootloader to work by overwriting the firmware.bin rather than deleting it and copying your new .bin.

So this means renaming your .bin to firmware.bin Did you try that?
User avatar
Carl-SolderSplash
Site Admin
 
Posts: 223
Joined: Sun Mar 17, 2013 11:15 pm

Re: Linux & MAC DipCortex Bootloader - LPC11U24 LPC1347

Postby ahochan » Wed Jan 29, 2014 12:15 am

Hi,

Yes, I tried both methods.

I use this code:

Code: Select all
#include "mbed.h"
 
// WiFi DipCortex has 1 LED shared with the button on P0_1
DigitalOut Led(P0_1);
 
// DipCortex has 2 LEDs P0_1 and P1_22
DigitalOut Led2(P1_22);
 
int main()
{
    while(1)
    {
        Led2 = !Led2;
        Led = !Led;
        wait_ms(250);
    }
}


This produces a 1k .bin file, which I renamed to firmware.bin and copied directly over the existing firmware.bin. This seems to work, but when I reset the device, the LED does not blink, and the firmware.bin timestamp and size matches the original one (not sure if this last part is expected or not)

I'm testing on a Wifi DipCortex.
ahochan
 
Posts: 4
Joined: Tue Jan 28, 2014 4:33 am

Re: Linux & MAC DipCortex Bootloader - LPC11U24 LPC1347

Postby Carl-SolderSplash » Wed Jan 29, 2014 12:36 am

Can you try this via a terminal window :

dd if={new_firmare.bin} of=/Volumes/CRP\ DISABLD/firmware.bin conv=notrunc

If that works then you create an Automator application to support drag-and-drop of the file to your board. Just create a "Run Shell Script" with the following command:
dd if=$* of=/Volumes/CRP\ DISABLD/firmware.bin conv=notrunc
User avatar
Carl-SolderSplash
Site Admin
 
Posts: 223
Joined: Sun Mar 17, 2013 11:15 pm

Re: Linux & MAC DipCortex Bootloader - LPC11U24 LPC1347

Postby ahochan » Fri Jan 31, 2014 3:37 am

Using dd worked great! Thanks for the help!

Is there a way of booting the device with the new firmware without pulling the USB cable? Just pushing the reset button doesn't seem to do anything.
ahochan
 
Posts: 4
Joined: Tue Jan 28, 2014 4:33 am

Re: Linux & MAC DipCortex Bootloader - LPC11U24 LPC1347

Postby Carl-SolderSplash » Fri Jan 31, 2014 4:47 pm

Super, glad it worked.

Which board are you using, the Wifi DipCortex or an M3/M0?

We ran out of room on the WiFi dipcortex to fit a reset button so it doesn't have one, The standard DipCortex has one that should work fine while in bootloader mode. Let me know if yours doesn't.

A quick way to reset the board and start it running code is to pull pin 1 (reset) to ground briefly, I use a breadboard jumper cable to do this. The shell of the USB connector is connected to ground.
User avatar
Carl-SolderSplash
Site Admin
 
Posts: 223
Joined: Sun Mar 17, 2013 11:15 pm

Re: Linux & MAC DipCortex Bootloader - LPC11U24 LPC1347

Postby ahochan » Sat Feb 01, 2014 3:52 am

Ah, I see. I have the Wifi DipCortex board.
ahochan
 
Posts: 4
Joined: Tue Jan 28, 2014 4:33 am


Return to DipCortex M3/M0

Who is online

Users browsing this forum: No registered users and 2 guests