fix some calloc bug

1. some calloc fix
2. fix some document error
3. refactor kv API, to be compatible with ota API
This commit is contained in:
daishengdong
2020-04-24 11:58:42 +08:00
parent f6527d2d9a
commit 2e8c8c19e6
19 changed files with 77 additions and 93 deletions

View File

@@ -7,9 +7,6 @@
#define SECTOR_SIZE 2048 // sector size for stm32l431RCTX
#define SECTOR_SIZE_LOG2 11 // 2 ^ 11 = 2048
#define FOR_KV_FLASH_SIZE (2 * SECTOR_SIZE) // storage for kv
#define FOR_KV_FLASH_START 0x803d000
kv_flash_drv_t stm32l4_norflash_onchip_drv = {
.write = stm32l4_norflash_onchip_write,
.read = stm32l4_norflash_onchip_read,
@@ -19,7 +16,5 @@ kv_flash_drv_t stm32l4_norflash_onchip_drv = {
kv_flash_prop_t stm32l4_norflash_onchip_prop = {
.sector_size_log2 = SECTOR_SIZE_LOG2,
.pgm_type = KV_FLASH_PROGRAM_TYPE_DOUBLEWORD,
.flash_start = FOR_KV_FLASH_START,
.flash_size = FOR_KV_FLASH_SIZE,
};

View File

@@ -4,9 +4,6 @@
#define SECTOR_SIZE 4096 // sector size for qspiflash
#define SECTOR_SIZE_LOG2 12 // 2 ^ 12 = 4096
#define FOR_KV_FLASH_SIZE (2 * SECTOR_SIZE)
#define FOR_KV_FLASH_START 0x0
int stm32l4_qspiflash_read(uint32_t addr, void *buf, size_t len)
{
return hal_spi_flash_read(buf, len, addr);
@@ -33,8 +30,6 @@ kv_flash_drv_t stm32l4_qspiflash_drv = {
kv_flash_prop_t stm32l4_qspiflash_prop = {
.sector_size_log2 = SECTOR_SIZE_LOG2,
.pgm_type = KV_FLASH_PROGRAM_TYPE_BYTE,
.flash_start = FOR_KV_FLASH_START,
.flash_size = FOR_KV_FLASH_SIZE,
};