2024-07-10 6:59 AM
Hi,
after upgrading the whole suite to last release (as 09-jul-2024), code generation breaks code in function MX_FLASH_Init (main.c file).
If without condition is generated at line 19, no indentation on following block (which closes at line 53).
/**
* @brief FLASH Initialization Function
* @PAram None
* @retval None
*/
static void MX_FLASH_Init(void)
{
/* USER CODE BEGIN FLASH_Init 0 */
/* USER CODE END FLASH_Init 0 */
FLASH_OBProgramInitTypeDef pOBInit = {0};
/* USER CODE BEGIN FLASH_Init 1 */
/* USER CODE END FLASH_Init 1 */
HAL_FLASHEx_OBGetConfig(&pOBInit);
if ()
{
if (HAL_FLASH_Unlock() != HAL_OK)
{
Error_Handler();
}
/* Option Bytes settings */
if (HAL_FLASH_OB_Unlock() != HAL_OK)
{
Error_Handler();
}
pOBInit.OptionType = OPTIONBYTE_USER|OPTIONBYTE_BOOTADDR;
pOBInit.USERType = OB_USER_BOR_LEV;
pOBInit.USERConfig = OB_BOR_LEVEL_4;
pOBInit.BootAddrConfig = OB_BOOTADDR_NS0;
pOBInit.BootAddr = 0x08000000;
if (HAL_FLASHEx_OBProgram(&pOBInit) != HAL_OK)
{
Error_Handler();
}
if (HAL_FLASH_OB_Lock() != HAL_OK)
{
Error_Handler();
}
if (HAL_FLASH_Lock() != HAL_OK)
{
Error_Handler();
}
/* Launch Option Bytes Loading */
/*HAL_FLASH_OB_Launch(); */
}
/* USER CODE BEGIN FLASH_Init 2 */
/* USER CODE END FLASH_Init 2 */
}
Attached the IOC file.
Best regards,
Diego
Solved! Go to Solution.
2024-09-18 2:16 AM
2024-07-10 7:47 AM - edited 2024-07-10 8:35 AM
Hello @DMoim.1
I've been able Reproduce this behavior and I've reported to the concerned team for correction ASAP (under internal ticket number 186268). Thank you for reporting the issue.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-07-12 7:27 AM
Hello @DMoim.1
To temporarily fix this issue , simply activate only the user Configuration (as mentioned below).
It will have the same result of an empty project.
THX
Ghofrane
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-07-14 11:38 PM
Thanks!
2024-09-18 2:16 AM