Flash programming of Mbed

22 Feb 2011

hi, I have formatted my Mbed. Now I am trying to use it with new bin file its not working can anybody help me to solve this problem.is there any procedure after format that i have to follow....? plz help....

22 Feb 2011

I have formatted my mbed several times; and it works just fine. However, there is one thing:

If mbed.htm is missing when you power the mbed, it deletes all files on the drive and creates a new mbed.htm. So if you format it, you have to unpower/power it before putting your bin file on it.

Also, I use windows to format. There are some settings; I use plain 'FAT' with 512 bytes sectors.

22 Feb 2011

I have a similar problem. I accidentally formatted the MBED drive. After that the program that was already in the MBED microcontroller stopped functioning (i could verify that all the IO operations have been suspended). The mbed.htm file no longer appears in the MBED drive. The MBED drive is detected, a new binary can be saved on to it. But the program execution doesnot happen. The LED on the MBED shows that there is communication happening between the PC and MBED when i download a new binary file (indicated by blinking of the LED). Can anybody give suggestions to make the MBED work properly?

22 Feb 2011

Hi Rahul and Ganesh,

As Jeroen says, if you delete the MBED.HTM file or format the drive, it will reappear after the board is power cycled.

When there is no binary on the mbed flash drive, the LPC1768 is held in reset and so will not be executing any code.

Can you confirm that you've completely powered the mbed down after formatting the drive. The reset button on the mbed is *NOT* a reset for the interface (the part of the mbed that runs the USB drive) it is a request to the interface to reset the LPC1768.

Were you using Windows machine when you formatted? The mbed is still appearing as a flash drive, and Windows detects it as having 2Mb capacity?

Thanks, Chris

23 Feb 2011

Hi Chris,

I have rechecked that the MBED is powered down completely after formatting and then powered up. The MBED.HTM file is not appearing.

The MBED does appear as a flash drive and windows detects it as having a capacity of 2 MB.

/media/uploads/dhavalacg/mbed1.png

I used windows xp embedded machine for formatting. What can be the reason why MBED.HTM is not reappearing? I have one more MBED board that i formatted on windows xp. That MBED is working fine. It shows MBED.HTM after power cycle and is running the loaded programs correctly. Can windows xp embedded and windows xp make a difference?

Rahul

23 Feb 2011

Hi Rahul,

So you have two mbeds, the one you format with Windows XP works fine, and the MBED.HTM file reappears. The one formatted with XpP Embedded, works, runs binaries etc, but doesn't replace the MBED.HTM.

Can you try formatting the mbed that doesn't currently have the MBED.HTM file with the XP machine, and see if that restore the MBED.HTM file?

If it does, then we'll have to take a closer look at the difference between the two formats. If it doesn't we'll have to think about why the mbed isnt restoring the file.

Let me know how you get on.

Thanks, Chris

23 Feb 2011

Hello Chris,

One correction, the MBED that i had formatted with XP embedded does not work. The MBED does appear as a flash drive and i can only save the .bin files in it. After pressing the reset, we expect the new .bin file to be loaded into the uC flash and the program should start functioning. This is not happening though the MBED is detected as a flash drive. Also when i plug in the MBED into the USB port apart from appearing as a flash drive, MBED serial port is also shown in the device manager (I have installed the USBSerial driver).

I have also formatted the MBED on the XP machine, that has not restored the MBED.HTM file.

Considering this situation, i suspect that when i press reset button, though the LED goes off, the uC is somehow not getting reset. Are there two parallel switches in the reset push button? one might be switching on and off the LED and the other that is actually connected to the uC reset and the MBED chip reset might not be working. Is that a possibility? or does the fact that MBED appears as a flash drive and serial port rules out this possibility?

I would not like to play around with the hardware, i do not have the facility to work with small SMD devices.

Please let me know how to go about solving this problem.

Thanks,

Rahul

23 Feb 2011

Hi Rahul,

The reset button is connected to the interface device, and requests that the interface resets the LPC1768. The LED is also controlled by the interface device, so if the LED is going out, the reset is happening.

As the binaries on your mbed are still accessible, could you zip them up and send them to support@mbed.org - i;d like to rule out there being something strange about the binary. If you can send the source for the binaries, that would be helpful too!

Thanks, Chris

23 Feb 2011

Hi Chris,

The binaries are accessible and are running on the other mbed. And those have been built using the sample demo programs that have been provided in the handbook links. I will still send the two .bin files on the email id that you have provided.

The source code is

  1. include "mbed.h"

Serial pc(USBTX, USBRX); tx, rx

int main() { pc.printf("Hello World!\n"); }

This generates the file demo_1768.bin

The other program that i have tried is

  1. include "mbed.h"

DigitalOut myled1(LED1); Serial pc(USBTX, USBRX); tx, rx

int main() {

while (1) { pc.printf("Hello World!\n"); myled1 = !myled1; wait(1);

} } this generates the file test_serial_LPC1768.bin

Thanks,

Rahul