Flashing QSPI STM32

Sysprogs forums Forums VisualGDB Flashing QSPI STM32

This topic contains 10 replies, has 2 voices, and was last updated by  support 6 days, 3 hours ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #11895

    Taisen
    Participant

    HI VisualGDB,

    I am trying to flash QSPI using VisualGDB, first, this tutorial is some old and not been updated. https://visualgdb.com/tutorials/arm/stm32/flash/

    The tutorial is using this code to fille the OpenOCD scripts:
    -c “flash bank qspi plugin 0x90000000 0 0 0 0 C:/projects/QSPIDriver/Debug/QSPIDriver.elf”
    However, the OpenODC documentation told use to do like this: http://openocd.org/doc/html/Flash-Commands.html#flashdriverlist

    flash bank $_FLASHNAME stmsmi 0xf8000000 0 0 0 $_TARGETNAME

    First, in your code,  where is “qspi” defined?? If I use $_FLASHNAME, the system will say the Error: flash bank name ‘stm32f4x.flash’ already exists

    If I change to qspi, ok, no error but nothing could be started…

    The OpenODC document said Config Command: flash bank name driver base size chip_width bus_width target [driver_options]

    In your tutorial, you are using four 0, but in the documentation, it only using three 0 after the address, which one is right?

    The last, even if change all the code and make no error, but system still say: Failed to connecto to the debugstub, please check the gdbserver output for more detail
    “flash bank qspi plugin stmsmi 0 0 0 C:/projects/QSPIDriver/Debug/QSPIDriver.elf”

    Here are the log of the system:

    VisualGDB is licensed to Taisen Zhuang
    C:\SysGCC\arm-eabi\bin\arm-eabi-gdb.exe –interpreter mi C:\VisualgdbProjects\QSPIDriver\QSPIDriver/Debug/QSPIDriver.elf
    -gdb-version
    =thread-group-added,id=”i1″
    GNU gdb (GDB) 7.12
    Copyright (C) 2016 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type “show copying”
    and “show warranty” for details.
    This GDB was configured as “–host=i686-pc-mingw32 –target=arm-eabi”.
    Type “show configuration” for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/&gt;.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/&gt;.
    For help, type “help”.
    Type “apropos word” to search for commands related to “word”…
    Reading symbols from C:\VisualgdbProjects\QSPIDriver\QSPIDriver/Debug/QSPIDriver.elf…
    done.
    GNU gdb (GDB) 7.12
    Copyright (C) 2016 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type “show copying”
    and “show warranty” for details.
    This GDB was configured as “–host=i686-pc-mingw32 –target=arm-eabi”.
    Type “show configuration” for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/&gt;.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/&gt;.
    For help, type “help”.
    Type “apropos word” to search for commands related to “word”.
    OK
    -list-features
    ^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”]
    -gdb-set disassembly-flavor intel
    No symbol “disassembly” in current context.
    -gdb-set print demangle off
    OK
    -break-insert -f main
    ^done,bkpt={number=”1″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”0x200015aa”,func=”main()”,file=”LEDBlink.cpp”,fullname=”C:\\VisualgdbProjects\\QSPIDriver\\QSPIDriver\\LEDBlink.cpp”,line=”20″,thread-groups=[“i1″],times=”0″,original-location=”main”}
    set remotetimeout 60
    &”set remotetimeout 60\n”
    =cmd-param-changed,param=”remotetimeout”,value=”60″
    OK
    target remote :5282
    &”target remote :5282\n”
    Remote debugging using :5282
    &”Remote connection closed\n”
    Remote connection closed
    qt: Failed to connect to the debug stub
    at v.o(String a, rg b)
    at v.p2(IEnumerable`1 a, Boolean b)
    at v.i1_2(DebugCustomizationSettings a)
    at vj.b2()
    at VisualGDB.GDBDebugEngine.d1(rw b, a a)

    Also, I find some post by other user, https://sysprogs.com/w/forums/topic/how-to-import-a-makefile-project/#post-11894

    What I should do about this??

    • This topic was modified 2 weeks ago by  Taisen.
    #11898

    support
    Keymaster

    Hi,

    The “flash bank name ‘stm32f4x.flash’ already exists” error means that the FLASH name you specify is already used by the default FLASH memory bank. Simply change $_FLASHNAME to any arbitrary name (e.g. qspi). The bank name does not refer to a specific driver, instead it defines a unique name for the newly created bank.

    The “Failed to connect to the debug stub” message means that GDB could not connect to OpenOCD (most likely because OpenOCD exited with an error). Please examine the OpenOCD window (or the GDBServer log in the VisualGDB error detail window) for details.

    #11912

    Taisen
    Participant

    Hi Thanks for the feedback, but I am following your instruction in this page, https://visualgdb.com/tutorials/arm/memories/ and get no success.

    First, where is the “plugin” device name come from? If I use “plugin” system will report error, if I use “stm32f2x” as device driver, I will get no error. But still, nothing write into the QSPI.

    -c “flash bank qspi stm32f2x 0x90000000 0 0 0 0 C:/VisualgdbProjects/QSPIDriver/QSPIDriver/Debug/QSPIDriver-QUADSPI.bin”  -c “init” -c “reset init”

    I tried use the github file to repeat your results, https://visualgdb.com/tutorials/arm/stm32/flash/

    But when I do the “TestFLASHProgramming(0x90000000, 0);” the system will not write anything into QSPI, could you try to follow your guild and repeat it again? I already tried several time with no success…

    #11913

    Taisen
    Participant

    <h3>Here I attached the error when I use “plugin” as driver name</h3>

    Attachments:
    You must be logged in to view attached files.
    #11915

    Taisen
    Participant

    I am following your guild step by step for two samples, only one different is here, the “plugin”, in my case, I always report error, so, I have to use “stm32f2x” as driver name

    • This reply was modified 1 week, 6 days ago by  Taisen.
    Attachments:
    You must be logged in to view attached files.
    #11918

    Taisen
    Participant

    Here is the steps I am following you guild, but still nothing write into the QSPI

    As you could see, I copyed the QSPIRoutines.cpp file

    I added the script as reference told

    add the external memory

     

    Here is finial results, as you could see, the memory still nothing and the address is 0x90000000.

    • This reply was modified 1 week, 6 days ago by  Taisen.
    Attachments:
    You must be logged in to view attached files.
    #11925

    Taisen
    Participant

    I figured out some error in my code, I am using stm32F769I-Disco, but the board support for QSPI by VisualGDB is STM32F7469G, which is 128M not 512M, BUT, still flash nothing on the QSPI.

    #11939

    support
    Keymaster

    Hi,

    Looks like there is a confusion about the “stm32f2x” vs “plugin” driver. The “stm32f3x” driver is a built-in OpenOCD driver that is only capable of programming the regular on-chip FLASH memory. Hence if you specify “stm32f2x” in your command, OpenOCD will try to use that driver and fail.

    The “plugin” driver is a special driver only supported by our OpenOCD fork that will load your ELF file (that must include certain symbols) into the device and call functions from it to program the memory. The error message in one of your previous posts actually contained a clipped line “Invalid FLASH plugin”. Please switch back to using “plugin”, get that message to appear and check the rest of that message. It should provide a clue on why the ELF plugin could not be loaded and resolve the errors mentioned there in order to get it working.

    #11967

    Taisen
    Participant

    Hi VisualGDB Team, Yes, after I change that back to plugin, the system return this messages:

    Here is my setup for the flashing command.

    • This reply was modified 1 week, 3 days ago by  Taisen.
    Attachments:
    You must be logged in to view attached files.
    #11972

    Taisen
    Participant

    Hi VisualGDB Team, I am little confused about this two tutorials: https://visualgdb.com/tutorials/arm/stm32/flash/ and https://visualgdb.com/tutorials/arm/memories/

    I am following  https://visualgdb.com/tutorials/arm/stm32/flash/ this driver tutorial, and at this point, at the very end of the tutorial, it back to another External Memory tutorial… Should I add all the drivers into the External Memory project, which means I should copy all the FLASHPluginCommon.cpp file into the External Memory Tutorial to make the

    -c “flash bank qspi plugin 0x90000000 0 0 0 0 $(RemoteSourceDir)/$(ConfigurationName)/$(TargetFileName)” -c “init” -c “reset init” code work???

    In the flash Driver tutorial, I could using Quick Setup OpenOCD to flash run TestFLASHProgramming(0x90000000, 0); (NOT the -c “flash bank qspi plugin 0x90000000 0 0 0 0 $(RemoteSourceDir)/$(ConfigurationName)/$(TargetFileName)” -c “init” -c “reset init”), I could flash the RAM with NO error, but when I using Memory Tool to look into the 0x90000000, there are all zero.


    If I using the STM32 ST-Link Utility to check the memory, yes, I has been changed, why? Why the Memory in the VisualGDB Does NOT work?

    Could you make this two tutorial clear? Do I need to copy all the FlashPluginCommon.cpp to the External Memory Tutorial??

    • This reply was modified 1 week, 3 days ago by  Taisen.
    • This reply was modified 1 week, 3 days ago by  Taisen.
    Attachments:
    You must be logged in to view attached files.
    #12014

    support
    Keymaster

    Hi,

    OK, thanks, the issue was caused by the FLASH initialization code timing out. We have fixed this in an update to our OpenOCD package and also updated the flash_drivers examples to specify the timeout values instead of hardcoding them in OpenOCD.

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.