cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

RyYo_1406951
Contributor II

①FlashにALL"1(0xFF)"を書き込む方法を教えてください。

②FlashにALL"0"を書き込む方法は、「Erase All Flash」しかないのでしょうか。

2018/3/17 追記

ALL1/0を書き込みたい領域は「UserFlash(Program)」領域です。

0 Likes
1 Solution
RyanZhao
Moderator
Moderator

Yoshida-san,

For PSoC4 User's Flash, the default/Factory value is 0x00.

1. Write 0xFF:

- To write 0xFF, The API, CySysFlashWrite() can be used in customer firmware code. The FlashWrite example integrated in PSoC Creator can be referred.

- To write 0xFF, another way is by SWD interface, with using CLI command and Kitprog/MiniProg-3.

2. Write 0x00, EraseAll is not the only way.

- Similarly, CySysFlashWrite() can be used in customer firmware code.

- another way is through Kitprog/MiniProg-3 with using SWD interface, by CLI/COM command.

Thanks,

Ryan

View solution in original post

0 Likes
5 Replies
Anonymous
Not applicable

1) Some flash devices default to all (0xFF) when erased, and some default to all (0x00) when erased. Depending on your flash device erase will produce either result 1 or result 2.

2) To get the opposite values, you would need to erase, and then write the value to the flash. (Some flash allows writing to already written data to accumulate instead, and in this case you don't need to erase first.)

See here for flash examples for the PSoC 4:

PSoC-4-BLE/100_Projects_in_100_Days/Day029_BLE_SFlash_Write at master · cypresssemiconductorco/PSoC-...

PSoC-4-BLE/100_Projects_in_100_Days/Project051_NOR_Flash_Bootloader at master · cypresssemiconductor...

0 Likes
RyanZhao
Moderator
Moderator

Yoshida-san,

For PSoC4 User's Flash, the default/Factory value is 0x00.

1. Write 0xFF:

- To write 0xFF, The API, CySysFlashWrite() can be used in customer firmware code. The FlashWrite example integrated in PSoC Creator can be referred.

- To write 0xFF, another way is by SWD interface, with using CLI command and Kitprog/MiniProg-3.

2. Write 0x00, EraseAll is not the only way.

- Similarly, CySysFlashWrite() can be used in customer firmware code.

- another way is through Kitprog/MiniProg-3 with using SWD interface, by CLI/COM command.

Thanks,

Ryan

View solution in original post

0 Likes
RyYo_1406951
Contributor II

Rayn-san

Thank you for your answer.

I will ask in addition.

■English
Is there a way to create a Hex file whose "User's Flash (Program)" area is All "1"?

■Japanese
「User's Flash(Program)」領域がAll「1」のHexファイル作成する方法はありますか?

0 Likes
RyYo_1406951
Contributor II

>■English
>Is there a way to create a Hex file whose "User's Flash (Program)" area is All "1"?

>■Japanese
>「User's Flash(Program)」領域がAll「1」のHexファイル作成する方法はありますか?

⇒上記質問はスレッドを立て直します。

0 Likes
Anonymous
Not applicable

Erasing the chip and setting it to be all ones might work using an external programmer like the MiniProg3, but otherwise you can get most of the chip set to all 1's by decaring a constant number array of all 1's in the program.

0 Likes