2015-06-29 02:39 AM
how to seperate a file in linker so that it jumps from one application to another in flash.
do anyone has a sample code?2015-06-29 01:50 PM
Have you attempted to review and build the IAP examples for your unspecified part?
At some point you have to understand the tools you are using. I don't use CooCox, so can't walk you through that.But the general concept of a boot loader, and application, in the Cortex-M3/M4 space is to create TWO stand-alone projects, and have the linker (via the linker script, or some GUI) place the code at 0x08000000, and secondary address offset by the size you need for the boot loader. If your loader needs 48KB, then perhaps 0x0800C000 for the application image. Depends on what chip you're using, which isn't really specified in any of your threads.You will need to change the SystemInit() functionality (system_stm32fxxx.c) in the application image so that it changes the Vector Table (SCB->VTOR) point to the NEW base address. You'll probably also want to consider if you really need to tear down the clocks and PLL, and stand them up again.To transfer control to the application, the boot loader needs to call the ResetHandler entry point. In C you can do this jump using a ''pointer to a function'', in much the same way you'd pass functions to the QSORT routine, and as described in K&R. There's an explicit example of how to achieve this in the IAP examples that you have been repeatedly directed too.[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Boot%20other%20than%20main&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx?Paged%3DTRUE%26p_StickyPost%3D%26p_DiscussionLastUpdated%3D20150626%252014%253a04%253a11%26p_ID%3D53537%26View%3D%257bF47A9ED8%252dE726%252d42BE%252dACED%252d732F13B66581%257d%26FolderCTID%3D0x012001%26PageFirstRow%3D41¤tviews=80]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fcortex_mx_stm32%2fBoot%20other%20than%20main&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https%3A%2F%2Fmy%2Est%2Ecom%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FAllItems%2Easpx%3FPaged%3DTRUE%26p_StickyPost%3D%26p_DiscussionLastUpdated%3D20150626%252014%253a04%253a11%26p_ID%3D53537%26View%3D%257bF47A9ED8%252dE726%252d42BE%252dACED%252d732F13B66581%257d%26FolderCTID%3D0x012001%26PageFirstRow%3D41¤tviews=80[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Vector%20table%201500&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx?Paged%3DTRUE%26p_StickyPost%3D%26p_DiscussionLastUpdated%3D20150626%252014%253a04%253a11%26p_ID%3D53537%26View%3D%257bF47A9ED8%252dE726%252d42BE%252dACED%252d732F13B66581%257d%26FolderCTID%3D0x012001%26PageFirstRow%3D41¤tviews=49]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fcortex_mx_stm32%2fVector%20table%201500&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https%3A%2F%2Fmy%2Est%2Ecom%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FAllItems%2Easpx%3FPaged%3DTRUE%26p_StickyPost%3D%26p_DiscussionLastUpdated%3D20150626%252014%253a04%253a11%26p_ID%3D53537%26View%3D%257bF47A9ED8%252dE726%252d42BE%252dACED%252d732F13B66581%257d%26FolderCTID%3D0x012001%26PageFirstRow%3D41¤tviews=49