cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with PLL configuration on F4 MCU with Ethernet using LWIP and with SPI configured.

Gabriel Lessard
Associate

Hi!

We are currently developing firmware on the stm32f429zi Nucleo board. In our development, we configured an Ethernet connection and SPI connection separately. Both works independently. However, once we added the SPI configuration to CubeMX to the ethernet connection, we experienced some issues. With both configurations, the SystemClock configuration failed.

The trouble seems to be with the PLL. While debugging we see that the system tries to read the register configuration of the PLL and the values read do not match what should be configured.

After seeing this issue, we reverted the changes and rolled back to having only the Ethernet configured and the issue persisted. This was tested on two different boards, which both are now "broken" and unable to run previously working code.

The system still works with only SPI configured. The difference we observe between the two configurations is that with only SPI, on the PLL configuration step, the PLL is used as the system clock and not with ethernet configured. We do not know if this change was introduced by the configuration of the ethernet connection alone or the addition of FreeRTOS and LWIP middleware packages.

Currently, my best guess as to what happened is that when the SPI channel and the Ethernet were both configured, the code generated by CubeMx did something that put the PLL in a sort of broken state. I tried manually writing to the registers, following what is done in the PLL configuration as the system clock, but after disabling the PLL to perform the writing sequence, I get a HAL_TIMEOUT error.

I quadrupled check for any difference in CubeMx that could be responsible for this but couldn't find any.

Does anyone else experienced this issue, or something similar and how did you fix it?

1 REPLY 1