Monday, December 11th 2017, 11:49pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

victortomov

Beginner

Date of registration: Aug 16th 2017

Posts: 12

1

Thursday, September 14th 2017, 10:47am

[SOLVED] Further on Initializing QSPI on STM32F7

Hi there,

I did install the new version of J-Link (6.20) that includes the support for programming the QSPI on STM32F7. I created a new section that was mapped to the QSPI range (addresses above 0x90000000). Then a data array was placed in this section. I.e. :

C/C++ Source code

1
2
__attribute__ ((section (".textqspi")))
uint32_t newMemory[4] = {1, 2, 3, 4};


When I build up the project with SES the part that resides in the QSPI was not programmed. Even, I tried to generate a .hex output file but only the data for the internal flash was stored in it (0x08000000). I don't understand how the SES loader is handling additional memory section when building the output file. Do I need to make additional configuration inside SES?

Thanks,
Victor

This post has been edited 1 times, last edit by "victortomov" (Sep 14th 2017, 10:48am)


SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 437

2

Monday, September 18th 2017, 11:08am

Hello Victor,

Thank you for your inquiry.

To address newly added external memory you need to edit the memory map file.
Per default Embedded Studio is only addressing the internal memories as the external ones are not guaranteed to be there.

So to add memory to your project simply right click your project in Embedded Studio and in the context menu select: Edit Memory Map

After adding all required information in the .xml you need to adjust your section placement file accordingly.
Open it just as the memory file by selecting: Edit Section Placement

After all used section have been placed you should be able to compile your project and link your application in the external QSPI flash.

Best regards,
Nino

victortomov

Beginner

Date of registration: Aug 16th 2017

Posts: 12

3

Monday, September 18th 2017, 4:37pm

Hello Nino,
Thank you for the reply above.

I have already specified the Map file and Section file accordingly:

Memory Map:

Source code

1
<MemorySegment name="QSPI"   start="0x90000000" size="0x01000000" access="ReadOnly" />


Flash Placement:

Source code

1
2
3
<MemorySegment name="QSPI">
    <ProgramSection alignment="4" load="yes" name=".textqspi" start="0x90000000"/>
</MemorySegment>


Still, SES does not generate memory data for QSPI. Is there any further adjustment to those config files that I need to do?

Thanks and regards,
Victor

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 437

4

Monday, September 18th 2017, 4:44pm

Hello Victor,

The entries look correct to me.
If everything is set up correctly you should now see your application placed in QSPI memory when building.

Did you make sure the project uses them? In your project settings you can set it under "Memory Map File" and "Section Placement File".

What target device are you trying to program?
Which flash loader do you use?
Could you attach your .emProject file so i can check if the project settings are set correctly?

Best regards,
Nino

victortomov

Beginner

Date of registration: Aug 16th 2017

Posts: 12

5

Monday, September 18th 2017, 5:14pm

Hello Nino,

Here are the attached project and xml files.

Thanks,
Victor
victortomov has attached the following file:

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 437

6

Wednesday, September 20th 2017, 3:23pm

Hello Victor,

The problem is that the way you are placing your array it is not being referenced anywhere.

C/C++ Source code

1
2
__attribute__ ((section (".textqspi")))
uint32_t newMemory[4] = {1, 2, 3, 4}


You need to reference/use "newMemory" somewhere otherwise the gcc compiler will "optimize" the array away as it is not being used.

Best regards,
Nino

victortomov

Beginner

Date of registration: Aug 16th 2017

Posts: 12

7

Wednesday, September 20th 2017, 4:22pm

Hello Nino,

I have

Source code

1
printf("%x\n", newMemory[2]);
in the code but it prints some old data that was stored on this address.

In the symbol browser the newMemory pointer is mapped to address 0x90000000.

Thanks,
Victor

This post has been edited 1 times, last edit by "victortomov" (Sep 20th 2017, 4:24pm)


SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 437

8

Wednesday, September 20th 2017, 4:26pm

Hello Victor,

does your application initialise the QSPI Controller?
Keep in mind that after the target download the J-Link Flashloader restores the previous QSPI and Clock registers.
So if your application does not initialize the necessary registers you won't be able to execute code from QSPI Flash.

Best regards,
Nino

victortomov

Beginner

Date of registration: Aug 16th 2017

Posts: 12

9

Wednesday, September 20th 2017, 4:37pm

Hello Nino,

Yes, I'm initializing the QSPI. Even after initialization as memory mapped I can see the contend from the Memory Watch tool. The problem here is that I don't see the J-Link to program the QSPI. I suppose I should get something similar to this:

Source code

1
2
Programming 122.5 KB of addresses 08000000 — 0801ea3b
Programming 0.2 KB of addresses 0801ea3c — 0801eb0f
,

but for the 0x90000000 range.

Thanks,
Victor

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 437

10

Wednesday, September 20th 2017, 4:42pm

Hello Victor,

Could you attach your J-Link Logfile after the download process?
A how to is described here: https://wiki.segger.com/J-Link_DLL#Enable_J-Link_Log_File

Best regards,
Nino

victortomov

Beginner

Date of registration: Aug 16th 2017

Posts: 12

11

Wednesday, September 20th 2017, 4:53pm

Here it is...

Thanks,
Victor
victortomov has attached the following file:
  • jlink_log.txt (365.54 kB - 47 times downloaded - Last download: Dec 8th 2017, 10:56am)

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 437

12

Wednesday, September 20th 2017, 5:46pm

Hello Victor,

Thank you for providing the log file.
According to the log file no write to the QSPI Flash has happened.
It seems that the compiler still does not link the array into the QSPI Flash.

You can force the compiler to keep certain symbols.
To force the array go to: Project Options > Linker > Keep Symbols

Double click that entry and add "newMemory" without the quotation marks in a new line.
Does that solve the issue?

Could you provide me with an example project for an eval board with that issue so i can try to reproduce it?

Best regards,
Nino

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 437

13

Wednesday, October 4th 2017, 1:02pm

This support request has been handled further via e-mail..

The solution was that the Load=Yes setting for the section placement is case sensitive and must look as follows:

C/C++ Source code

1
2
3
<MemorySegment name="QSPI">
    <ProgramSection alignment="4" load="Yes" name=".textqspi" start="0x90000000"/>
</MemorySegment>


This thread will be closed now.

-Nino