cancel
Showing results for 
Search instead for 
Did you mean: 

STM32C07: Jump to STM Bootloader but can't erase or change anything

Dat Tran
Senior II

Hi, I am working on STM32C071

I wrote code to jump to ST bootloader from my application.

The code seems to work well, after jump to ST bootloader, I can connect to ST Bootloader by USB, using STM32CubeProgrammer. I can read flash data, option byte....

But if I do erase flash or change anything, STM32CubeProgrammer throws a failed message and exit STM bootloader mode.

Below is my jump function:

 

 

void (*SysMemBootJump)(void);
void JumpToBootloader(void){
	SysMemBootJump = (void (*)(void)) (*((uint32_t *) ((0x1FFF0000 + 4))));
        /* Set the clock to the default state */
	HAL_RCC_DeInit();
	/* Disable Systick timer */
	SysTick->CTRL = 0;
	SysTick->LOAD = 0;
	SysTick->VAL = 0;
	volatile uint32_t msp =  *(__IO uint32_t*)(0x1FFF0000);
	__HAL_RCC_USB_CLK_DISABLE();
	/* Disable all interrupts */
	__disable_irq();
	__set_MSP(msp);

	SysMemBootJump();
	
}

 

 

 

Below is failed message:

The error is "verify flash protection" but there is no flash protect. Because I can hold BOOT pin, hit reset pin then enter STM Bootloader again, and erase as well. 

DatTran_0-1738363342615.png

 

0 REPLIES 0