SDRAM Malloc and printf / sinit crash
Hello,
I'm using an STM32H743-EVAL2 board, I want to access the LCD screen to draw a PNG image, so I'm using a png library to load the image, and this library use "malloc".
Unfortunately the RAM of the H743 is too small for handling large pictures, so I redirected the malloc heap to SDRAM by modifying the function _sbrk.
This is working fine, however when I try to use printf to output to UART1, the prinf calls _puts_r, which call __sinit, __sfp, __sfmoreglue, _malloc_r, _sbrk_r, and that returns an address in SDRAM, but it seems like this space allocated in SDRAM is not suitable for the function sinit because it crash (OnError_Handler is called)
If the malloc is not redirected to SDRAM, then printf is working fine.
Can someone tell me why ? and how can I make the 2 work from SDRAM ?
Thank you
