stm32n657x0h-q failing to generate JPEG interrupts
- July 22, 2026
- 0 replies
- 11 views
i have a problem regarding the usage of the jpeg codec on a stm32n657x0h-q to decode images. the project also involves the transfer of such images over eth0 but for the sake of isolation of the problem i have bypassed mongoose. the problem seems to relate only to jpeg interrupts since the hpdma channel0, used to feed the periperal, is working.
To develop this project i followed this example for the discovery kit.
doing some debugging, i noticed that confr0 is being manipulated (i used a watchpoint), both jpeg_cr and jpeg_sr are being set, but confr1 has a strange behaviour: during Init_process, its registers are properly set, then, when manually halting execution in the cycle in main, the confr1 is set to all zeros.
During initialization, registers are as follows:
Confr1 has DE and HDR set to 0x1, the others to 0x0;
cr has JCEN, EOCIE and HPDIE set to 0x1, the others to 0x0
sr has IFTF, IFNFF and COF set to 0x1, the Others to 0x0
COF in jpg_cr remains 0x1, as does the JCEN, thus the pheriperal is definetly active. But, if i understood the reference manual correctly, since confr1 is all zeros, jpeg interrupts will never start: , since the DE bit is zero is waiting for encoding but it won't find anything to encode, it finds something already encoded.
By setting a watchpoint on 0x58023004, which is exactly the address of confr1, i can see the setting to 1 of DE and HDR registers, but not their reset.
By stepping instructions, it seems like the reset happens at 3819 of stm32n6xx_hal_jpeg.c, but the instruction is JPEG_ENABLE_DMA(hjpeg, JPEG_DMA_IDMA | JPEG_DMA_ODMA); which shouldn't touch confr1.
i'll attach my project.
by the way, i had to manually add stm32n6xx_hal_jpeg.c to /core/src: it wasn't automatically inserted in the drivers folder, adding it here didn't solve the referencing problems because even after rebuilding the index the project didn't see it.
in the archive, there are also the mongoose files, normally i keep them outside of the project, because they are shared with other things. you may have to play a bit with the Path and Symbols under c/c++ General properties.
thanks in advance to anybody willing to help me.
Gioele.
