You are here

Read/Write Access to Flash Memory | Cypress Semiconductor

Read/Write Access to Flash Memory

Summary: 4 Replies, Latest post by Lane on 30 Aug 2016 07:49 PM PDT
Verified Answers: 0
Last post
Log in to post new comments.
Lane's picture
User
11 posts

I am using the PSoC Creator and wondering if there is a way to read/write to a small section of the FLASH memory. I want to reserve say something like 128 bytes at the end of the flash memory for me to store a serial number and other application configuration information. Is that possible? I want the firmware to be able to read/write the flash.

Lane

EricB01's picture
User
11 posts

That's possible, you can use cyflash.c function. But you should modify the linker script to place your variables at a specific location (AN 89610 can help).

Eric

Lane's picture
User
11 posts

Thanks for the pointer to cyflash.c. In there I see some functions to write to the SysFlashRows and SysFlashUserRows, but I don't see anything about reading these rows. Is the flash memory mapped? The comments say to see the TRM, but I haven't seen anything related to the flash memory in the the PRoC BLE datasheets. I'd really like to see a detailed explanation of the flash memory. For example, does code execute directly from flash or get loaded into RAM?

user_1377889's picture
User
10413 posts

There are no APIs needed to read from flash. Easiest is to use a pointer to your data that gets filled with the (calculated) address. Just as a datafield residing in the program memory area, there is no special code needed to access that data.

 

Bob

Lane's picture
User
11 posts

I found the flash_example code and that is exactly what I need as it shows how to read/write from the flash memory, and I can see from the linker file that the flash memory is memory mapped to 0x0000. Now all I need to know is what is available to write to. Am I correct that the program code is in flash? Is anything else? How can I tell what is free to write to?

Log in to post new comments.