Skip to main content
YGagn.1
Visitor II
May 7, 2023
Question

HAL i2c & SPI initialization help needed

  • May 7, 2023
  • 1 reply
  • 1073 views

Hi.

I'm using PlatformIO with stm32duino with a NUCLEO-L476RG. I finally figured out how to configure the clocks in CubeMX and then copy the "void SystemClock_Config(void)" function into my main.cpp code and it seems to work great.

One question I have is, should I also copy other parts of code generated by CubeMX for i2c or spi?

Thanks

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
May 7, 2023

Or you could just code it directly?

There are HAL libraries and examples. Perhaps use those and the Reference Manual to understand the hardware.

The output from CubeMX can be a template. A lot of the output is superficial, look at pin and peripheral initialization hidden in MSP files. You can collect this together

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..