You are here

Project #029: Supervisory Flash on PSoC 4 BLE | Cypress Semiconductor

Project #029: Supervisory Flash on PSoC 4 BLE

The PSoC 4 BLE family of devices of come in two memory variants, with 128 KB or 256 KB Flash. In addition to the Flash memory, these devices also have a small amount of Supervisory Flash (SFlash) which is not overwritten during a typical programming cycle and can be used to store manufacturer-specific data.

The 128 KB PSoC devices have 512 B of SFlash. SFlash is used to store information like flash protection settings, trim settings, etc. There are also four rows of user-configurable SFlash that can be used to store Bluetooth or product-specific information like device addresses, manufacturing/serial numbers, sensor calibration data, etc. These user-configurable rows do not get erased during a programming cycle or during OTA bootloading/firmware-upgrading. Furthermore, SFlash can be written to during the manufacturing cycle, separate from the firmware programming. The user-configurable rows of the SFlash can be accessed by two methods: from the CPU (by writing firmware to do it) or through the Serial Wire Debug (SWD) programming interface. 

To learn how to access SFlash using SWD, refer to the programming specifictions and use the C# utility that comes with PSoC Programmer, normally installed in C:\Program Files (x86)\Cypress\Programmer\Examples\Misc\PSoC4-BLE-SFLASH-Update\

The second method of writing firmware to access SFlash is demonstrated in this PSoC Creator project, downloadable from GitHub here: https://github.com/cypresssemiconductorco/PSoC-4-BLE/tree/master/100_Projects_in_100_Days/Day029_BLE_SFlash_Write

 

Comments

danaaknight's picture

A post of the metadata layout and content would be useful.

Chad.Wagner_1573706's picture

Since this took me a while to figure out I thought I would mention it here.

Using the CYBLE-212019-00 I needed to use the the following:

#define USER_SFLASH_ROW_SIZE            (256u)

define USER_SFLASH_BASE_ADDRESS        (0x0FFFF400u)

I also need to change the following line of code in the WriteUserSFlash.c:

//    cmdDataBuffer[1]=0x0000007F;    // for 128KB flash BLE device    
    cmdDataBuffer[1]=0x000000FF;    // for 256KB flash BLE device
sherapova_2972126's picture

I am extremely glad to find your post as it will get to be on top in my accumulation of most loved online journals to visit. Rutabagas

zacknight_2986731's picture

That gives off an impression of being fabulous anyway i am still not very beyond any doubt that I like it. At any rate will look much more into it and choose by and by! brian holm lawyer san diego

ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.