cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an I2C library or resource available using direct register to program the STM32L476RG chip on the NUCLEO-L476RG board? I could program it using STM32CubeMX but I want to show students how to program it using direct register writes using Keil IDE

PMorr.1
Associate II
 
4 REPLIES 4

Have a look at the F0 or L0 Snippets.

ST killed that initiative off early, so it's somewhat rough around the edges, but it's there.

Our just to out your own. A basic polled implementation is not that hard, although if you get to the details, I2C is always tricky.

JW

PMorr.1
Associate II

>>Have a look at the F0 or L0 Snippets.

Where do you suggest I look for this? I have created an I2C library previously for the STM32F4xx series but the STM32L476 I2C registers are significantly different.

https://www.st.com/en/embedded-software/stm32snippets.html

It's not a "library", rather, a collection of register-oriented examples - which in my opinion (which is not very widely shared) is exactly what students need. As I've said ST killed it off early so it had never a chance to mature thus is a bit sketchy.

There are several different versions of the I2C module across STM32 models. AFAIK the one used in 'L4 may be similar to those in 'F0/L0.

JW

Amel NASRI
ST Employee

Hi @PMorr.1​ ,

What about generating code with STM32CubeMX but based on LL drivers and not HAL ones? You still have configurations there, but they are based on registers access.

You can also refer to the example STM32Cube_FW_L4\Projects\NUCLEO-L476RG\Examples_LL\I2C\I2C_TwoBoards_MasterTx_SlaveRx to know more how I2C_LL driver works.

-Aml

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.