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

Unrecognized device on STMFlashloader

  • September 23, 2021
  • 5 replies
  • 4058 views

Hello,

I'm working on STM32l051K8 MCU with the custom board design. 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 still on STM32Flash loader the device says it is unrecognizable as shown below.

0693W00000FAHHEQA5.pngHere is the STMflash loader settings.

0693W00000FAHFYQA5.pngStill I'm unsure why the software is not recognizing the STM32 MCU. It would be great help from your end if someone help me in fixing the issue.

Thanks!

This topic has been closed for replies.

5 replies

Tesla DeLorean
Guru
September 23, 2021

>>Still I'm unsure why the software is not recognizing the STM32 MCU.

Old Software

For the L0 you likely need to be using STM32 Cube Programmer in UART mode.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Guru
September 23, 2021

Your code also doesn't look to map the ROM properly, and disables interrupts at the CPU level. Nothing turns that on again. UART might work, doubt USB will.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Kumar Chaya
Associate II
September 23, 2021

0693W00000FAHZIQA5.pngThis is the system memory of the L0. It is 0x1FF00000. Do I need to add any extra offset for this?

Tesla DeLorean
Guru
September 24, 2021
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..