2017-01-09 09:22 AM
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
2017-01-09 10:28 AM
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.
2017-01-10 07:57 AM
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.
2017-01-10 09:00 AM
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.