cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 bootloader not responding

ARama.9
Associate II

I am using STM32L151C6U6A device, both UART ports are used as RS485 ports. I am trying to boot from system memory and talk to bootloader using a USB-RS485 converter from my PC. Access to Boot0 pin is not possible in my hardware. So I am jumping from my application to bootloader by just forcing it to boot from system memory address by calling the below function as my first line of code in main().

void vSystemInit(void)

{

  /* Check if we should go into bootloader mode.

   *

   * Set the main stack pointer __set_MSP() to its default value.

   *

   * Note that 0x1FFFC400 is "System Memory" start address for STM32F042

   */

if (u32UbootKey == 0xDEADBEEF)

{

u32UbootKey = 0xCAFEFEED;

__set_MSP(0x20004000); // set main stack pointer to start of stack

//

  // 0x1FF00000 is "System Memory" start address for STM32L151

void (*SysMemBootJump)(void) = (void (*)(void)) (*((uint32_t *) 0x1FF00004)); // Point the PC to the System Memory reset vector (+4)

SysMemBootJump();

}

  // Normal init and jump to application

}

After this my main application is not running, so I assume it entered in to bootloader. But when I communicate over UART1 or UART2 I am not getting any response. I am expecting ACK when I send 0x7F after it enters into bootloader.

My question is whether jumping to 0x1FF00004 is the correct address or not. Also I am not sure if the RS485 transceiver is causing the trouble. Has anyone communicating with the bootloader while using RS485 communication? I would appreciate if anyone gives any references closer to my problem / my environment.

Thanks

Arumugam R

7 REPLIES 7
Chris1
Senior III

Does your RS485 transceiver / circuit have automatic direction control?

Thanks for your response.

No.. both RE and DE pins are connected together and driven by a GPIO. I don't have means to control direction when in bootloader. So I tried with a Nucleolus Board with STM32L552 thru' UART3, which has RS232 transceiver. Same behavior. No response from bootloader. Even I tried with CubeProgrammer over UART, it times out saying there is no response from the STM32 device.

I am confused since it couldn't get response over RS232 which doesn't have the direction control issue.

Thanks

MM..1
Chief II

Parity and all as in AN2606 ?0693W00000Y9MniQAF.png

yes. I used 9600 baud rate, 8 data bits, 1 stop, even parity and no flow control. Thanks

Are you using pins PC11 and PC10 (for USART3 on the Nucleo board) as stated in AN2606?

It sounds like it will be necessary for you to develop your own bootloader in order to have control of the RS-485 bus direction on your board.

I use PB11 and PB10 for USART3. Not sure which is USART3 by default . I will see if I can wire PC11 and 10 out and talk to bootloader thru' those pins. I am also trying to find RS485 chip with auto direction control and see if that helps. Thanks

MM..1
Chief II

L151 ? USART3 isnt in AN2606