Psoc 6(CYBLE-416045-02) Auxiliary flash

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

cross mob
Amar_Hiremath
Level 3
Level 3
25 sign-ins 10 questions asked 25 replies posted

how to use Auxiliary flash. mean how to read or write api's..?

is there a limitation on write cycle..?

is this can be used for event log ..? 

is can we have file system like fat16,fat32, etc ..?

can i get the sample code example.

0 Likes
1 Solution

Hi @Amar_Hiremath ,

Yes for PSoC Creator, you can use the PSoC_EmEEPROM_PSoC6 code example as shown:

AlenAn14_0-1648703066628.png

Warm Regards
Alen

View solution in original post

0 Likes
17 Replies
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @Amar_Hiremath ,

By auxillary flash on the CYBLE-416045-02, do you mean to use a part of the flash to store your user data in a non-volatile state.
There is a dedicated 32KB of flash that can be used an an emulated EEPROM and the code example for this can be found in project creator as below:

AlenAn14_0-1648031660487.png

In this code example, you can alternatively use the user flash instead of the dedicated emulated EEPROM area if you require a storage size greater than 32KB.

The write cycle limitation is 100K cycles for the same.

AlenAn14_1-1648032156655.png

If you require file system like fat16, you can refer this code example and then use the emFile library in your firmware to develop the same. Currently we do not have a code example were the emFile library is used with the user flash or emulated EEPROM.

Hope this helps.

Warm Regards
Alen

0 Likes
Hi Alen,
 
we wanted to write the events which happen at 1 sec frequency which memory you suggest to use.
 
and can you assist me with read/write api's and example to read/write defined byte.
0 Likes

Hi @Amar_Hiremath ,

Can you please let me know the amount of data (in bytes) that you wish to write every second?

Warm Regards
Alen

0 Likes

Hi @AlenAn14 20bytes I want to write.

0 Likes

Hi @Amar_Hiremath ,

If you are planning to log the 20 Bytes of data every 1 second into the Emulated EEPROM, then you will finish up your 32Kb or emulated EEPROM in 30 minutes (Provided you use wear levelling option when writing the 20 bytes of data).

If you want to log data like this for more than 30 minutes, then I would suggest you to go for a different storage mechanism like an external flash or SD Card. But the SD Host Controller interface for SD Card is not available on PSoC 63 devices like the  CYBLE-416045-02.
So your only option here would be to go for an external flash.

Can you please let me know how long the data should be retained in the auxillary flash for your application before the flash is erased again to log the new set of data?

Warm Regards
Alen

0 Likes

@AlenAn14 we will use the circular style of writing the data, before it writes to 1st 20bytes we will take the action for that data.

you suggest me how can I read/write only 20bytes.?  api's or a piece of code which demo this.

 

0 Likes

Hi @Amar_Hiremath ,

There is a dedicated 32KB of flash that can be used an an emulated EEPROM and the code example for this can be found in project creator as below:

AlenAn14_0-1648700879580.png

The GitHub repo for this code example : https://github.com/Infineon/mtb-example-psoc6-emulated-eeprom

You can refer to this example and use the Cy_Em_EEPROM_Write() and Cy_Em_EEPROM_Read() API's to write and read your data to the devices emulated EEPROM.
In this example there is a macro called EEPROM_SIZE which is set to 256 Bytes, You can increase this value upto 32KB as required.
You can also specify the flash region to use from the FLASH_REGION_TO_USE macro.

Hope this helps.

Warm Regards
Alen

0 Likes

@AlenAn14 is there a example for Psoc creator 4.3..?

0 Likes

Hi @Amar_Hiremath ,

Yes for PSoC Creator, you can use the PSoC_EmEEPROM_PSoC6 code example as shown:

AlenAn14_0-1648703066628.png

Warm Regards
Alen

0 Likes

is this Auxiliary flash will erase while programming..? if so how to avoid it ..?

0 Likes

Hi @Amar_Hiremath ,

The Em_EEPROM is actually in FLASH and hence when you program a PSoC device you first command it to ERASE ALL FLASH and then program the same.

This will clear any value you may have saved in Em_EEPROM.

https://community.infineon.com/t5/PSoC-6/PSoC6-amp-PDL-em-EEPROM-does-not-retain-data-on-reset/m-p/3...

Warm Regards
Alen

0 Likes

is this same applies when i do ota firmware upgrade.?

0 Likes

No, in the case of OTA upgrade, the erase operation is performed by the bootloader which can decide the section/area to be erased while in the previous scenario, the programmer is the one that performs the erase operation which always does a complete erase of the flash before programming the device. So in the case of OTA firmware upgrade , the user can decide to erase the emulated EEPROM area or leave a certain section of flash used for non volatile memory from erasure.

Warm Regards
Alen

0 Likes

how can we decide this while doing ota update please guide me on this.

Please do guide me on having single .hex that includes both app and boot loader.

0 Likes

Hi @Amar_Hiremath ,

Since this is a query related to DFU, please create a new post for the same so that an engineer with more expertise on this can help you better.

Warm Regards
Alen

0 Likes

@AlenAn14 for this how can we decide this while doing ota update please guide me on this ..?

0 Likes

Hi @Amar_Hiremath ,

As this is a new issue, please create a new thread regarding this issue. This will ensure that your new query is tracked and is not missed by other community users too.

Warm Regards
Alen

0 Likes