2019-08-05 03:54 AM
Hello
I'm working with a custom board based on a STM32F767IIT MCU with the framework touchGFX. The external flash is MT25QL512ABB8ESF.
Is there any solution to load the external flash with st-link utility or another tool?
Do I have to write an external loader for st-link? If so how can this be done?
Regards
Dejan
2019-08-14 12:46 AM
It *IS* supported. You need a recent version of openocd (master) and the patch indicated. Configuration files e. g. for STM32F769I-Disco (single flash) and Nucleo-F767ZI (dual flash mode) are included in the patchset. I'd suggest to start with the disco configuration file (if you use single flash mode) and adjust the GPIO setup according to your board. For the GPIO setup there's also a helper script (contrib/gpio_conf_stm32.pl), but for just one setup it's faster to do it manually, I guess.
The MT25QL512 should be auto-detected and use 4-byte addressing commands automatically. If you comment out the lines
# 4-line qpi mode
mww 0xA0001014 0x00003135 ;# QUADSPI_CCR: FMODE=0x3, DMODE=0x1, DCYC=0x0, ADSIZE=0x3, ADMODE=0x1, IMODE=0x1, INSTR=READ
# 4-line memory-mapped read mode with 4-byte addresses
mww 0xA0001014 0x0F003F13 ;# QUADSPI_CCR: FMODE=0x3, DMODE=0x1, DCYC=0x0, ADSIZE=0x3, ADMODE=0x1, IMODE=0x1, INSTR=READ
one-line mode will be used, that's better to start with.
After starting openocd with -f <config_file> you need to issue 'reset init' to setup the QSPI, then 'flash probe $a' should identify the flash chip. If succesful, you can flash the whole image (internal+external flash) by 'flash write_image'.