PSoC4_WriteProtection value for flashProtect array

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

cross mob
JiOs_3615486
Level 1
Level 1
First like received

The COM documentation is sparse here:

int PSoC4_WriteProtection(object flashProtect, object chipProtect, outstring strError)

I understand the chipProtect values (thanks to the Perl script), but what are the values for flashProtect?  I am working with CYBLE-222014.  Using PSoC Creator 3.3 shows only 2 values, U & W.  I don't need protected, but the example code simple sets everything to 0xFF, which is not helpful.

I want to set the chip to Protected, array to unprotected.  What should the code involving PSoC4_WriteProtection look like ?

0 Likes
1 Solution
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi JiOs_3615486​,

Setting all bytes of flashProtect as 0xFF will change the protection setting of each row to Full Protection. So, the example is setting Full Protection to each row of flash.

In your case, if you have to set Unprotected flash setting each of the flash rows then please set the all bytes of flashProtect to 0x00.

Every bit defines the write-protection setting for the corresponding user row. So, if the value of flashProtect[0] byte is 0x03 then the first two rows are with Full Protection setting.

Hope this helps,

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B

View solution in original post

0 Likes
3 Replies
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi JiOs_3615486​,

Setting all bytes of flashProtect as 0xFF will change the protection setting of each row to Full Protection. So, the example is setting Full Protection to each row of flash.

In your case, if you have to set Unprotected flash setting each of the flash rows then please set the all bytes of flashProtect to 0x00.

Every bit defines the write-protection setting for the corresponding user row. So, if the value of flashProtect[0] byte is 0x03 then the first two rows are with Full Protection setting.

Hope this helps,

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes

"So, if the value of flashProtect[0] byte is 0x03 then the first two bytes are with Full Protection setting."

Do you really mean the first two rows ?

0 Likes

Hi JiOs_3615486,

Yes, you are correct.

For further details regarding this you can refer to Section 2.3 Organization of the Hex File in CY8C4xxx, CYBLxxxx Programming Specifications.

Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes