I am stuck at booting keil RTX with a boot-loader jumping. When the RTX application is loading but it goes into hard fault from svc2_3 message get keil rtx. I didn't write explicitly define SVC handler, Since it's defined inside RTX. All the remaining things like vector table remapping and systick clock are configured correctly. The jumping is possible when using a non rtx application. Any help appreciated
Hello Hans,
Thanks a lot for this very detailed document.
These document recommends two seperate uVision projects which are bootloader and user application. But I am developing a single project that includes bootloader and user-application together because of some advantages. I placed each source to its ROM region with Scatter File.
If I give same SVC Handler function to both bootloader and application vector tables, software works properly. In this case, bootloader's SVC Handler interrupt will be depend to application. Any update may corrupt error in future. In this case, I decided to write two seperate SVC Handler functions. First one is placed to bootloader region and second one is placed to application region as other interrupt functions. RTX will be linked to only second SVC Handler.
When I debug my software, while running bootloader software, after reset interrupt, program jumps to osKernelStart function then return back to bootloaders SVC Handler function.
If I cannot find a suitable solution for a single uVision project, I will have to write two seperate uVision projects.
Regards,
Yilmaz Eyidogan
Hello Yilmaz,
usually it is better to have two separate projects which are linked independently. Only this way, you can exchange the application without any dependency on the bootloader. With your design, you must keep the code AND the data of both applications separate. Where do you locate the standard library (printf etc.)? Every version of the application will probably only work with one version of the bootloader.
You wrote:
yeyidogan said:When I debug my software, while running bootloader software, after reset interrupt, program jumps to osKernelStart function then return back to bootloaders SVC Handler function.
Unfortunately, I do not fully understand this. After a reset, all interrupts should be disabled and the VTOR register should point to the interrupt vectors of your bootloader. How can an interrupt then jump into the application?
Hans
We can locate all libraries to user application region. Because bootloader have no any library, will work with very basic codes for serial update. There is no any location problem. By the way we have a single project developed with a non-arm microcontroller and works properly.
Secondly, after any reset, program jumps to Reset Handler. Before branching to __main function, it jumps to osKernelStart then return to bootloaders SVC Handler. This interrupt is not disabled. It is working before main function. If it could be disabled, bootloader would not use SVC Handler.
Yilmaz.
Hello,
Problem is solved. Firstly, I changed startup fle. bootloader() function is placed to reset vector of bootloader; and then SystemInit and __main functions are placed to reset vector of user-application. Interrupts must be enabled in SystemInit not in main() function. Because RTX require SVC 0 interrupt before jumping to main() function.
There is another point. RTX adds some initialization codes at __main function. It resets all memory. So interrupt vector table at start of RAM is cleared. I changed start of RAM block to 0x200000C0. so RTX didn't clear vector table at RAM.