2021-02-03 05:59 AM
Hello,
I am trying to change program start address in STM32F769 controller.
I want to start program from 0x08020000 instead of 0x08000000 for special use case in our application.
I see in c startup __iar_program_start, how do i point this to 0x08020000.
Could some one help me on this.
Thanks
AnanD
2021-02-03 06:08 AM
__iar_program_start initializes the run-time environment before transferring control to main(), typically you wouldn't put "code" at 0x08020000 but rather a Vector Table pointing at the code, interrupts, etc.
To change the address basis, you'd change it in the .ICF or UI, and also in SystemInit() with respect to how it sets the SCB->VTOR to the basis you have chosen.
2021-02-03 09:12 PM
thank you for the information, it is working for me.
2021-02-03 09:17 PM
There is a DFU labs video that kind of shows how to do this. Its for DFU but the concept is similar to what you are trying to achieve.
2021-02-03 11:48 PM
Hello Tesla Delorean
The changes are working in debug mode but in normal operation after reset the code is not running.
Linker changes which i made is given below.
define symbol __ICFEDIT_intvec_start__ = 0x08020000;
define symbol __ICFEDIT_region_ROM_start__ = 0x08020000;
define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF;
and in systeminit SCB->VTOR changed as below.
SCB->VTOR = 0x08020000;
is everything right here or Am i missing something?
Regards
AnanD