cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for examples & how-to for stm32l051 i2c non blocking (i.e. interrupt) slave and master receive and transmit

ThePUP
Associate III

Hello - I have been working with the l051 for 2+ years now on a product, using i2c-1 as slave to outside world and i2c-2 as master for local board downstream devices.

while my interrupt-driven code "works," I continue to have bugs filed about both master & slave communications stopping.

I am using STM_HAL for the l051, and I think I just need to start over with a clean example of both cases, interrupt driven.

Please point me to where I can find code examples and/or HOW-TO documentation for this.

thanks!

-pete u.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

An easy way to find examples is to search the GitHub repo for the relevant function:

https://github.com/STMicroelectronics/STM32CubeL0/search?q=hal_i2c_master_transmit_it

Here's one example:

https://github.com/STMicroelectronics/STM32CubeL0/tree/58c3ec5bb16e3475309da63f64d62efb2782594d/Projects/NUCLEO-L053R8/Examples/I2C/I2C_TwoBoards_ComIT

Be aware that the I2C HAL code may not be truly interrupt driven in all cases. It varies by chip family.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Guru

An easy way to find examples is to search the GitHub repo for the relevant function:

https://github.com/STMicroelectronics/STM32CubeL0/search?q=hal_i2c_master_transmit_it

Here's one example:

https://github.com/STMicroelectronics/STM32CubeL0/tree/58c3ec5bb16e3475309da63f64d62efb2782594d/Projects/NUCLEO-L053R8/Examples/I2C/I2C_TwoBoards_ComIT

Be aware that the I2C HAL code may not be truly interrupt driven in all cases. It varies by chip family.

If you feel a post has answered your question, please click "Accept as Solution".