STM32 bootloader not responding
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
