Is it necessary to erase flash on CYBT-353027-02 during firmware upgrade?

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

cross mob
kf
Level 3
Level 3
First like received 25 sign-ins 10 replies posted

In our existing project we use CYBT-353027-02 module and WICED Studio 6.4. The CYBT module is running in embedded mode. The module is connected to a host CPU via UART. CYBT firmware update is done via UART, using correspondent minidriver.

Question: after loading minidriver to RAM we execute HCI_FLASH_ERASE command (0x01, 0xCE, 0xFF, 0x04, 0x00, 0x00, 0x00, 0xFF). Is it really necessary? Our goal is to keep application data in CYBT untouched after firmware upgrade, i.e. to keep link keys, BT MAC address and so on. Is it possible?

0 Likes
1 Solution
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hello @kf 

My understanding is that for you for your second time programming / upgrading firmware , you want to skip chip erase to save volatile data. In that case, yes you can skip chip erase. 

Please go through the details of full download & upgrade download scenarios details from here: https://infineon.github.io/btsdk-docs/BT-SDK/AIROC-HCI-Firmware-Download.pdf

Regards,
Anjana

View solution in original post

0 Likes
3 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hello @kf 

My understanding is that for you for your second time programming / upgrading firmware , you want to skip chip erase to save volatile data. In that case, yes you can skip chip erase. 

Please go through the details of full download & upgrade download scenarios details from here: https://infineon.github.io/btsdk-docs/BT-SDK/AIROC-HCI-Firmware-Download.pdf

Regards,
Anjana

0 Likes
kf
Level 3
Level 3
First like received 25 sign-ins 10 replies posted

Hello Anjana,

Thank you for providing updated document.
Actually, in our current update procedure we are not able to distinguish between "Full Download" and "Upgrade Download". However, during very first programming at factory we add one more step where device-specific MAC address gets stored in flash.
Therefore, my question is: is it safe to skip erasing the complete flash even in "Full Download" scenario?
And one more question: do I understand it right that 'CHIP_ERASE  0xFF000000' will erase the whole external flash of CYBT-353027-02, while 'CHIP_ERASE  0xFCBEEEEF' will only erase DS1 and DS2 sections (I'm referring to Table 1 in 002-19289 Rev. *H document)?

Best regards,
Konstantin

DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Update:

As said in the document, "If it is desirable to preserve some data in flash and only erase sectors that will be written, CHIP_ERASE may be skipped". You can use SECTOR_ERASE command for erasing specific sectors alone.

A special value of EF EE BE FC (0xFCBEEEEF) is used to signal “use the lowest valid non-volatile memory range”.
Meaning, that whichever is the lowest non-volatile memory, in this case between on-chip and off-chip flash, the command will select it and erase. And 0x500000 would be the start of on-chip flash when supported and 0xFF000000 would be the start of off-chip flash. 

FYI. 

https://github.com/Infineon/btsdk-docs/blob/master/docs/BT-SDK/AIROC-HCI-Control-Protocol.pdf

https://github.com/Infineon/btsdk-docs/blob/master/docs/BT-SDK/AIROC-HCI-Firmware-Download.pdf 

0 Likes