3 Replies Latest reply on Mar 20, 2017 3:50 PM by Clive One

    How to work with Code in QSPI-Flash via XIP?

    Nor Sch

      I have a QSPI-Flash with XIP, Driver is working fine. Flashing is possible with ST Link Utility. I'm using the System Workbench. I already defined the Memory Section for QSPI in the LD-File of the Project.


      Now I have some Problems / Questions:

      1. Is there a Way to integrate the STDLR-Driver into the System Workbench? For Keil this is possible, so what I have to do for the SW?
      2. If it is not possible, I have to split my Project. The Part which should be located in the XIP must be separated, for instance via a Library Project. But how I can compile it to get two separate Files? One must be for normal Flash and the other one for the XIP ... And then I need a Way to tell the System Workbench, that it should in Debug-mode only flash the Part for the internal Flash, but how?

      If all this is not possible, I see only one other (really ugly) Way. I could write a completely new Project which is compiled for QSPI only and let's say a Part of the RAM. Then I could flash it inside of the QSPI-Flash and call it somehow from normal Firmware. For this I would need to locate the Functions in the QSPI-Flash and jump to there ... I hope, that this is not the Way I have to go


      Any Ideas and Hints?

        • Re: How to work with Code in QSPI-Flash via XIP?
          KIC8462852 EPIC204278916

          Have you tried to generate post link a S19 or HEX file?

          This file contains the whole memory space content and the STLink Utility should be able to flash both areas by internal MCU flash space or external chosen loader. Haven't experimented yet, just a thought on it.

            • Re: How to work with Code in QSPI-Flash via XIP?
              Nor Sch

              Ok, I have now the Hex-File (how to get it: Get Hex-File from System Workbench). But this doesn't help me. I only have some Address-Lines in the Hex-File:


              The first 4 Parts are in the Flash which begins at 0x0800(0000) and the Address 0x1000(0000) stands for RAM2 of my MCU. But the QSPI is located at 0x90000000 which I can't find in the Hex.


              Btw, I can see in the Map-File, that the needed Functions are compiled in. There are only 2 Test-Functions atm:

              .qspi           0x90000000       0x24 load address 0x08000188
                              0x90000000                . = ALIGN (0x4)
                              0x90000000                _qspi_start = .
              .qspi          0x90000000       0x24 C:\Dat\STM32L4_Eval\libText\Debug/libText.a(text.o)
                              0x90000000                RequestText
                              0x90000008                NotifyLanguage
                              0x90000018                RequestLanguage
                              0x90000024                . = ALIGN (0x4)
                              0x90000024                _qspi_end = .



              Writing this Answer was helpful After sending I saw the "load address 0x08000188" above, means that the Program will try to load (initialize) the QSPI-Stuff from Flash after Starting ... The Section was not correctly defined. Now I have the


              in my Hex-File, means there is Data for Address 0x9000(0000). Now I can Flash both Parts into the MCU and it works. But anyway, I can not debug  and that was the real Question above.

              • Re: How to work with Code in QSPI-Flash via XIP?
                Clive One

                I don't think that was the question.

                The question is whether System Wastebasket can use a flash algorithm/applet to handle external memories. Perhaps via OpenOCD