I have a qn2021 board.Can i modify the bootloader in rom?.Is The bootloader from manufactures? How to tell bootloader program about my app start addr ,if i cannot modify zhe bootloader
Hi,
As far as I know, QN9021 bootloader isn't allowed to modify.
The application start (or entry) address is defined as an attribute in the ELF/Dwarf, but this is indicative only. What counts is what you have in the hardware. At reset it fetches the PC and SP from the vector table, so from an application stand point you can read from that memory. Then it goes through that code (startup code) and jumps to main().
As for the debugger: it follows what the startup code does, but you can script it (with the usual gdb scripts if you like) to modify the registers and do special stuff). How such a scripting looks like: https://mcuoneclipse.com/2015/03/25/command-line-programming-and-debugging-with-gdb/
But this won't have an effect if you run it without the debugger.
In additional, this source maybe helpful: https://community.nxp.com/t5/MCUXpresso-IDE/Debug-Fails-When-Application-is-Offset-in-Flash/m-p/8775...
Best regards,
Gavin
Hi @xiaozhukuaipao ,
Sorry for my late reply.
The bootloader will automatically guide the startup process, and finally execute to the main entry address of the APP. Are you referring to modifying the APP entry? If this is the case, it can be done. For details, please refer to this article: IAR Embedded Workbench中的MCU启动过程 | IAR
Best regards,
Gavin