Using QSPI by Future Designs, Inc
Using QSPI by Future Designs, Inc
Using QSPI by Future Designs, Inc
Overview
The BSP and Synergy have been designed to simplify the addition of QSPI to your projects. There are
some important things to keep in mind.
1. Taking the QSPI device out of XIP mode is as simple as calling the Synergy QSPI module’s open
API.
2. If using GUIX out of QSPI, GUIX will crash when this is done.
3. Further work needs to be done to determine a process for shutting down and bringing back
GUIX during run time.
a. An alternative would be to perform a software reset using the built in function
NVIC_SystemReset() in order to perform QSPI programming.
4. When considering boot loading and application updates, this needs to be kept in mind.
Page 1 of 9
Using QSPI by Future Designs, Inc.
(Contact FDI for Design, Development and Production)
Reading QSPI
Understanding the Memory Organization
1. To view the Memory Organization, <Open> the S7G2.ld linker file contained in the script
directory as shown below. (Before you troubleshoot, read the next step… 😉)
2. By default, it comes up blank so make sure to then click on the “Memory” tab at the bottom of
the editor area.
Page 2 of 9
Using QSPI by Future Designs, Inc.
(Contact FDI for Design, Development and Production)
3. Take a minute to see where the QSPI Flash starts and ends.
4. “Open With” a text editor the linker script file as shown below (in this case S7G2.ld located in
the script subdirectory).
Page 3 of 9
Using QSPI by Future Designs, Inc.
(Contact FDI for Design, Development and Production)
5. Figure out where your GUIX resources will be located. (If you have not built the project yet, look
where your GUIX source code is located compared to the root. In the below image we see the
GUIX source code is located at “<root>/src/guix_gen/*resources.o”. When you build, the
resources.o file will be located under the build directory at a similar position:
“<root>/src/guix_gen/*resources.o”.)
NOTE: Here are the locations we have seen in various Renesas demos:
<root>/src/guix_gen/*resources.o
<root>/src/gui/*resources.o
6. Add a “.qspi_guix” section into the linker file before the .text section. This will place the GUIX
resources into beginning of the QSPI Flash. (Copy and paste the below text but make sure to
edit the location of the generated code to match your location from the above step.)
.qspi_guix :
{
. = ALIGN(4);
*src/guix_gen/*resources.o (.rodata .rodata*)
. = ALIGN(4);
} > QSPI_FLASH
Page 4 of 9
Using QSPI by Future Designs, Inc.
(Contact FDI for Design, Development and Production)
7. Always perform a clean build after making changes to a linker script file:
Page 5 of 9
Using QSPI by Future Designs, Inc.
(Contact FDI for Design, Development and Production)
Placing Individual Symbols into QSPI
1. To put read-only, global variables or global functions into QSPI, define them using the
BSP_PLACE_IN_SECTION_V2() macro like shown below:
Page 6 of 9
Using QSPI by Future Designs, Inc.
(Contact FDI for Design, Development and Production)
Writing QSPI
Adding the Synergy QSPI module to the project
1. Select the HAL/Common thread (any thread really, you will just need to change which #includes
you use later)
2. Add the QSPI Driver on QSPI module
Page 7 of 9
Using QSPI by Future Designs, Inc.
(Contact FDI for Design, Development and Production)
Verifying/Configuring QSPI Pins
1. On the pins tab, select Peripherals >> Storage:QSPI >> QSPI0.
Page 8 of 9
Using QSPI by Future Designs, Inc.
(Contact FDI for Design, Development and Production)
Using the API
Embedded below is example code for writing data to the QSPI, reading it back, and comparing it using
the Synergy API.
qspi_test.c
For further information on using the module and API, see the module guide example.
Page 9 of 9