AnsweredAssumed Answered

something wrong with flashx

Question asked by tifen tan on Aug 26, 2016
Latest reply on Aug 31, 2016 by tifen tan

i am using k60d100m with 512 flash.

const FLASHX_FILE_BLOCK _bsp_flashx_file_blocks[] = {
{ "bank0", BSP_INTERNAL_FLASH_BASE, BSP_INTERNAL_FLASH_BASE + (BSP_INTERNAL_FLASH_SIZE / 2) - 1 },
{ "bank1", BSP_INTERNAL_FLASH_BASE + (BSP_INTERNAL_FLASH_SIZE / 2), BSP_INTERNAL_FLASH_BASE + (BSP_INTERNAL_FLASH_SIZE ) - 1 },
// swap file definition according to the default value of BSPCFG_SWAP_INDICATOR_ADDR and sector size
{ "swap0", BSP_INTERNAL_FLASH_BASE, BSP_INTERNAL_FLASH_BASE + (BSP_INTERNAL_FLASH_SIZE / 2) - (1 + BSP_INTERNAL_FLASH_SECTOR_SIZE) },
{ "swap1", BSP_INTERNAL_FLASH_BASE + (BSP_INTERNAL_FLASH_SIZE / 2), BSP_INTERNAL_FLASH_BASE + (BSP_INTERNAL_FLASH_SIZE ) - (1 + BSP_INTERNAL_FLASH_SECTOR_SIZE) },
// flash space used by application
{ "code", BSP_INTERNAL_FLASH_BASE, (uint32_t)__FLASHX_START_ADDR - 1 },
// remaining free flash space
{ "", (uint32_t)__FLASHX_START_ADDR, (uint32_t)__FLASHX_END_ADDR },
{ NULL, 0, 0 }
};

i open the bank0 and write() the last sector(3F800 - 3FFFF),it is invalid.

error form  ftfl_flash_erase_sector(),error code FTFL_ERR_PVIOL,Seems to be protected.

also the bank1 last sector(7F800 - 7FFFF) is not working.

but i had try the next to last sector(3F000-3F7FF) is ok.

why is that happened?can i  use bank0  and bank1 as last sector?

Outcomes