STM32C071 PA14-BOOT0 not working
Hi
I modified nBOOT_SEL Bit, but still the PA14-BOOT0 Pin level has no effect. The CPU starts always on in Main flash memory. I have these 2 situations (RM0490 Rev 5 page 53)

If PA14 is low level: Main flash starts. This is ok
If PA14 has high level: System memory (Internal Bootloader) should start. This is not working. Always application on flash memory starts.
This is the Flash_OPTR content:

This is the board schematic:

J13 is JTAG: this is working
J12 is access to serial USART loader. RX and TX is connected to PA9/PA10.
J12 serial loader is working in case flash is empty.
This is the routine for modify the Option Byte:
HAL_StatusTypeDef ClearnBootSel()
{
FLASH_OBProgramInitTypeDef OB;
HAL_FLASHEx_OBGetConfig(&OB);
/* OB.USERConfig returns the FLASH_OPTR register */
// Use it to check if OB programming is necessary
if (OB.USERConfig & FLASH_OPTR_nBOOT_SEL)
{
HAL_FLASH_Unlock();
HAL_FLASH_OB_Unlock();
OB.OptionType = OPTIONBYTE_USER;
OB.USERType = OB_USER_NBOOT_SEL;
OB.USERConfig = OB_BOOT0_FROM_PIN;
if ( HAL_FLASHEx_OBProgram(&OB) != HAL_OK )
{
HAL_FLASH_OB_Lock();
HAL_FLASH_Lock();
return HAL_ERROR;
}
HAL_FLASH_OB_Launch();
/* We should not make it past the Launch, so lock
* flash memory and return an error from function
*/
HAL_FLASH_OB_Lock();
HAL_FLASH_Lock();
return HAL_ERROR;
}
return HAL_OK;
}Where is the problem?
Thanks for hints.
Franz
