Hardfault issue using emWIN middleware in iMX RT1050

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hardfault issue using emWIN middleware in iMX RT1050

1,327 Views
georgefff
Contributor II

Hello everyone,

I'm trying to initialize a simple "Hello world" baremetal program using emWin library from the SDK. 

As required by emWin, I've defined two buffers in external SDRAM memory using the __BSS macro as follow:

__BSS(RAM) static uint32_t gui_buf[1024 * 8]; // -> Used by emWIN for GUI allocation

__BSS(RAM1) uint8_t fb_buf[480 * 272 * 3];     // -> frame buffer allocation for 24bit color operation                                                  

When I call GUI_Init() function, the hardfault exception triggers.I've seen that there's an example designed for IAR, and something that i'm wondering. In this example, buffers for emWIN and the FB are defined as follows:

AT_NONCACHEABLE_SECTION_ALIGN(uint8_t s_gui_memory[GUI_NUMBYTES * LCD_BYTES_PER_PIXEL], FRAME_BUFFER_ALIGN);
AT_NONCACHEABLE_SECTION_ALIGN(uint8_t s_vram_buffer[VRAM_SIZE * GUI_BUFFERS * LCD_BYTES_PER_PIXEL], FRAME_BUFFER_ALIGN); 

Why do these buffers need to be 64 byte aligned? Why do these buffer need a non cacheable section? 

How could configure the MPU regions to allocate these buffers? 

Thanks in advance

Labels (1)
0 Kudos
1 Reply

928 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi George,

For emWin issues, you could directly contact Segger:

https://www.segger.com/products/user-interface/emwin/

Hope this will be useful for you.

Best regards!

/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos