#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"
ingroup armlevel
int programFlashCB_write_sector | ( | int | currAddr, | |
int | cnt, | |||
struct context * | contextSrc | |||
) |
Callback function to write data into the flash-eeprom
currAddr | ||
cnt | ||
contextSrc |
0 | OK | |
1 | WRONG (terminate with error message) | |
-1 | on failure (panic) |
References memMap::MemBufferType::Flash::algo, allocateCmdCallbackEntry(), allocateGdbSprintfBuf(), atmelFlashErase(), atmelFlashGetStatus(), atmelFlashProgramOnly(), atmelFlashUnlock(), memMap::baseAddr, BUFMAX, memMap::busSize, memMap::MemBuffer::Byte, CB_ACTION_ERASE_FAIL, CB_ACTION_NON, CB_ACTION_PROGRAM_FAIL, CB_ACTION_PROGRAM_SUCCEED, memMap::MemBufferType::Flash::chipsPerBus, flashCBContext::currentSectorId, DBG_LEVEL_ALL, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_INFO_LOW, DBG_LEVEL_GDB_ARM_WARN, 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(), getWorkSpace(), memMap::MemBuffer::HalfWord, IF_DBG, INFO_VERBOSE, inQueueCmdCallbackEntry(), inQueueGdbSprintfBuf(), jt_amdflashEraseSectorByte(), jt_amdflashEraseSectorHalfword(), jt_amdflashEraseSectorWord(), jt_amdflashResetByte(), jt_amdflashResetHalfword(), jt_amdflashResetWord(), jt_intelflashEraseSectorByte(), jt_intelflashEraseSectorHalfword(), jt_intelflashEraseSectorHalfword_dual(), jt_intelflashEraseSectorWord(), jt_intelflashEraseSectorWord_dual(), jt_intelflashEraseSectorWord_quad(), jt_intelflashProgByte(), jt_intelflashProgHalfword(), jt_intelflashProgHalfword_dual(), jt_intelflashProgWord(), jt_intelflashProgWord_dual(), jt_intelflashProgWord_quad(), jt_intelflashUnlockSectorByte(), jt_intelflashUnlockSectorHalfword(), jt_intelflashUnlockSectorHalfword_dual(), jt_intelflashUnlockSectorWord(), jt_intelflashUnlockSectorWord_dual(), jt_intelflashUnlockSectorWord_quad(), jt_philipsflashGenMask(), flashCBContext::lastSectorId, memMap::length, memMap::memBuffer, memMap::memBufferType, MORE_VERBOSE, memMap::MemBufferType::Flash::numberOfSectors, philipsFlashEraseAllUnlocked(), philipsFlashLock(), philipsFlashProgram(), philipsFlashUnlock(), prog_flash_amd16(), prog_flash_amd32(), prog_flash_amd8(), flashCBContext::quiet_cnt, SECTOR_FLAG_DIRTY, SECTOR_FLAG_ERASED, SECTOR_WRITE, SECTOR_WRITE_DIRTY, SECTOR_WRITE_DIRTY_ERASED, memMap::MemBufferType::Flash::sectorList, sector::size, memMap::MemBufferType::Workspace::state, stm32FlashErase(), stm32FlashProgram(), str7FlashErase(), str7FlashProgram(), str9FlashErase(), str9FlashProgram(), flashCBContext::verbose, flashCBContext::whichMemMap, memMap::MemBuffer::Word, memMap::MemBufferType::Workspace, and WORKSPACE_BROKEN.
Referenced by gdb_flash_auto_programming(), and gdb_monitor_Rcmd().