- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
I am using project hello_sensor in CYW20706, SDK3.2ver.
In wiced_hal_sflash.h I find some API about FLASH control.
I upgrade FW in Flash Data Section1 (0x4000), and call API wiced_hal_sflash_erase(0x42000, 0x3e000); to clean Data section2,
It will happen whole Flash data erase, so next time reset chip it will have no FW to use.
Although I didn't call wiced_hal_sflash_set_size() before wiced_hal_sflash_erase,
Is there any example to guide hotw to use these Flash control API?
I want to erase Data Section2 when I using FW in Data Section1, in th other hand when I using FW in Data Section 2 I want to erase Data Section 1 .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @advait_kulkarni ,
I found the issue will happen when I call wiced_hal_sflash_init(void) in initialization.
so I comment out wiced_hal_sflash_init, everything work fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @adam ,
This is generally used in case of FW update. You can refer to the FW update projects available : Firmware_Upgrade_via_HCI , Firmware_Upgrade_via_OTA
wiced_hal_sflash_erase - function is being used by the FW upgrade libraries : C:\Users\.....\latest_btsdk\mtb_shared\wiced_btsdk\dev-kit\libraries\btsdk-ota\release-v3.3.0\COMPONENT_fw_upgrade_lib\20706-A2\fw_upgrade.c
Regards,
Anjana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @AnjanaM_61 ,
I have some test step,
Could you hlep me to check where is incorrect?
In system initialize I call wiced_hal_sflash_set_size(4000000); 4M exnternal Flash.
1. Flash read 5 bytes from address 0x42000
wiced_hal_sflash_read(0x42000, 5, tBuf);
debug print tBuf = 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
2. Flash write 5Bytes to address 0x42000
uint8_t tBuf[5] = {0x11, 0x11, 0x11, 0x11, 0x11};
wiced_hal_sflash_write(0x42000, 5, tBuf);
3. Flash read 5 bytes from address 0x42000
wiced_hal_sflash_read(0x42000, 5, tBuf);
debug print tBuf = 0x11, 0x11, 0x11, 0x11, 0x11
4. Flash erase 1byte in address 0x42000
wiced_hal_sflash_erase(0x42000, 1);
5. Flash read 5 bytes from address 0x42000
wiced_hal_sflash_read(0x42000, 5, tBuf);
debug print tBuf = 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The test steps for writing and reading the data from the flash are all correct. Is there any further issue or is your initial query answered?
Thanks and best regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @advait_kulkarni ,
I found the issue will happen when I call wiced_hal_sflash_init(void) in initialization.
so I comment out wiced_hal_sflash_init, everything work fine.