Is there a way to force the tools to place a function at a specific memory location? I am working on an application updater. The boot/update code starts at 0x0000. The application code would start at 0x8000. Under normal (not updating) circumstances the boot code simply jumps to 0x8000 and life goes on. In order to debug the boot/update code I'd like to place a dummy function at 0x8000 (flash some LED's, whatever). Can I do this from the bootloader project? Thanks, -Martin
Sure --- see the linker manual on how to move whole segments of code to special addresses, then enter the relevant options into the "Linker" tab of the target's options dialog. The hard part is how to reroute interrupt handler calls from the boot loader to the application.
The boot loader will not use interrupts at all. The interrupt vectors will just be re-routed to higher memory locations. Not the most efficient, but it should work fine. The other interesting alternative is to have the application live in low memory and the boot loader/updater somewhere in high memory. If no interrupts are used for the firmware updater, it should be quite easy to update firmware. The downside is that there's little in the way of recover if the update operation is interrupted. Upon reset code execution starts at 0x0000 ... into corrupted code. Bad idea. The first approach guarantees good code (the loader) in low memory at all times. I'm sure that there are more opinions on this than registers in an 8051. -Martin
Upon reset code execution starts at 0x0000 ... into corrupted code. Bad idea.The first approach guarantees good code (the loader) in low memory at all times. Not really. I recall one case where a failure happened just as the bootloader finished (i.e. during the rerauting of the start vector) and BOOM!. anyhow, why do you muck with this, there is a plethora of ISp chips around these days. Erik
End-user firmware updates. ISP is only good for engineers during development.
Prepare to be bombarded with a myriad of posts extolling the user-friendliness of FlashMagic...
here is the first: With FlashMagic "packed" and NoTouch, you can make a "connect RS-232 cable, put media in PC, count to 239, disconnect cable" update for your customers - I do. Erik
USB?
I am uploading DATA (not code) using a Cypress CY7C67300. There is free code from Cypress for making a USB MASTER which allow update from keychain USB disks. The Cypress offerings (some are '51 based) all have USB upload of program as well. Erik