cancel
Showing results for 
Search instead for 
Did you mean: 

Problem LibJPEG jcdctmgr.c

ANDRES RODRIGUEZ
Associate II
Posted on June 01, 2018 at 03:31

Hello,

several days ago I'm trying to encode a BMP image to jpeg, when I do debbug I see that in the jcdctmgr.c file, in the GLOBAL (void) function jinit_forward_dct (j_compress_ptr cinfo)  function, an error occurs at this point fdct = (my_fdct_ptr)     (* cinfo-> mem-> alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF (my_fdct_controller)); and it sends me to void HardFault_Handler (void) in the file stm32f4xxit.c, I think it's strange because LibJPEG is a set of independent libraries, does anyone have any idea how to solve this problem?

I am working with the STM32F446VE, STM32CubeMX version 4.21 and IAR, with a simple board made by my own, it has a SD card, and the fat files works fine.

THANKS.

ANDR�S FELIPE

#stm32f4 #libjpeg
2 REPLIES 2
Posted on June 01, 2018 at 03:44

Have a Hard Fault Handler that outputs diagnostic information. 

 

Check if the failure is due to the function pointer you provide being bad, or if you have a sufficiently large heap to service the allocation request.

Instrument your allocation routines to see the usage, size of allocation, and success or failure.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ANDRES RODRIGUEZ
Associate II
Posted on June 01, 2018 at 17:20

Hi Clive One,

The heap you mean must be incremented from both  the IDE and the CubeMX, cause I already did it from the CubeMX only, not from IAR.

Thanks for your answer.

ANDRÉS FELIPE