??? 02/23/11 22:17 Read: times |
#181273 - RTFM Responding to: ???'s previous message |
Jan Waclawek said:
Andy Peters said:
Neil Kurzman said:
Why not make the Bootloader a separate program.
But I agree the Bootloader should not erase itself. A separate program is ideal. I just don't know how to locate it starting at 0x8000, This is toolchain-dependent, and often boils down to linker magic. As I said, I don't Keil, but I'd start with reading the fine manual... ;-) I have been staring at TFM for the better part of the day. I seem to always end up with a single combined object file which has both the common area and Bank 2 included. This object file can also be converted to a hex file with both common and Bank 2 included. I think the solution might be easy: I am always programming the micro's flash in 1024-byte chunks because that's its page size. So I have a host program that reads in the hex file and parses it and arranges it as one big array of 64k bytes in the correct order, meaning starting at address 0x0000 and incrementing until completion. (The buffer is initialized to put 0xFF in each byte so when the sparse hex file is read and parsed, unassigned memory locations default to 0xFF.) Since I now have the entire image of the micro flash in this buffer in host memory, I will just send and program only the first bank (0x0000 to 0x7FFF), ignoring the data for the Bank 2 (starting at 0x8000 in my buffer). This should be fine. The only code in Bank 2 is the firmware updater, and that doesn't need to be changed with the rest of the code. (And if it does, it needs to happen using JTAG.) Now as long as my application fits into the 32k bank 0, I'm good! -a |
Topic | Author | Date |
Odd use of code banking | 01/01/70 00:00 | |
I don't know about Keil's... | 01/01/70 00:00 | |
Seperate Program? | 01/01/70 00:00 | |
separate program | 01/01/70 00:00 | |
Often special lock bits for boot regions | 01/01/70 00:00 | |
linker magic | 01/01/70 00:00 | |
RTFM | 01/01/70 00:00 | |
You are not good to go | 01/01/70 00:00 | |
updater and libraries | 01/01/70 00:00 | |
which is why | 01/01/70 00:00 | |
Please Reconsider | 01/01/70 00:00 | |
the golden rule | 01/01/70 00:00 | |
re: Reconsider | 01/01/70 00:00 | |
If needed... | 01/01/70 00:00 |