cancel
Showing results for 
Search instead for 
Did you mean: 

I2C accessing peripheral with 32 bit address register

HSing
Associate II

I have connected a peripheral to STM32WB via I2C,.The functions HAL_I2C_Mem_Write() and I2C, HAL_I2C_Mem_Read() are designed for upto 16 bit register address. (The function checks if MemAddSize is 8 bit or 16 bit).

Do I have to rewrite the implementation or I can use HAL_I2C_Master_Transmit_IT() for writing [send pointer to 32 bit address + 16 bit/32 bit data] and together HAL_I2C_Master_Transmit_IT() (to write address) and HAL_I2C_Master_Receive_IT() (to get the data) to read data

for reference:

I2C functions available: http://www.disca.upv.es/aperles/arm_cortex_m3/llibre/st/STM32F439xx_User_Manual/group__i2c__exported__functions__group2.html

0693W000000X1mRQAS.png

Thank you

2 REPLIES 2

>>Do I have to rewrite the implementation..

Yes, probably going to have to code your own variant of the routine, or perhaps consider the efficacy of putting a 4/8 GB addressable device onto an I2C bus connection

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
JRAUL.1
ST Employee

Hi,

To perform this communication with a peripheral which have quite same fonctionnality as a memory. Mean which have an I2C physical address and a memory register mapping.

You can use HAL I2C sequential interfaces.

For usage, you can check this example I2C_TwoBoards_RestartComIT or I2C_TwoBoards_RestartAdvComIT present in the STM32WB firmware package in path P-NUCLEO-WB55.Nucleo\Examples\I2C.

Regards.