cancel
Showing results for 
Search instead for 
Did you mean: 

HAL i2c & SPI initialization help needed

YGagn.1
Associate

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

1 REPLY 1

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 Venmo
Up vote any posts that you find helpful, it shows what's working..