2010-08-24 01:51 PM
Hello all
Am I with problems to create bootloader in the microcontroller STR711FR2, somebody can help me??
I have 2 projects created in IAR (v5.41) that now are totally independent:
The first is my application that works perfectly when I download in start address os FLASH (0x40000000), the initialization file (71x_init.s) and vectors (71x_vect.s) I use supplied by ST (MCD Application Team, version 4.0) attached.
The second project is the bootloader, that works perfectly when I download in start address of FLASH (0x40000000), the init/vects are same. The bootloader receives data from serial port (.bin file of the application) and write data in the flash in sectors 2,3,4,5,6 and 7 (the bootloader is in the sector 0 and 1), I created a function for jump from bootloader to application (function below), however when I execute the function the application doesn't work!
When I debug the bootloader, I am sure that the recording of the flash (sectors 2,3...) it is correct and executing step by step the function Exec_App () I see that is jumping for the address of the application (0x40004000) correctly, however in the execution of the first instruction of init.s of the application, the PC is moved for the area of the bootloader...
What should I make to work the bootloader and application? should it use the remap? how?
__noreturn __arm void Exec_App(void)
{
asm ('' mov r0, #0x40000000 '');
asm ('' add r0, r0, #0x4000 '');
asm ('' mov pc, r0 '');
}
Regards,
Marcelo Brenga Isse
2010-09-02 09:15 AM
If the application code is jumping back into the boot loader it sounds like you failed to set the base of the application to 0x40004000 properly when you compiled it. I'm not familiar with IAR, but typically you need to check the compiler setting/options/target, and ensure the linker settings (script or scatter file) put your code/data where it is supposed to be.
2010-09-07 12:18 PM
Thanks clive1,
I informed the compiler the correct area (.icf) and it worked well! After it, was necessary to do work the interruptions, I made based on AN1777 of ST I copied the table of vectors for the ram and remap for her, besides I informed the compiler for not using the low part of the ram! The newer files of application project is in attach Thank you!! ________________ Attachments : 71x_init.s : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1Eb&d=%2Fa%2F0X0000000bmb%2FuMqsPYz65mz46TOha7XGAIqJndXrVz9vKSdh0oXp.RA&asPdf=falseSTR71x_FLASH.icf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1NO&d=%2Fa%2F0X0000000bmX%2Fowr7XzInh5uBhvQpPZa8QoFAFqt5zp_B85C0JFxwxHE&asPdf=false