#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sysexits.h>
#include <ctype.h>
#include <unistd.h>
#include "dbg_msg.h"
#include "jt_instr.h"
#include "jt_arm.h"
#include "jt_cortex.h"
#include "jt_flash.h"
#include "arm_gdbstub.h"
#include "arm_memory_mmap.h"
#include "arm_memory_workspace.h"
#include "convert.h"
int str7FlashProgram | ( | uint32_t | addr, | |
int | maxSize, | |||
uint32_t * | data | |||
) |
SGS Thomson flash program (of STR71x embedded flash)
addr | Flash page address start | |
maxSize | ||
data | Pointer to 32 bit source of data |
References memMap::baseAddr, convertDiffTimeToMsec, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_INFO, DBG_LEVEL_GDB_ARM_WARN, dbgPrintf(), getWorkSpace(), ICERT_REG_DCC_CONTROL, ICERT_REG_DCC_DATA, IF_DBG, jtag_arm_IceRT_RegRead(), jtag_arm_IceRT_RegRead_Once(), jtag_arm_IceRT_RegWrite(), jtag_arm_Mointor2DebugMode(), jtag_arm_PollDbgState(), jtag_arm_RunProgram(), memMap::memBufferType, memMap::MemBufferType::Workspace::offset, PAGE_SIZE, useWorkspace(), memMap::MemBufferType::Workspace, and WORKSPACE_ALGO_FLASH_STR7.
Referenced by programFlashCB_write_sector().
int str7FlashErase | ( | uint32_t | addr, | |
int | idx | |||
) |
SGS Thomson flash erase
addr | Flash page address start | |
idx | index of page |
0 | on success | |
>=1 | else errro number |
References memMap::baseAddr, convertDiffTimeToMsec, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_INFO, DBG_LEVEL_GDB_ARM_WARN, dbgPrintf(), getWorkSpace(), ICERT_REG_DCC_CONTROL, ICERT_REG_DCC_DATA, IF_DBG, jtag_arm_IceRT_RegRead(), jtag_arm_IceRT_RegRead_Once(), jtag_arm_IceRT_RegWrite(), jtag_arm_Mointor2DebugMode(), jtag_arm_PollDbgState(), jtag_arm_RunProgram(), memMap::memBufferType, memMap::MemBufferType::Workspace::offset, useWorkspace(), memMap::MemBufferType::Workspace, and WORKSPACE_ALGO_FLASH_STR7.
Referenced by eraseFlashCB_sector(), and programFlashCB_write_sector().
int str9FlashProgram | ( | uint32_t | addr, | |
int | maxSize, | |||
uint32_t * | data | |||
) |
SGS Thomson flash program (of STR91x embedded flash using CUI mode)
addr | Flash page address start | |
maxSize | ||
data | Pointer to 32 bit source of data |
References memMap::baseAddr, convertDiffTimeToMsec, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_INFO, DBG_LEVEL_GDB_ARM_WARN, dbgPrintf(), getWorkSpace(), ICERT_REG_DCC_CONTROL, ICERT_REG_DCC_DATA, IF_DBG, jtag_arm_IceRT_RegRead(), jtag_arm_IceRT_RegRead_Once(), jtag_arm_IceRT_RegWrite(), jtag_arm_Mointor2DebugMode(), jtag_arm_PollDbgState(), jtag_arm_RunProgram(), jtag_arm_WriteHalfword(), memMap::memBufferType, memMap::MemBufferType::Workspace::offset, PAGE_SIZE, useWorkspace(), memMap::MemBufferType::Workspace, and WORKSPACE_ALGO_FLASH_STR9.
Referenced by programFlashCB_write_sector().
int str9FlashErase | ( | uint32_t | addr, | |
int | idx | |||
) |
SGS Thomson flash erase (of STR91x embedded flash using CUI mode)
addr | Flash page address start | |
idx | index of page |
0 | on success | |
>=1 | else errro number |
References memMap::baseAddr, convertDiffTimeToMsec, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_INFO, DBG_LEVEL_GDB_ARM_WARN, dbgPrintf(), getWorkSpace(), ICERT_REG_DCC_CONTROL, ICERT_REG_DCC_DATA, IF_DBG, jtag_arm_IceRT_RegRead(), jtag_arm_IceRT_RegRead_Once(), jtag_arm_IceRT_RegWrite(), jtag_arm_Mointor2DebugMode(), jtag_arm_PollDbgState(), jtag_arm_RunProgram(), memMap::memBufferType, memMap::MemBufferType::Workspace::offset, useWorkspace(), memMap::MemBufferType::Workspace, and WORKSPACE_ALGO_FLASH_STR9.
Referenced by eraseFlashCB_sector(), and programFlashCB_write_sector().
int stm32FlashProgram | ( | uint32_t | addr, | |
int | maxSize, | |||
uint32_t * | data | |||
) |
SGS Thomson flash program (of STM32F10x embedded flash)
addr | Flash page address start | |
maxSize | ||
data | Pointer to 32 bit source of data |
References memMap::baseAddr, convertDiffTimeToMsec, CPU, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_INFO, DBG_LEVEL_GDB_ARM_WARN, dbgPrintf(), getWorkSpace(), IF_DBG, jtag_arm_ReadWord(), jtag_arm_RunProgram(), jtag_arm_WriteMemoryBuf(), jtag_arm_WriteWord(), jtag_cortex_core_StopRunningProgram(), memMap::memBufferType, memMap::MemBufferType::Workspace::offset, reg_set::Regs::r, reg_set::regs, transactionActivate(), transactionCreate(), transactionErase(), transactionExecute(), useWorkspace(), memMap::MemBufferType::Workspace, WORKSPACE_ALGO_FLASH_STM32, and WORKSPACE_SEGMENT_SIZE.
Referenced by programFlashCB_write_sector().
static int stm32f10xOptionByteflashEraseSector | ( | uint32_t | base_addr, | |
uint32_t addr | __attribute__(unused) | |||
) | [static] |
SGS Thomson flash option byte erase (of STM32F10x embedded flash)
base_addr | option byte base address | |
addr | option byte address (unused) |
0 | on success | |
>=1 | else errro number |
References memMap::baseAddr, convertDiffTimeToMsec, CPU, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_INFO, DBG_LEVEL_GDB_ARM_WARN, dbgPrintf(), getWorkSpace(), IF_DBG, jtag_arm_ReadWord(), jtag_arm_RunProgram(), jtag_arm_WriteWord(), jtag_cortex_core_StopRunningProgram(), memMap::memBufferType, memMap::MemBufferType::Workspace::offset, reg_set::Regs::r, reg_set::regs, useWorkspace(), memMap::MemBufferType::Workspace, WORKSPACE_ALGO_FLASH_STM32_OPTERASE, and WORKSPACE_SEGMENT_SIZE.
Referenced by stm32FlashErase().
int stm32FlashErase | ( | uint32_t | addr, | |
int | idx | |||
) |
SGS Thomson flash erase (of STM32F10x embedded flash)
addr | Flash page address start | |
idx | index of page |
0 | on success | |
>=1 | else errro number |
References DBG_LEVEL_GDB_ARM_WARN, dbgPrintf(), jt_stm32f10xflashEraseSector(), and stm32f10xOptionByteflashEraseSector().
Referenced by eraseFlashCB_sector(), gdb_monitor_Rcmd(), and programFlashCB_write_sector().