Recent changes
Order
tag order
CMSIS RTOS
RTOS
mbed Website Releases
Help
mbed NXP LPC1768
Firmware
Homepage
From the mbed microcontroller Handbook.  

Which binary runs FAQ

Question:

My mbed Microcontroller contains multiple binaries. Which one will be loaded/run when I press reset?

Answer:

The file with the newest timestamp will be loaded and run on reset. If you want to run a different binary, simply ensure that it has the newest timestamp. You can do this in Mac/Linux using the 'touch command.

In Windows XP its not quite as easy. There are freeware utilities to change the timestamp of a file. It is probably easier to make a new copy of the file you want to run, and delete the old one.

Note: If you swap the microcontroller between PC's with different clocks, you may see some unexpected results!




calendar Page history
Last modified 22 Jul 2010, by   user Dan Ros   tag No tags | 3 comments  

3 comments on Which binary runs FAQ:

02 Feb 2012

I am new to mBed but a very experienced embedded developer. My targets typically contain two pieces of software: a small image providing bootstrap loader and persistent configuration data in low memory and one or more application images stored higher in flash. It was a piece of cake to get the bootstrap/loader into the mBed, but now I need to load the application image *without erasing the bootloader*. Is there a way to tell the mBed to load one .bin file at the start of flash and another .bin file elsewhere (e.g. to 0x00008000)?

UPDATE: I implemented 2 solutions: 1) combine the bootstrap loader and the application image into a single .bin file using common cygwin and gcc tools (cat, sed, unix2dos, arm-elf-objcopy). Unfortunately this solution also wipes everything in flash between the bootloader and the application image which is where I store persistent configuration.

2) Use the bootstrap loader to load the application image via IAP.

The mBed is a nifty platform, especially for folks new to embedded development; for more experienced users, it would be nice if it supported loading .hex files in addition to binaries...hex files contain more information such as load addresses, sizes, etc. and would allow loading different regions of flash with different things.

07 Mar 2012

Is the function to read a file's timestamp available to developers? It seems that stat.h isn't available and I'd love to be able to use timestamps in LocalFilesystem

Thanks! Adam

21 Mar 2012

Adam, I have a similar request. I would like to be able to set the timestamp of a file in the LocalFileSystem. I know the standard library functions do NOT allow this to do. However, when you access that same area using a PC that is connected to the USB I/F of the mbed, there is a timestamp set by the PC. This timestamp must be accessible from within the mbed system as it is used by the bootstrap loader to decide what .bin-file to execute. Is there another FileSystem we should use to get access to that detailed view on the system?

The purpose is to be able to upload new applications over ethernet using a tftp client(which I've already implemented). Once they have been downloaded, the application can restart itself and the new application can be executed.

PS. Is there some information available on the system architecture that explains the memory usage and the different filesystems?

thanks, Lieven

Please login to post comments.