STM32f103VET6 Bootloader jump problem.
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32f103VET6 Bootloader jump problem.
I cannot give advice about this, you have to discover where it goes in exception.
Giovanni
Giovanni
-
franek.bmw
- Posts: 57
- Joined: Thu Mar 13, 2014 11:15 am
- Has thanked: 2 times
Re: STM32f103VET6 Bootloader jump problem.
It goes to exception at the and of this function, in Jump_To_Application();
Code: Select all
void jumpToUser(uint32_t address) {
typedef void (*pFunction)(void);
pFunction Jump_To_Application;
/* variable that will be loaded with the start address of the application */
vu32* JumpAddress;
const vu32* ApplicationAddress = (vu32*) address;
if (((*(unsigned long*)address) & 0x2FFE0000 ) == 0x20000000)
{
/* get jump address from application vector table */
JumpAddress = (vu32*) ApplicationAddress[1];
/* load this address into function pointer */
Jump_To_Application = (pFunction) JumpAddress;
/* Clear pending interrupts just to be on the safe side*/
SCB_ICSR = ICSR_PENDSVCLR;
/* Disable all interrupts */
uint8_t i;
for(i=0; i<8; i++)
NVIC->ICER[i] = NVIC->IABR[i];
/* set stack pointer as in application's vector table */
__set_MSP((u32) (ApplicationAddress[0]));
Jump_To_Application();
}
}- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32f103VET6 Bootloader jump problem.
Try to single step instruction by instruction. There must be one that causes the crash.
Giovanni
Giovanni
-
franek.bmw
- Posts: 57
- Joined: Thu Mar 13, 2014 11:15 am
- Has thanked: 2 times
Re: STM32f103VET6 Bootloader jump problem.
I found bug!
In my app I make in RAM fifo which overflow memory. When I reduce size of fifo all is good.
So I have a question. Probably when processor jump from bootloader to app in RAM remain some unnecessarily variables. It is possible to release this area of RAM?
BTW: If my application was written in CHIBIOS, I would have found this problem much earlier. But when I wrote it, I did not know yet CHIBIOS
So I have a question. Probably when processor jump from bootloader to app in RAM remain some unnecessarily variables. It is possible to release this area of RAM?
BTW: If my application was written in CHIBIOS, I would have found this problem much earlier. But when I wrote it, I did not know yet CHIBIOS
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32f103VET6 Bootloader jump problem.
When you jump to the application the bootloader is no more active (I assume), you can use all the RAM.
Giovanni
Giovanni
-
franek.bmw
- Posts: 57
- Joined: Thu Mar 13, 2014 11:15 am
- Has thanked: 2 times
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
-
franek.bmw
- Posts: 57
- Joined: Thu Mar 13, 2014 11:15 am
- Has thanked: 2 times
Re: STM32f103VET6 Bootloader jump problem.
When I have only app, my fifo size could be 500B, when I have bootloader too, my fifo in app could be only 120B. Why?
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32f103VET6 Bootloader jump problem.
You are asking me things specific to your setup, how I am supposed to answer?
I can only recommend to study the map files in order to understand the memory organization of your application, then eventually evaluate changes to the .ld scripts.
Giovanni
I can only recommend to study the map files in order to understand the memory organization of your application, then eventually evaluate changes to the .ld scripts.
Giovanni
-
franek.bmw
- Posts: 57
- Joined: Thu Mar 13, 2014 11:15 am
- Has thanked: 2 times
Re: STM32f103VET6 Bootloader jump problem.
Could you give me some clue, if I send to you my linker script or map files?