I exported my project with the latest STM32CubeMX 4.22.1 for our firmware which is for a board with an STM32F429NGH6 and the resulting code has 2 build errors. Here is the problem code with the error lines in BOLD:
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2S;
PeriphClkInitStruct.PLLI2S.PLLI2SN = 192;
PeriphClkInitStruct.PLLI2S.PLLI2SM = 25;
PeriphClkInitStruct.PLLI2S.PLLI2SR = 3;
PeriphClkInitStruct.I2SClockSelection = I2S_CLOCK_PLL;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
This issue is that for STM32F429NGH6, the PLLIS2M and I2SClockSelection are not present in the structures.
With prior versions of STM32CubeMX these lines simply were not present in the generated code. I will delete them and see if the project builds/runs correctly. I suspect it will.
Here is what I did to cause this problem (but probably less is required):
- Create a project for the STM32F429NGH6 chip.
- In the RCC
- Set HSE to Crystal/Ceramic Resonator
- Set LSE to Crystal/Ceramic Resonator
- In I2S
- Set mode to Half-Duplex Master
- In the Clock Configuration Tab
- Set PLL Source Mux to HSE
- System Clock Mux to PLLCLK
- Set System Clock to 168 MHz
- PLL path: /M: 25, *N: 336, /P:2
- PLL I2S path: *N: 192, /R: /3
- I2S Source Mux: PLLI2SCLK