Skip to main content
Kumar Chaya
Associate II
September 24, 2021
Question

STM32 Cube programmer not receiving 0x79 in UART mode

  • September 24, 2021
  • 2 replies
  • 1887 views

Hello,

I'm working on STM32L051 MCU. I just wanted to enter the device to the bootloader for serial flashing via USART peripheral.

Here is the simple C code to enter into the bootloader for STM32L0xx family MCU.

void JumpToBootloader(void) {

  void (*SysMemBootJump)(void);

  volatile uint32_t addr = 0x1FF00000;

#if defined(USE_FULL_LL_DRIVER)

  LL_RCC_DeInit();

#endif /* defined(USE_LL_DRIVER) */

  /**

   * Step: Disable systick timer and reset it to default values

   */

  SysTick->CTRL = 0;

  SysTick->LOAD = 0;

  SysTick->VAL = 0;

  __disable_irq();

#if defined(STM32L051xx)

  SYSCFG->CFGR1 = 0x01;

#endif

  SysMemBootJump = (void (*)(void)) (*((uint32_t *)(addr + 4)));

  __set_MSP(*(uint32_t *)addr);

  SysMemBootJump();

}

and after entering into the bootloader, we can see 0x7f and 0x79 value in RDR and TDR registers of USART as shown below as per the bootloader requirement for USART.

0693W00000FAHGkQAP.png 

But here in the Cube programmer, it says it is receiving 0x86 and 0xFE respectively but not 0x79 which is sent by the MCU.

0693W00000FAPG9QAP.png 

I'm unable to understand why there is a mismatch when MCU and the software when data is transmitted. I would be great if anyone helps me resolving this issue.

Thanks!

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
September 24, 2021

How and to what are you connecting the STM32 UART pins?

The MCU's CMOS levels are NOT compatible with RS232, if you are using an RS232 connection you need level converters.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
TDK
Super User
September 24, 2021

0x86 is the inverse of 0x79. Most likely you have the levels inverted somewhere along the hardware chain.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Kumar Chaya
Associate II
September 25, 2021

How do I resolve this issue? Unfortunately I won't be having control over UART Transmission..