Other Parts Discussed in Thread: UCD3138
hi, can you provide custom bootloader project example for UCD3138? I mean of course both bootloader and main program. The main role of the BL will be to program / erase main program using custom serial interface
My assumption so far are:
- for good code practice the software interrupt used to write/erase flash should be part of custom BL project, the data flash write/erase in main program should be done thru SW interrupt placed in bootloader code
- since Fast and Standard Interrupts are used in main program, they shouldn't be used in BL and their jumping vectors should be forwarded to the main program address
- the BL load asm file has to be modified, so .vectors section points to right fast and standard interrupts, for example to second "virtual" vector fable at address 0x800
- the main program asm file has to be modified, so .vectors section points to right software interrupt location in BL
- the linker cmd in BL project sets PFLASH (RX) : org = 0x00000020, len = 0x000007DC keeping the interrupt vectors and place for checksum
- the linker cmd in main program project sets new "virtual" vector table VECS : org = 0x00000800, len = 0x00000020, but only fast and standard interrupt will be used here
- the linker cmd in main program project sets the PFLASH (RX) : org = 0x00000820, len = 0x0000xxxx
I'm not sure should I keep rest of the default load asm file in main program? the load asm in the bootloader will set the stacks and ram, but it may be useful to "clean up" everything after exiting the BL so main program gets full resources and clean ram. Also this would allow to have different stack sizes for BL and main program.
Am I missing something more? The example projects would be great reference, since there are of things to take care of.