I am new to firmware and integrated LVGL in stm32u5 dk1 board . And my elf file size is bigger than internal flash hence using external flash for lvgl images . Also running LVGL in external psram . After running I see first screen then it goes immediately to hardfault . Not able to understand this hardfault reason . Need help here . And I checked that PSRAM and External flash is working fine . I have copied entire code at github GitHub - rohit-trustedwear/stm32dk1-code . the fault is happening at line bg_color.full = buf[0] + (buf[1] << 8); in
we are having many screens for smartwatch approx 50 , hence using psram to allocate all the lvgl objects in memory, it won’t fit in internal ram . And all images lies in external flash. plese see liinker script and lvgl config and main.cpp. copying below entire snapshot of memory and stack in lvgl code .
Primary use PSRAM for LVGL reduce effectivity. Secondary PSRAM seems have issue with byte access and align. Avoid LVGL use PSRAM is optimal way, i for example on ESP use PSRAM only for images png stored in flash and expanded into PSRAM cache.
How you test PSRAM ?
I agree to your point that PSRAM will be slow . So I ran the same code now in Internal SRam while images are in external octo spi flash. The UI runs but after some screen change it throws fault .
Seems you place fonts to external flash, maybe this too require byte access and … Too STM caches and MPU setup is critical, but hard to solve your big project
in order to test i just integrated a sample project of squareline studio of smartwatch and everything running on internal ram and internal flash but this is also is not running properly and crashing with fault . I have uploaded the code with sample demo of smartwatch of squareline studio at GitHub - rohit-trustedwear/stm32dk1-code , this is simple example which fits in internal ram and should work but getting same issues . I will add MPU then will update further.