Hi @all,
i want to split bootloader code from application code in seperate projects. I find some good hints in this forum, f.e. https://community.freescale.com/message/29324#29324. But my project still don't work (who would have thought this ) I use CW 5.9.0, C-Code projects, WinXP, MC9S08DV32 Controller. Till now i have create bootloader project and app project, and both work fine for itself. In the PRM files i seperate the ROM segments for bootloader code and app code.Both projects have standard _Startup codes (generated by CW) and the entry point for self written functions is void main(void).
Now i want to add bootloader.s19 to my app by using HEXFILE bootloader.s19 instruction in PRM File. Doing this i get problems with startvector! There is an error in debuggers command window: Code loading overlap detected in range 0x0000FFFE..0x0000FFFF and when i run the application with added bootloader.s19, the startvector goes to app instead of bootloader! I hoped that the startvector become the address of bootloader startup, by adding HEXFILE bootloader.s19, but it don't. How can i add my bootloader project/code/s19 to the app-project, where the bootloader starts after reset?
Hello,
This error is indicative that the reset vector is defined in two different places. This will be possibly be within a vector table, and also the PRM file. If using a vector table, the entry within the PRM file should be commented out.
If the linker were to examine the contents of the S19 file - I am not sure whether it does - it may also detect the two different reset vector values.
The reset vector should point to the bootloader code whenever the bootloader is present. This is not the same _Startup location as when the application is compiled. Actually, the "start08.c" code will be generated twice, once for the boot loader compile, and again for the application compile. When using the bootloader, its_Startup() function would commence via the reset vector. Once this function is completed there will be a direct jump to the bootloader main().
The bootloader needs to know the application's _Startup address (the contents of the application's reset vector), so that a direct jump may occur, when required. This would mean that the application link would need to be aware of the presence of the bootloader S19 file, to correctly relocate its reset vector value. Maybe this is possible with the modified _Startup vector entry within the PRM file, where the address is explicitly defined.
Regards,
Mac