Sysprogs forums › Forums › VisualGDB › Using the QuadSPI on STM32F7 Discovery
Tagged: QuadSPI STM32F7
- This topic has 11 replies, 3 voices, and was last updated 7 years, 4 months ago by Taisen.
-
AuthorPosts
-
November 11, 2015 at 12:17 #7189andyjtParticipant
Hi,
Just started using VisualGDB with the STM32F7 discovery board and have found your tutorials extremely helpful !
Can you advise on how I might be able to program the QSPI flash from VisualGDB with a data array for example ?
Is it possible to do this or would I have to do it through ST-Link utility ?
Any advice on addressing data from the QSPI using the HAL library would also be much appreciated.
Thanks.
November 12, 2015 at 04:34 #7198supportKeymasterHi,
Sorry, we don’t support that yet. We would recommend using the ST-Link utility. We will also monitor the popularity of QSPI-related searches and add a tutorial on it if the topic becomes popular.
November 12, 2015 at 10:38 #7203andyjtParticipantThanks for the reply.
Using STLink is an issue at the moment as it doesn’t find the board anymore…could this be related to VisualGDB taking control of the driver ?
I have tried it with VisualStudio closed but STLink still wouldn’t find the board 🙁If you could do a tutorial on reading image data from QSPI flash or the SD card would be very helpful I’m sure!
Regards
November 12, 2015 at 18:02 #7207supportKeymasterHi,
Please use the USBDriverTool to restore the original ST-Link driver. It also looks like the newest OpenOCD works correctly with the stock driver, so you don’t need to install the WinUSB-based one anymore.
November 18, 2015 at 11:57 #7240andyjtParticipantThanks, the USB driver tool worked.
I can now use STLink Utility and OpenOCD.Am I right in thinking that the Quad SPI flash can only be programmed from the STLink ?
I don’t seem to be able to ‘read’ memory at 0x90000000 from STlink utility, only erase and program.November 18, 2015 at 17:38 #7241andyjtParticipantOn this same topic, I’m trying to get the QSPI_perfs Application to compile and struggling to get it to create a Hex or Elf file of the image’s data.
(example here: \STM32\STM32Cube_FW_F7_V1.1.0\Projects\STM32746G-Discovery\Applications\QSPI\QSPI_perfs)
If I compile with IMG_NO_DATA defined then the build fails with error VGDB1002: undefined reference to img6
So, if I undef the flag then this is the code in img6.h and I’m guessing it should compile to a different text area (.textqspi)#ifndef IMG_NO_DATA #if defined ( __ICCARM__ ) #pragma location = ".textqspi" #else __attribute__((section(".textqspi"))) #endif const unsigned char img6[261120] = { 0x1E, 0xC7, 0x1E, 0xC7, etc...
At the moment, this won’t compile either, it ignores the section name and fails because the images overflow the STM’s internal flash…
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-eabi/5.2.0/../../../../arm-eabi/bin/ld.exe: Debug/STM32F7QuadSPI.elf section .text will not fit in region FLASHHow do I setup VisualGDB to compile data hex files that I can download to QuadSPI using STLink and then access those data arrays from my program ?
Thanks in advanceNovember 23, 2015 at 00:50 #7248supportKeymasterHi,
In order to support the .textqspi section, you will need to edit the linker script:
- Go to the Makefile Settings of VisualGDB Project Properties, find the “linker script” field, click “create a local copy”.
- Find the MEMORY section and add the QSPI entry there specifying the address and size of the QSPI memory on your device
- Find the statement that places the .text section into FLASH. Copy it replacing .text with .textqspi and FLASH with QSPI. This will place the img6 variable into the QSPI memory.
Note that this will make your code expect the variable to be placed into the QSPI FLASH, but won’t instruct OpenOCD to program the QSPI memory. You will need to program the QSPI memory separately using the STLink tool (you can extract the contents of the .textqspi section from the ELF file into a separately programmable binary file by running the following command:
arm-elf-objcopy -O binary --only-section=.textqspi project.elf qspi.bin
August 3, 2017 at 18:21 #11897TaisenParticipantWhere should I put this code?? In the makefile settings?? or Directly in the makefile?
August 3, 2017 at 19:27 #11899supportKeymasterHi,
You can add it to the custom post-build commands in VisualGDB Project Properties (requires Custom Edition and higher).
August 5, 2017 at 15:49 #11928TaisenParticipantThanks for the answer, could you provide a sample or manual for this post-build commands? If need a Custom Edition, that means, those commands could not be typed in current distribution, is that right? Like Eclipse, there is special setting just type code and makefile will generate the bin file
- This reply was modified 7 years, 4 months ago by Taisen.
August 6, 2017 at 04:56 #11934supportKeymasterHi,
No problem. According to our records, you already have the Custom edition, so you should be able to use the post-build commands. Please refer to the screenshot below:
Please select VisualGDB Project Properties -> Custom Build Steps -> Actions after building -> Edit -> Add -> Run a custom command line.
Then locate the objcopy binary from your toolchain and enter the arguments with the adjusted input and output file paths. We recommend using variables like $(TargetPath) and $(ProjectDir) to avoid hardcoding the paths. The objcopy command will read the input ELF file (first argument after –only-section), locate the .textqspi section inside it and dump it into a .bin file (second argument after –only-section). Please ensure that the input file path matches the path of the ELF file built by your project so that objcopy can process it correctly.
Attachments:
You must be logged in to view attached files.August 7, 2017 at 16:33 #11966TaisenParticipantGreat, thanks for the answer! This is helpful!!
-
AuthorPosts
- You must be logged in to reply to this topic.