cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_I2C_Mem_ReadDMA stuck reading large amount of data

straubm
Associate III
Posted on August 11, 2017 at 13:20

Hi, new to the forum.

STM32L476: when reading a block larger than 255 bytes from an EEPROM , HAL gets stuck in HAL_I2C_STATE_BUSY_RX, SCL low, SDA high. Reload was setup alright in HAL and in STM32 I2C the TCR flag is set, but nothing happens. I suspect no interrupt was raised or it was not handled properly. Up to 255 bytes (no reload) everything works.

Any similar experiences?

2 REPLIES 2
Posted on August 11, 2017 at 14:49

Double check the EEPROM data sheet, make sure what the maximum transfer length is for memory pages.

Decompose transfer length that matches page lengths and alignments of addresses.

Check timeouts, and uint8_t variables.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 11, 2017 at 15:35

No page limit for

reads

 (that's the case in question), entire memory sequential read is valid.

Pages apply to write operations only (where I do the obvious stuff like breaking it down into page-sized chunks), and that works. No timeouts, HAL status would return HAL_TIMEOUT, but it is HAL_BUSY as I wrote. No issue with variable types.

Nothing of that. But solved anyways: I'm in an RTOS and I was looking for status too early in the debugger.

After eons in the industry ...........