cancel
Showing results for 
Search instead for 
Did you mean: 

Help for my first simple bootloader STM32WLE5JC

SBaro.11
Associate III

Hi,

I'm trying to create my first very simple bootloader. I'm working with Grove Wio-E5 coming from Seed with STM32WLE5JC mcu available here 

Important note with this mcu I don't have acces to BOOT 1 and BOOT0 very good idea coming from Seed...

So my idea is to create a bootloader very simple at the begining of the user flash starting at

0x08000000 

I have changed  in the file STM32WLE5JCIX_FLASH.ld these lines for 20KB bootloader

/* Memories definition */
MEMORY
{
  RAM    (xrw)    : ORIGIN = 0x20000000,   LENGTH = 64K
RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 32K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 20K /*256K*/ }

And in my bootloader I just light ON a led plug on PA9.

In STM32CubeProgrammer I didi a full erase chip but when I flash my bootloader I have nothing it's look like my stm32 doesn't boot from user flash memory.... If I try to debug with ST-LINK it's working my led is ON....

So my question is, is it possible to boot from user flash memory without access to BOOT0 and BOOT1 pin ?

 

My main.c just before while(1)

  HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_SET);
  HAL_Delay(2000);
  HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_RESET);
  HAL_Delay(2000);
  goto_app();

and goto_app function

  printf("Gonna Jump to Application\n");

  void (*app_reset_handler)(void) = (void*)(*((volatile uint32_t*) (0x08005000  + 4U)));

  //__set_MSP(*(volatile uint32_t*) 0x08005000  );

  HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_RESET );  
  app_reset_handler();    //call the app reset handler

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rim LANDOLSI
ST Employee

Hello @SBaro.11  and welcome to the community,

In order to create a simple Bootloader application , you can refer to this post .

Hope this helps!

Thanks,

Rim

View solution in original post

1 REPLY 1
Rim LANDOLSI
ST Employee

Hello @SBaro.11  and welcome to the community,

In order to create a simple Bootloader application , you can refer to this post .

Hope this helps!

Thanks,

Rim