Skip to main content
Roshan
Associate III
May 10, 2021
Solved

How to use BOOT0 in SBSFU?

  • May 10, 2021
  • 2 replies
  • 1075 views

Hi all,

I am porting the SBSFU to the custom STM board which is running in the Stm32L476JGYx.

Normally user button is connected to the PC13 in the Nucleo board and in my custom PCB I made the user button for the Boot0 (PD7) I use this only for the bootable purpose,

I am having a problem changing the BOOT0 pin, I changed the default pin PC13 to PD7 using the Stm32l4xx_nucleo.h in the BSP folder but I am not getting the bootable update window (to update using the Ymodem protocol) if I do the same as in the Nucleo board. Are there any other facts should I consider when changing the User Button.

Thanks

Roshan

This topic has been closed for replies.
Best answer by Jocelyn RICARD

Hi Roshan,

You actually need to implement the 2 macros: BUTTON_INIT() and BUTTON _PUSHED() located in app_hw.h

The init should contain the GPIO initialization, the pushed should contain the test of button is pushed.

You can either put GPIO initialization in the macro or define your own functions

Typical GPIO init for PC6 would be would be:

 GPIO_InitTypeDef GPIO_InitStruct = {0};

 __HAL_RCC_GPIOC_CLK_ENABLE();

 GPIO_InitStruct.Pin = GPIO_PIN_6;

 GPIO_InitStruct.Mode = GPIO_MODE_INPUT;

 GPIO_InitStruct.Pull = GPIO_NOPULL;

 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

Best regards

Jocelyn

2 replies

Jocelyn RICARD
ST Employee
May 10, 2021

Hello Roshan,

just a precision. on your STM32L476JGY / WLCSP72 BOOT0 is on pin D7. On the other hand PD7 is port D7, not available on this package.

Anyway, BOOT0 pin is used to select boot on system bootloader.

But, as soon as you set this pin to VDD the chip will boot on bootloader ... except if you activated RDP level 2: but please don't do that ! you cannot debug anymore.

So, you cannot use the BOOT0 to indicate SBSFU to launch the update.

Best regards

Jocelyn

Roshan
RoshanAuthor
Associate III
May 11, 2021

Hello @Jocelyn RICARD​ 

Thank you, sir. Can you please let me know the files which I need to change for the user button, in case if I use another pin? (is it only in  Stm32l4xx_nucleo.h )

Regards

Roshan

Jocelyn RICARD
Jocelyn RICARDBest answer
ST Employee
May 11, 2021

Hi Roshan,

You actually need to implement the 2 macros: BUTTON_INIT() and BUTTON _PUSHED() located in app_hw.h

The init should contain the GPIO initialization, the pushed should contain the test of button is pushed.

You can either put GPIO initialization in the macro or define your own functions

Typical GPIO init for PC6 would be would be:

 GPIO_InitTypeDef GPIO_InitStruct = {0};

 __HAL_RCC_GPIOC_CLK_ENABLE();

 GPIO_InitStruct.Pin = GPIO_PIN_6;

 GPIO_InitStruct.Mode = GPIO_MODE_INPUT;

 GPIO_InitStruct.Pull = GPIO_NOPULL;

 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

Best regards

Jocelyn

Roshan
RoshanAuthor
Associate III
May 12, 2021

Thanks