Problem with flash - CyWriteRowFull()

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

cross mob
GiMu_4312446
Level 1
Level 1

Hi all,

I am working on a project with PSoC 4.1 on CY8C5888AXQ-LP096

I need to store some data in the flash.

here is a code snippet:

----------------------------------------------------------------------------

unsigned char VMImetadata_t[256] = \

{0x24,0x24,0x12,0x12,0x12,0x12,0x12,0x12,\

0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,\

                          (...)                    

0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,\

0x24,0x12,0x12,0x12,0x12,0x12,0x12,0x24};

result_vmi = CyWriteRowFull(0x03, 0x50, VMImetadata_t, 0x100);

--------------------------------------------------------------------------------------------------------

In my case CyWriteRowFull returns result_vmi = 9 and no data is stored in the flash.

What's the meaning of that?

The whole flash is unprotected.

Any suggestions to help me out are welcome and very appreciated.

Thanks

B.R.

GiorgioM.

0 Likes
1 Solution

User needs to acquire the die temperature at least once before Flash write. It is acquired by calling CySetTemp function. You can find more details on the flash programming algorithm from the System Reference Guide available in PSoC Creator, Help > System Reference Guides.

Flash_Operation__v1.PNG

Please refer to the Flash Example code example available as part of PSoC Creator.

            CySetTemp();

            returnValue = CyWriteRowData(ARRAY_ID, ARRAY_ID_ROW_ADDR, rowPattern);

            /* Check if operration is successful */

            if (returnValue != CYRET_SUCCESS)

            {

                LED_Error_Write(LIGHT_ON);

                CyHalt(0x00u);

            }

View solution in original post

0 Likes
3 Replies
GiMu_4312446
Level 1
Level 1

I solved the problem by invoking CySetTemp()

*   Holds the die temperature for the flash writing algorithm. The first byte is

*   the sign of the temperature (0 = negative, 1 = positive). The second byte is

*   the magnitude.

I did not found this in my documentation.

0 Likes

My recommendation is to use an "Emulated EEPROM (Em_EEPROM)" component.

Regards,

Noriaki

0 Likes

User needs to acquire the die temperature at least once before Flash write. It is acquired by calling CySetTemp function. You can find more details on the flash programming algorithm from the System Reference Guide available in PSoC Creator, Help > System Reference Guides.

Flash_Operation__v1.PNG

Please refer to the Flash Example code example available as part of PSoC Creator.

            CySetTemp();

            returnValue = CyWriteRowData(ARRAY_ID, ARRAY_ID_ROW_ADDR, rowPattern);

            /* Check if operration is successful */

            if (returnValue != CYRET_SUCCESS)

            {

                LED_Error_Write(LIGHT_ON);

                CyHalt(0x00u);

            }

0 Likes