cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F105 problem jumping to application

u23
Senior
Posted on June 23, 2014 at 15:35

I have problem with jump to application by bootloader.

The device used is the STM32F105R8.

The bootloader does not jump in the application,it crashes in the function ''Jump_To_Application()''.

The code of the bootloader making the jump is:

#define APPLICATIONADDRESS    (uint32_t)0x08008000

/* Test if user code is programmed starting from address ''ApplicationAddress'' */

if (((*(__IO uint32_t*)APPLICATIONADDRESS) & 0x2FFE0000 ) == 0x20000000)

    {                    

        /* Jump to user application */

        JumpAddress = *(__IO uint32_t*) (APPLICATIONADDRESS + 4);

        Jump_To_Application = (pFunction) JumpAddress;

        /* Initialize user application's Stack Pointer */

        __set_MSP(*(__IO uint32_t*) APPLICATIONADDRESS);

        Jump_To_Application();

    }

In the application i have relocate the vector table:

int main(void)

{

    //    __disable_irq();  

    

      /* Set the Vector Table base location at 0x8000 */

      NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x8000);

    //    __enable_irq();  

    /***************** Add your application code here   ***************************/

    ........

}

I attached the image (bootloader + application) downloaded  from flash.
14 REPLIES 14
Posted on June 25, 2014 at 15:07

Awesome, I hope this all works out for you, but the presented facts appear internally inconsistent.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
u23
Senior
Posted on June 26, 2014 at 09:06

Look the ''stsw-stm32121_USB\STM32_USB-FS-Device_Lib_V4.0.0\Projects\Device_Firmware_Upgrade\binary_template'' use same method.

Bootloader ==> 0x08000000 to 0x08003000

Application ==> 0x08003000 to 0x08020000

In the main function set the Vector Table base location at 0x3000:

NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x3000); 

The option target for application is:

0690X00000602vJQAQ.jpg

Posted on June 26, 2014 at 14:03

Look the ''stsw-stm32121_USB\STM32_USB-FS-Device_Lib_V4.0.0\Projects\Device_Firmware_Upgrade\binary_template'' use same method.

 

 

Bootloader ==> 0x08000000 to 0x08003000

 

Application ==> 0x08003000 to 0x08020000

 

 

In the main function set the Vector Table base location at 0x3000:

 

 

NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x3000); 

 

 

Previously: The VECT_TAB_OFFSET must be equal 0x7000 ( 0x8000 - offset) else not function!

So 0x7000 when it's 0x8000 is consistent with this? 64K-0x8000 = 0x9000! And the binary generated with a ResetHandler at ~0x08007000 when the linker is set at 0x08008000

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
u23
Senior
Posted on June 27, 2014 at 09:19

I agree with

you!

This is the only

method

that works!

I asked

clarifications

the

ST

support

,

but

do not respond

!

 

Posted on June 27, 2014 at 09:30

I've got quite a lot of mileage on these types of solutions (boot loader + app, STM32), if it misbehaves in the manner you describe the problem is most likely in the project (options/metadata), the files it actually uses (paths, defines, pre-processor), and the tool chain (linker).

Keil support might be a better avenue. For ST you'd probably want to go via your local distributor and their FAE's, and have them thoroughly replicate and understand your issue.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..