cancel
Showing results for 
Search instead for 
Did you mean: 

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

Nor Sch
Associate III
Posted on March 20, 2017 at 13:58

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?

3 REPLIES 3
S.Ma
Principal
Posted on March 20, 2017 at 14:26

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.

Posted on March 20, 2017 at 15:29

Ok, I have now the Hex-File (how to get it:

http://www.openstmorg/forumthread925

). But this doesn't help me. I only have some Address-Lines in the Hex-File:

:020000040800F2
:020000040801F1
:020000040802F0
:020000040803EF
:020000041000EA�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

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)
 .qspi 0x90000000 0x24 C:\Dat\STM32L4_Eval\libText\Debug/libText.a(text.o)
 0x90000000 RequestText
 0x90000008 NotifyLanguage
 0x90000018 RequestLanguage
 *(.qspi*)
 0x90000024 . = ALIGN (0x4)
 0x90000024 _qspi_end = .�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

Edit:

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

:0200000490006A

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.

Posted on March 20, 2017 at 15:50

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..