Skip to main content
Associate II
July 14, 2026
Question

N6 VENC causes I2C slave issues

  • July 14, 2026
  • 0 replies
  • 5 views

Hi all,

 

Experiencing yet another hurdle using the STM32N6: I am running into the issue where if I run the VENC as the JPEG encoder, where I previously found out how to properly run it in the first place, I get issues in the I2C slave communication…!

 

Okay, what do I mean…

  • i2c is configured as a slave. I receive/send all data via. DMA
  • First stop for both directions of communication is the `HAL_I2C_AddrCallback`
  • Maximum burst length of any i2c communication on my bus is 256 bytes
  • The above mentioned limitation works very good and without issues, if I do not have the VENC running

 

Problems arise, when I turn on the VENC, encoding each 2nd frame on PIPE1 that comes in through the DCMIPP. It is configured to convert one frame of ARGB24 into a JPEG. I used the middlewares from https://github.com/STMicroelectronics/STM32CubeN6/ and snippets from the VENC_JPEG_Encoding example (commit 8ab3b641, which is the latest as of writing).

 

A list of some problems that I encounter, observed in parallel with an oscilloscope:

  • No response; `HAL_I2C_AddrCallback` doesn’t even get called
  • Read request gets aborted
  • Corrupted communication (e.g. 0xFF repeated instead of my data)
  • SDA won’t get released, it gets held low forever

 

As soon as I turn off the VENC all the issues go away.

 

Configuration:

  • Time base: System tick timer is at priority 15
  • All DMA involved in the I2C communication are set to “Very High” priority, with their interrupts at priority 14
  • Both (event+error) i2c interrupts are set to priority 14 as well
  • Additionally I have a timer interrupt at priority 10 that periodically checks whether or not to reinit the i2c peripheral (`HAL_I2C_ErrorCallback` error case or `HAL_I2C_ListenCpltCallback`) - For the moment this is absolutely necessary to ensure quick response times on the bus, because my main is too busy, lol
  • I use mainly the CubeMX and the HAL library

 

Does anyone have a clue why the VENC would disturb the communication? I don’t know if the JPEG peripheral would fix that, but at the same time, I don’t want to use it because it is way slower (tens of milliseconds instead of like 4 that the VENC needs).

If you need more details to help me figure out what is going on, tell me what you need and I will provide them as best as I can.

 

Best regards, rphii