[STM32H743] How to flash LVGL assets to external flash (W25Q64) using OpenOCD?
Hello everyone,
I'm a beginner in embedded systems and I'm trying to flash my LVGL UI resources to the external QSPI flash (a W25Q64) on an STM32H743IIT6 using OpenOCD. I'm running into some issues with OpenOCD detecting the flash.
Here is what I have done so far:
Linker Script (.ld): I have defined the external flash memory region in my linker script and created a section named .lvgl_assets that points to this external flash address.
Data Placement: I'm using __attribute__((section(".lvgl_assets"))) in my code to place the UI resource data into this specific section.
Binary File: I have successfully generated a separate .bin file that contains only the data from the .lvgl_assets section.
My goal is to flash this .bin file to the W25Q64.
My OpenOCD Problem:
I am using the stm32h7x.cfg target file provided by OpenOCD. I saw that it contains a QSPI driver, so I added the following line to my config:
set QUADSPI 1
I then run OpenOCD with:
openocd -f interface/cmsis-dap -f target/stm32h7x.cfg
After it connects, I execute flash list in the telnet console, and this is the output:
{
name stm32h7x.bank1.cpu0
driver stm32h7x
base 0x08000000
size 0x100000
bus_width 0
chip_width 0
target stm32h7x.cpu0
}
{
name stm32h7x.qspi
driver stmqspi
base 0x90000000
size 0x0
bus_width 0
chip_width 0
target stm32h7x.cpu0
}As you can see, the QSPI flash (stm32h7x.qspi) is listed, but its size is 0x0.
When I try to get more information by running flash info 1, I get the following error:
No QSPI, no OCTOSPI at 0x52005000 No QSPI, no OCTOSPI at 0x52005000 error retrieving flash info #1 : stmqspi at 0x90000000, size 0x00000000, buswidth 0, chipwidth 0 QSPI flash bank not probed yet
I am confident that my external flash hardware (W25Q64) is wired correctly and is functional.
It seems OpenOCD is failing to probe or initialize the QSPI flash. Am I missing a configuration step? How can I properly configure OpenOCD to recognize the W25Q64 and allow me to flash my .bin file to it?
Thank you for any help you can provide!
