How to use Extgernal NOR-Flash memory for large arrays?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MuKh_4408861
Level 3
Level 3
10 replies posted 10 sign-ins 5 replies posted

Hi Cypress community,
I've got math library, which consume plenty of RAM space. Multiple malloc and calloc calls for large arrays.
Internal RAM for my PSoC6 chip (256kB) is not nearly enough to fit this library even with reduced data points.


Then this idea came up. I have NOR-Flash memory 8MB on the board. It is good and fast. Size should be enough. I've already configured it in XIP mode and normal mode. Sample project configured and working well with my memory S25FL064L.

Unfortunately, I do not know what/how is best way to make it work for this library big arrays.
BTW library generated from MATLAB. I know its not the good practice to try use rough generated code, but it's fastest option.
Looking for your advise. Code examples are appreciated.

0 Likes
4 Replies
AlbertB_56
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 replies posted

Hello,

Thank you for contacting Cypress Semiconductor.

The FLASH File System may be the solution to your issue.

Registration for the FLASH File System is simple and free of charge for Infineon customers

and has an easy click-thru license agreement.

To register for the FLASH File System:

  • Go to: Software and Drivers for Infineon Flash Memory
  • Click on “Request Cypress FFS”
  • The “FFS” e-mail alias will launch, please provide the information below that is required for registration:
  • Your full name
  • Company name
  • Company Address/Location
  • Your company e-mail address
  • Your contact phone number
  • Ordering Part Number (OPN) to be used with the FFS

Once your information has been received, your registration for the FLASH File System will be initiated on your behalf.

Best regards,

Albert

Cypress Semiconductor Corp.

An Infineon Technologies Company

0 Likes

Hello,

Thank you for contacting Cypress Semiconductor.

The FLASH File System may be the solution to your issue.

Registration for the FLASH File System is simple and free of charge for Infineon customers

and has an easy click-thru license agreement.

To register for the FLASH File System:

  • Go to: Software and Drivers for Infineon Flash Memory
  • Click on “Request Cypress FFS”
  • The “FFS” e-mail alias will launch, please provide the information below that is required for registration:
  • Your full name
  • Company name
  • Company Address/Location
  • Your company e-mail address
  • Your contact phone number
  • Ordering Part Number (OPN) to be used with the FFS

Once your information has been received, your registration for the FLASH File System will be initiated on your behalf.

Best regards,

Albert

Cypress Semiconductor Corp.

An Infineon Technologies Company

0 Likes

Thanks Albert,
I've sent Email with registration info. Does FFS require RTOS running or is can be driven from the code directly?

I understand FFS can be good solution, but still looking for more options.
Is there a way to allocate Heap address to be in NOR-Flash using Linker script? I understand this is simplistic approach, but has anyone tried similar thing?

Other approach would be to convert all dynamic allocation arrays to standard/static ones with max possible size each. These arrays/structures  will be allocated in NOR-Flash. Should I check manually alignments with NOR-Flash block size before writing?

0 Likes

As nobody replies, I will answer to my own questions.

1) Does FFS require RTOS running or is can be driven from the code directly?

Yes, FFS requires RTOS. Then, even if RTOS will be implemented it is not clear how NOR-Flash can be used for quick operations with data arrays using files. This looks like last solution below, but with additional frameworks and complications.

2) Is there a way to allocate Heap address to be in NOR-Flash using Linker script? I understand this is simplistic approach, but has anyone tried similar thing?

I did allocate heap to NOR-Flash. Addressing is correct, however NOR-Flash does not support quick read/write operations (quick enough to reach processor bus speed). Therefore, it cannot be used as any replacement to SRAM. Thou FRAM instead of it possibly could do the job with same trick.

3)Other approach would be to convert all dynamic allocation arrays to standard/static ones with max possible size each. These arrays/structures  will be allocated in NOR-Flash. Should I check manually alignments with NOR-Flash block size before writing?

This seems to be the only viable solution. Need use MMIO mode access functions (EraseMemory, ReadMemory, WriteMemory) with initial buffering in RAM. Buffering will also solve NOR-Flash blocks alignment.

0 Likes