cancel
Showing results for 
Search instead for 
Did you mean: 

CUBE, CPAL OR Standard Peripheral Library?

jamsoft
Associate II
Posted on April 07, 2014 at 12:55

Hello all,

I need a reliable I2C communication for my project. What drivers are the best to use? CPAL, CUBE or the last version of the Standard Peripheral Library?

Thank you for your suggestions...

#cube #cpal
3 REPLIES 3
dcurran2
Associate II
Posted on April 11, 2014 at 15:22

Ive used the cpal and in the zipped files there is the std peripherial library.

cpal on the Stm32 the ic2 uses dma so takes a little to understand if you want to investigate everything .

My own experience was that I needed to have a slave device with a dual address ( some of the code needs fixing ( e.g. the second interrupt address didn't seem to work at first until I inserted a line or two)

Uses callback function to your code which was easy to use

code seems to be reliable  I am not aware of issues with it yet and we have stuff out in the field running. ( bring tested byt he customer ;))

 

jamsoft
Associate II
Posted on April 15, 2014 at 10:41

Thank you for your answer. Finally I have used the frame created by the STM32Cube. It uses the HAL drivers. Using callbacks for the DMA or IT versions is fine but I've found that in some cases I am not able to use this non-blocking functions versions. For example, I need to set many parameters and to load firmware for DMP. Parameters where I needed to write or read 1 or 2 bytes were set/read back with no problems with the DMA version of I2C write/read but within the firmware loading function (writing about 16 bytes from STM to MPU in each step) the DMA version of I2C write failed each time. When I've switched to the blocking mode with timeout and it works very reliably. I am sure I am missing some settings, probably in DMA part. I need to know more about the non-blocking mode but I can find no further information than in driver comments... Any links to the STM32f4 HAL Api drivers library documetation/description will be much appreciated.

dean
Associate II
Posted on November 21, 2015 at 00:37

Hi!  Were you able to use the STM32CubeMX software generated code straight as is?  I am having difficulty getting anything generated on the Scl and Sda lines at all using this code with both our device and the STM32L152 Nucleo demo board.

I'd be interested in hearing about any issues you ran into while getting the I2C driver to work.

Thanks!