cancel
Showing results for 
Search instead for 
Did you mean: 

software reset for STM32f302vb

Rkuma.1964
Associate II

i have flashed RTOS firmware at location 0x8000000. i have another firmware(led blink) at location 0x8001e00. i am unable to jump from 0x8001e00 to 0x8000000 location. but i am able to jump from 0x8000000 to 0x8001e00(led bllink) and it is working.

please suggest.

11 REPLIES 11
berendi
Principal

NVIC_SystemReset() should do the trick.

Rkuma.1964
Associate II

NVIC_SystemReset() is not working in my case. that is why i am using jump for that.

berendi
Principal

So neither a jump nor a software reset works, what does work then?

  1. Does it start on power-on?
  2. Does it start when the reset pin is grounded?
  3. Can you start it from a debugger?
  4. What does it do when you attempt to start it? Does it end up in the reset handler, or somewhere else? Where?
Rkuma.1964
Associate II

working conditions:

  1. jumping from RTOS firmware to NON-RTOS firmware is working.
  2. jumping from NON-RTOS firmware to NON-RTOS firmware is working.
  3. jumping from NON-RTOS firmware to RTOS firmware is not working.

answer to the Q

  1. Does it start on power-on?
    1. yes
  2. Does it start when the reset pin is grounded?
    1. yes
  3. Can you start it from a debugger?
    1. yes, but with timing issue
  4. What does it do when you attempt to start it? Does it end up in the reset handler, or somewhere else? Where?
    1. power on time, it is starting normally

berendi
Principal

And what happens when you jump to the application at 0x08000000?

  1. Via NVIC_SystemReset()
  2. Via jump instruction

What address should it jump to, where does it jump to instead?

By the way, how do you jump to it?

What are the first 8 bytes at 0x08000000?

Rkuma.1964
Associate II

there is two different firmware available in flash .

  1. PROJ1_FLASHADDR
  2. PROJ2_FLASHADDR

below are the codes which is used for jump:

#define PROJ1_FLASHADDR 0x08000000U

#define PROJ2_FLASHADDR 0x0801E000U

 __disable_irq();

 /* Get the main application start address */

 uint32_t jump_address = *(__IO uint32_t *)(PROJ1_FLASHADDR + 4);

 /* Set the main stack pointer to to the application start address */

 __set_MSP(*(__IO uint32_t *)PROJ1_FLASHADDR);

 /* Create function pointer for the main application*/

 void (*pmain_app)(void) = (void (*)(void))(jump_address);

 /* Now jump to the main application*/

 pmain_app();

Rkuma.1964
Associate II

after jumping at location 0x08000000. firmware getting stuck.

may be program counter is not increasing(just guess)

berendi
Principal

Where does the above code actually jump to?

What are the first 8 bytes at 0x08000000?

You disable interrupts with __disable_irq(), does the other application enable them?

Rkuma.1964
Associate II

below are details of first 8 byte :

after jump when i am trying to enable irq in called firmware then system is not reponding.