I am trying to setup external RAM available in the stm32f746g-discovery board.
With reference to this thread: External FLASH and SDRAM Cortex-M
I did this in order to use the external ram for lvgl objects:
# define LV_MEM_ADR 0x90000000
But this cause an HardFault causing the mcu to jump to HardFault_Handler()
Also,
I have tried to put an array on the external flash. I have defined a separate section in the linkerscript:
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
QUADSPI (rx) : ORIGIN = 0x90000000, LENGTH = 16M
SDRAM (xrw) : ORIGIN = 0xC0000000, LENGTH = 8M
}
....
....
.ExtFlashSection (NOLOAD) :
{
KEEP(*(.ExtFlashSection))
} >QUADSPI
....
and in c file, in the global scope:
__attribute__ ((section (".ExtFlashSection"))) char *x = "Hello Bello Cello!!";
but when i tried to use that string array in my label:
lv_obj_t *lb = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(lb, x);
lv_obj_set_style_local_text_font(lb, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_montserrat_48);
lv_obj_align(lb, NULL, LV_ALIGN_CENTER, 0, 0);
It caused a hardfault at line 2, lv_label_set_text.
I have selected custom loader in cubeIDE debug configurations too. Also i have checked LCD_Init(), looks like it initializes the SDRAM too so it should work fine. I have no idea what is causing this and what am i missing