#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sysexits.h>
#include <ctype.h>
#include <unistd.h>
#include "dbg_msg.h"
#include "jt_arm.h"
#include "jt_flash.h"
#include "arm_gdbstub.h"
#include "arm_gdbstub_callback.h"
#include "arm_memory_mmap.h"
int eraseFlashCB_sector | ( | int | currAddr, | |
int | cnt, | |||
struct context * | contextSrc | |||
) |
Callback function to erase a sector segment
currAddr | ||
cnt | ||
contextSrc |
0 | OK | |
1 | WRONG (terminate with error message) | |
-1 | on failure (panic) |
References memMap::MemBufferType::Flash::algo, allocateCmdCallbackEntry(), allocateGdbSprintfBuf(), atmelFlashErase(), atmelFlashGetStatus(), atmelFlashUnlock(), memMap::baseAddr, BUFMAX, memMap::busSize, CB_ACTION_ERASE_FAIL, CB_ACTION_ERASE_SUCCEED, CB_ACTION_NON, memMap::MemBufferType::Flash::chipsPerBus, flashCBContext::currentSectorId, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_INFO_LOW, dbgPrintf(), memMap::MemBufferType::Flash, FLASH_ALGORITHEM_AMD, FLASH_ALGORITHEM_ATMEL, FLASH_ALGORITHEM_INTEL, FLASH_ALGORITHEM_PHILIPS, FLASH_ALGORITHEM_STM32, FLASH_ALGORITHEM_STR7, FLASH_ALGORITHEM_STR9, gdbPrintf(), INFO_VERBOSE, inQueueCmdCallbackEntry(), inQueueGdbSprintfBuf(), jt_amdflashEraseSectorByte(), jt_amdflashEraseSectorHalfword(), jt_amdflashEraseSectorWord(), jt_intelflashEraseSectorByte(), jt_intelflashEraseSectorHalfword(), jt_intelflashEraseSectorHalfword_dual(), jt_intelflashEraseSectorWord(), jt_intelflashEraseSectorWord_dual(), jt_intelflashEraseSectorWord_quad(), jt_intelflashUnlockSectorByte(), jt_intelflashUnlockSectorHalfword(), jt_intelflashUnlockSectorHalfword_dual(), jt_intelflashUnlockSectorWord(), jt_intelflashUnlockSectorWord_dual(), jt_intelflashUnlockSectorWord_quad(), jt_philipsflashGenMask(), flashCBContext::lastSectorId, memMap::length, memMap::memBufferType, MORE_VERBOSE, memMap::MemBufferType::Flash::numberOfSectors, philipsFlashEraseAllUnlocked(), philipsFlashLock(), philipsFlashUnlock(), flashCBContext::quiet_cnt, SECTOR_FLAG_HAS_DATA, SECTOR_INVALID, SECTOR_WRITE_DIRTY_ERASED, memMap::MemBufferType::Flash::sectorList, sector::size, stm32FlashErase(), str7FlashErase(), str9FlashErase(), flashCBContext::verbose, and flashCBContext::whichMemMap.
Referenced by gdb_monitor_Rcmd().