[SOLVED] Further on Initializing QSPI on STM32F7

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [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 Source Code

    1. __attribute__ ((section (".textqspi")))
    2. 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

    The post was edited 1 time, last by victortomov ().

  • 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
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    The following contact form can be used for this: Contact Us

  • 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. <MemorySegment name="QSPI">
    2. <ProgramSection alignment="4" load="yes" name=".textqspi" start="0x90000000"/>
    3. </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
  • 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
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    The following contact form can be used for this: Contact Us

  • Hello Victor,

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

    C Source Code

    1. __attribute__ ((section (".textqspi")))
    2. 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
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    The following contact form can be used for this: Contact Us

  • 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
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    The following contact form can be used for this: Contact Us

  • 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. Programming 122.5 KB of addresses 08000000 — 0801ea3b
    2. Programming 0.2 KB of addresses 0801ea3c — 0801eb0f
    ,

    but for the 0x90000000 range.

    Thanks,
    Victor
  • Hello Victor,

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

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    The following contact form can be used for this: Contact Us

  • 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
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    The following contact form can be used for this: Contact Us

  • 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 Source Code

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


    This thread will be closed now.

    -Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    The following contact form can be used for this: Contact Us