2025-07-16 2:00 AM
The first case concerns the DAC, by setting "Output Buffer" = Disable in CubeMX, it is enabled in code generation instead, i had to add "DAC1->MCR = 0x03" in the initializations.
/**
* @brief DAC1 Initialization Function
* @PAram None
* @retval None
*/
static void MX_DAC1_Init(void)
{
/* USER CODE BEGIN DAC1_Init 0 */
/* USER CODE END DAC1_Init 0 */
LL_DAC_InitTypeDef DAC_InitStruct = {0};
/* Peripheral clock enable */
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_DAC1);
/* USER CODE BEGIN DAC1_Init 1 */
/* USER CODE END DAC1_Init 1 */
/** DAC channel OUT1 config
*/
DAC_InitStruct.TriggerSource = LL_DAC_TRIG_SOFTWARE;
DAC_InitStruct.WaveAutoGeneration = LL_DAC_WAVE_AUTO_GENERATION_NONE;
DAC_InitStruct.OutputConnection = LL_DAC_OUTPUT_CONNECT_INTERNAL;
DAC_InitStruct.OutputMode = LL_DAC_OUTPUT_MODE_NORMAL;
LL_DAC_Init(DAC1, LL_DAC_CHANNEL_1, &DAC_InitStruct);
LL_DAC_DisableTrigger(DAC1, LL_DAC_CHANNEL_1);
/* USER CODE BEGIN DAC1_Init 2 */
/* USER CODE END DAC1_Init 2 */
}
The second case concerns IWDG, which generates the string "__HAL_RCC_IWDG_CLK_ENABLE()" which
obviously causes compilation to fail. I solved it by adding " #ifdef BUG_CLK_IWDG "
/**
* @brief IWDG Initialization Function
* @PAram None
* @retval None
*/
static void MX_IWDG_Init(void)
{
/* USER CODE BEGIN IWDG_Init 0 */
#ifdef BUG_CLK_IWDG
/* USER CODE END IWDG_Init 0 */
/* Peripheral clock enable */
__HAL_RCC_IWDG_CLK_ENABLE();
/* USER CODE BEGIN IWDG_Init 1 */
#endif
/* USER CODE END IWDG_Init 1 */
LL_IWDG_Enable(IWDG);
LL_IWDG_EnableWriteAccess(IWDG);
LL_IWDG_SetPrescaler(IWDG, LL_IWDG_PRESCALER_8);
LL_IWDG_SetReloadCounter(IWDG, 4095);
while (LL_IWDG_IsReady(IWDG) != 1)
{
}
LL_IWDG_ReloadCounter(IWDG);
/* USER CODE BEGIN IWDG_Init 2 */
/* USER CODE END IWDG_Init 2 */
}
2025-07-16 2:26 AM
Hello @cb.7
First let me thank you for posting.
Your request is under investigation, and I will get back to you ASAP.
Thanks.
Mahmoud
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.
2025-07-16 7:41 AM
Hello @cb.7 ,
Thank you for bringing these issues to our attention.
Related to the first problem (DAC Peripheral), an internal ticket is raised to the dedicated team
( Ticket Number : 214226 ).
Related to the second problem (IWDG Peripheral), an internal ticket is raised to the dedicated team
( Ticket Number : 214196 ).
Thanks.
Mahmoud
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.
2025-07-19 9:21 AM - edited 2025-07-19 10:00 AM
Hello Mahmoud,
a third case came up:
static void MX_CRC_Init(void)
{
/* USER CODE BEGIN CRC_Init 0 */
/* USER CODE END CRC_Init 0 */
/* Peripheral clock enable */
LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_CRC);
/* USER CODE BEGIN CRC_Init 1 */
/* USER CODE END CRC_Init 1 */
LL_CRC_SetInputDataReverseMode(CRC, CRC_INPUTDATA_INVERSION_BIT_BYBYTE);
LL_CRC_SetOutputDataReverseMode(CRC, CRC_OUTPUTDATA_INVERSION_BIT);
LL_CRC_SetInitialData(CRC, 0xFFFF);
LL_CRC_SetPolynomialCoef(CRC, 32773);
LL_CRC_SetPolynomialSize(CRC, LL_CRC_POLYLENGTH_16B);
/* USER CODE BEGIN CRC_Init 2 */
/* USER CODE END CRC_Init 2 */
}
workaround added in main.c
/* USER CODE BEGIN CRC_Init 0 */
#define CRC_INPUTDATA_INVERSION_BIT_BYBYTE LL_CRC_INDATA_REVERSE_BIT_BYBYTE
#define CRC_OUTPUTDATA_INVERSION_BIT LL_CRC_OUTDATA_REVERSE_BIT
/* USER CODE END CRC_Init 0 */
Best regards,
Stefano
2025-07-21 7:41 AM
Hello @SPozz.1
Let me thank you for posting and bringing this issue to our attention.
It has been escalated to the relevant team for fixing (Internal ticket number: 214506 Internal ticket number is only for reference, not accessible or usable outside of ST).
Best Regards.
Mahmoud
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.