cancel
Showing results for 
Search instead for 
Did you mean: 

STM32C071 PA14-BOOT0 not working

franz2
Associate III

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)

franz2_0-1755871527351.png

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:

franz2_1-1755871742216.png

This is the board schematic:

franz2_2-1755871813785.png

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

2 REPLIES 2
TDK
Super User

Your BOOT0 pin is connected to various things. Perhaps one of these is pulling it low.

The chip itself is likely behaving as described. Option bytes seem set appropriately.

If you feel a post has answered your question, please click "Accept as Solution".
franz2
Associate III

I tried also with direct connection of PA14 to GND and to 3.3V. Same issue. And levels are in green range.