Skip to main content
Graduate II
September 9, 2024
Solved

how to build right loader for fmc norflash

  • September 9, 2024
  • 3 replies
  • 1850 views

From the beginning, I have been using EWARM to build the external loader. However, when following the provided steps for the QSPI flash type, I couldn't fully adapt to them. So, I imported a GitHub file, changed only the dev_inf.c, and generated the ST-LDR file, but it resulted in partial data showing as 0xFFFFFFFF.

Now, I need to properly generate the loader. Should I continue using EWARM, or should I switch to generating it in CubeIDE? If it's in CubeIDE, where can I find the linker file for it?

How to implement and use your own external flash l... - STMicroelectronics Community

Screenshot (1416).png

Screenshot (1418).png

    This topic has been closed for replies.
    Best answer by mƎALLEm

    @jr_engr_mbed 

    In the previous post you said you succeeded to build a loader for your NOR Flash. 

    Now I'm confused..

    Let's summarize:

    1- You need first to start by a simple project where you initialize the FMC for this NOR flash and do some simple read/write tests to validate the configuration and the timings.

    2- Then you need to inspire from to build your loader How to implement and use your own external flash l... - STMicroelectronics Community.

    3- Validate your loader with CubeProgrammer by reading and writing data.

    4- You can use this loader in CubeIDE.

    To build and generate an external loader is not limited to EWARM IDE. So if you generated well your loader with EWARM it should work on CubeProgrammer and CubeIDE.

     

    3 replies

    Graduate II
    September 9, 2024

    The tools used to built the External Loader shouldn't be particularly material. I'm using GNU/GCC + MAKE and that works fine. A lot of ST's loaders are built with EWARM/IAR

    The memory looks similar from the BSP vs Loader perspective, I don't have a good way to side by side these, or the patience.

    mƎALLEmAnswer
    Technical Moderator
    September 9, 2024

    @jr_engr_mbed 

    In the previous post you said you succeeded to build a loader for your NOR Flash. 

    Now I'm confused..

    Let's summarize:

    1- You need first to start by a simple project where you initialize the FMC for this NOR flash and do some simple read/write tests to validate the configuration and the timings.

    2- Then you need to inspire from to build your loader How to implement and use your own external flash l... - STMicroelectronics Community.

    3- Validate your loader with CubeProgrammer by reading and writing data.

    4- You can use this loader in CubeIDE.

    To build and generate an external loader is not limited to EWARM IDE. So if you generated well your loader with EWARM it should work on CubeProgrammer and CubeIDE.

     

    Graduate II
    September 9, 2024

    Previously, I suspected the loader due to the issue I shared in the last post. However, now I get full data when using the testing code in TouchGFX without assigning image data in the linker. I can see the same data as when I tested the FMC code separately. This only occurred after including the image data in the linker.

     

    Screenshot (1426).png

    Screenshot (1424).png

     

    The memory browser now reflects this change. Does this indicate that the image data is being retrieved correctly?

     

     

    Screenshot (1430).png

    Screenshot (1433).png

    the data goes like 0x63075fc0...so,this is fine for next step? 

     

    Technical Moderator
    September 9, 2024

    If you uploaded data (I think the image) to the NOR Flash using the cube programmer and you read it with a simple program after configuring the FMC and you find the same data as you upladed with CubeProgrammer, that means: the loader is working correctly as well as the reading from with NOR Flash.

    If this is your status, no more to investigate from the loader side ..

    Graduate II
    September 9, 2024

    Make some code it CRC or HASH the NOR content from the MCU, and compare that with the data on the PC, generated by the Linker.

    Perhaps use objcopy or objdump to generate binary files for the different memory regions, and run the integrity check over them.

    Perhaps add linker symbols, via the linker script, so you can determine the size of the image in the external memory, and pass those parameters to the MCU side integrity check.