Jump from application code to system memory bootloader on STM32WB15CC
Hello, I'm trying to flash my STM32WB15CC using UART1 without using pin BOOT0(PH3). I'm using a NUCLEO-WB15CC. For that I know that I've to set some bits in OPTR register and jump from application code to memory system bootloader and then connect to UART1.
I've found how to do it using STM32CubeProgrammer by setting the bits SWBOOT0 = 0, BOOT0 = 0 and BOOT1 = 1.
But when I'm trying to jump from application code to the system memory bootloader by setting these bits that doesn't work and I can't find a way to do it. Anybody know how to do that ?
This is my code
FLASH->OPTKEYR = FLASH_KEY1;
FLASH->OPTKEYR = FLASH_KEY2;
//Clear OPTLOCK option lock bit
CLEAR_BIT(FLASH->CR, FLASH_CR_OPTLOCK_Msk);
//Check Flash memory is not busy
while ((FLASH->SR & FLASH_SR_BSY) != 0) {}
//Write the desired options value in the options registers
CLEAR_BIT(FLASH->OPTR, FLASH_OPTR_nSWBOOT0_Msk);
CLEAR_BIT(FLASH->OPTR, FLASH_OPTR_nBOOT0_Msk);
SET_BIT(FLASH->OPTR, FLASH_OPTR_nBOOT1_Msk);
//Set the Options Start bit OPTSTRT
SET_BIT(FLASH->CR, FLASH_CR_OPTSTRT_Msk);
//Check Flash memory is not busy
while ((FLASH->SR & FLASH_SR_BSY) != 0) {}
SET_BIT(FLASH->CR, FLASH_CR_OBL_LAUNCH_Msk);
Thank you in advance for your help
