你好,关于FLASH的wiced_hal_sflash_write 和 wiced_hal_sflash_erase 的函数的写,擦是不能对active sections操作的是吧?只能针对upgrade_ds_location 进行擦除操作吧?
已解决! 转到解答。
从这段描述看, 输入的大小不能超过memory size, 所以写入之前要先设定wiced_hal_sflash_set_size,
第二段描述:
active sections (boot sectors) and sections
/// required for the proper function of the Bluetooth subsystem
表明这个api是有保护的。
///////////////////////////////////////////////////////////////////////////////
/// Write data from memory to a certain location on the serial flash module.
///
/// Please ensure that the address and (address + length) of data to be
/// written does not go beyond the size of the memory module. If they do,
/// the write operation will "wrap around" and start corrupting the starting
/// address of the memory (boot sector), rendering the device inoperable.
///
/// Note that this function will not allow corruption of certain memory
/// locations, such as currently active sections (boot sectors) and sections
/// required for the proper function of the Bluetooth subsystem.
///
/// \param addr - The starting destination address on the serial flash.
/// \param len - The number of bytes to write.
/// \param buf - Pointer to source data buffer.
///
/// \return The number of bytes written.
/// Note: Please set serial flash size using wiced_hal_sflash_set_size API before
/// using this API. Otherwise write fails.
///////////////////////////////////////////////////////////////////////////////
uint32_t wiced_hal_sflash_write(uint32_t addr, uint32_t len, uint8_t *buf);
hello:
which evb are you using now for the flash operation?
CYBT343026 ,是否有enable/disable 对 active sections 写保护?
从这段描述看, 输入的大小不能超过memory size, 所以写入之前要先设定wiced_hal_sflash_set_size,
第二段描述:
active sections (boot sectors) and sections
/// required for the proper function of the Bluetooth subsystem
表明这个api是有保护的。
///////////////////////////////////////////////////////////////////////////////
/// Write data from memory to a certain location on the serial flash module.
///
/// Please ensure that the address and (address + length) of data to be
/// written does not go beyond the size of the memory module. If they do,
/// the write operation will "wrap around" and start corrupting the starting
/// address of the memory (boot sector), rendering the device inoperable.
///
/// Note that this function will not allow corruption of certain memory
/// locations, such as currently active sections (boot sectors) and sections
/// required for the proper function of the Bluetooth subsystem.
///
/// \param addr - The starting destination address on the serial flash.
/// \param len - The number of bytes to write.
/// \param buf - Pointer to source data buffer.
///
/// \return The number of bytes written.
/// Note: Please set serial flash size using wiced_hal_sflash_set_size API before
/// using this API. Otherwise write fails.
///////////////////////////////////////////////////////////////////////////////
uint32_t wiced_hal_sflash_write(uint32_t addr, uint32_t len, uint8_t *buf);
谢谢及时的回复,是否有对这个写保护的 enbale/disbale 的函数?
从提供的api 来看没有disable和enable的接口。
好的,谢谢!