Skip to main content
georga
Visitor II
Dec 27, 2018 9:33 AM UTC
Question

STM32F446 Jpeg HardFault when image is too wide

Hello,

I'm using LibJpeg from CubeMX to decode a jpeg file from SD-card and display it on an ILI9341 display. I found out that decoding will work only, if I decode an vertical rotated picture (240x320). If I want to decode the same picture horizontally (320x240), I'm always getting a hard fault exeption. The exeption happend when malloc is called during jpeg decompress => so I'm running out of RAM (access to illegal RAM address is made).

Is there any way, to limit the memory usage of LibJpeg in order to be able to decode jpegs with 320 pixel width?

I found there is a define called "max_memory_to_use" but it says in the comments of the source code, that this has no effect on this library. I tried to limit this via "max_memory_to_use", but as expected without success.

This topic has been closed for replies.