cancel
Showing results for 
Search instead for 
Did you mean: 

Software reset to enter boot mode

jonathan239955_stm1_st
Associate II
Posted on January 09, 2017 at 18:22

Hello,

I am using USART between the STM32L4 and the Raspberry Pi to enter in the bootloader mode.

It is working with the external reset (NRST pin) but I am trying now to enter in this mode with a software reset. I am using the command NVIC_SystemReset() and after the reset I don't get any answers from the STM32 when I send the  start byte 0x7F.

Can we enter in boot mode with software reset and not external reset ?

Thanks for your help,

Jonathan

3 REPLIES 3
Posted on January 09, 2017 at 19:28

Would expect it too if BOOT0 was pulled high, can't say I've tried.

It would be very sensitive to signals on other pins when trying to detect the interface being used.

Could you try calling into the ROM?

You must not drive NRST high with a push-pull driver externally.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 10, 2017 at 15:57

Hi Clive, thank you for your answer.

I tried calling into the ROM but I have the same result : no answers after 0x7F. Here is my code for jumping in bootloader :

 SysMemBootJump = (void (*)(void)) (*((uint32_t *) 0x1fff0004)); // point to the system memory + 4

                    

 HAL_RCC_DeInit();

                                

 SysTick->CTRL = 0;

 SysTick->LOAD = 0;

 SysTick->VAL = 0;         

 __set_PRIMASK(1);               // Disable interrupts

 __set_MSP(0x00000000);      // Main Stack pointer to its default value

                    

 SysMemBootJump();

I am not sure for the Main Stack Pointer.

The pin NRST is in floating mode, it is not connected with the PI and I just have UART connected on the STM32, I2C, CAN and USB are not used.

Posted on January 10, 2017 at 17:00

Setting the MSP to zero is pretty much guaranteed to fault, point it as some usable RAM, or load the value from the vector table.

You'd want to double check the ROM address, and make sure it is mapped into the zero address space. Use your debugger to step through the code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..