cancel
Showing results for 
Search instead for 
Did you mean: 

Partition a QSPI NOR Flash in memory mapped mode

drJonesy
Associate II

Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code or a script. Please read this post: How to insert source code.

Hi

This is something very easy that I am missing or impossible. I am using a nucleo-l476 to drive an RA8875 with a flash memory attached. This is using touch gfx to drive the RA8875 LCD. I am switching in/out of memory mapped mode to rewrite part of the flash memory so I can load different images into the flash memory and touch gfx will load the new images from the nor flash (This all works beautifully).

what I am trying to do is have touch gfx load an image to a different part of the nor flash using partitioning.  see linker below.

 

MEMORY

{

RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K

RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 32K

FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K

QSPI_NOR (xrw) : ORIGIN = 0x90000000, LENGTH = 8M

QSPI_NOR_P (xrw) : ORIGIN = 0x90800000, LENGTH = 8M

}



/* Sections */

SECTIONS

{

ExtFlashSectionP :

{

*(ExtFlashSection ExtFlashSection.*)

*(.gnu.linkonce.r.*)

. = ALIGN(0x100);

} >QSPI_NOR_P



ExtFlashSection :

{

*(ExtFlashSection ExtFlashSection.*)

*(.gnu.linkonce.r.*)

. = ALIGN(0x100);

} >QSPI_NOR



FontFlashSection :

{

*(FontFlashSection FontFlashSection.*)

*(.gnu.linkonce.r.*)

. = ALIGN(0x100);

} >QSPI_NOR

the issue is touch gfx wont show or allow me to write to the separate partition

on the nor flash. is what i am trying to do possible and if so what am i missing.

1 ACCEPTED SOLUTION

Accepted Solutions
Osman SOYKURT
ST Employee

Hello @drJonesy ,

Yes quite easy (but hidden feature). Open your touchgfx file with a text editor and add your new ExtFlashSectionP  section like such:

   "AvailableSections": [
      "ExtFlashSection",
      "IntFlashSection",
	  "ExtFlashSectionP"
    ],

After that, you should be able to select it from the drop down list in your images settings for instance:

OsmanSOYKURT_0-1764945026886.png

Your linker looks good to me. So with only the changes i mentioned above, it should be working.

Osman SOYKURT
ST Software Developer | TouchGFX

View solution in original post

5 REPLIES 5
Osman SOYKURT
ST Employee

Hello @drJonesy ,

Yes quite easy (but hidden feature). Open your touchgfx file with a text editor and add your new ExtFlashSectionP  section like such:

   "AvailableSections": [
      "ExtFlashSection",
      "IntFlashSection",
	  "ExtFlashSectionP"
    ],

After that, you should be able to select it from the drop down list in your images settings for instance:

OsmanSOYKURT_0-1764945026886.png

Your linker looks good to me. So with only the changes i mentioned above, it should be working.

Osman SOYKURT
ST Software Developer | TouchGFX

Thank you very much Osman, Will try this and let you know.

Ghazali
Associate

Yes — it’s possible, but keep it simple: map the NOR as a single memory-mapped region and use logical offsets (partitions) inside it, update your linker sections/TouchGFX resource pointers to those offsets, always exit QSPI memory-mapped mode before erase/programming (use indirect mode), perform erase/write to the partition, then re-enable memory-mapped mode and invalidate CPU caches so the MCU reads the new data; also ensure your QSPI driver supports both modes and your partitions align to NOR sector boundaries.

drJonesy
Associate II

Hi Ghazali

As mentioned in the question, all that works well. The issue is, not being able to get Touch GFX to load images to the separate partition.  Which seems to be very easy to implement.

drJonesy
Associate II

That was very easy. Thanks again Osman SOYKURT for your help.

Brief edit and update.  

System is working well with Touch GFX  loading the replaceable image to the new flash partition (so as to not effect the rest of the images stored) and  loading new images from SD-Card to the flash partition. With this method I could add more partitions and load other images to separate sections.