jt_flash_stm32f10x.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <sys/time.h>
#include "dbg_msg.h"
#include "jt_arm.h"
#include "jt_instr.h"
#include "jt_flash.h"
#include "convert.h"



Detailed Description

Flash support functions

Define Documentation

#define STM32F10X_FLASH_BASE   0x40022000

Referenced by jt_stm32f10xSetupACR().

#define STM32F10X_FLASH_KEYR   (STM32F10X_FLASH_BASE + 0x04)
#define STM32F10X_FLASH_OPTKEYR   (STM32F10X_FLASH_BASE + 0x08)
#define STM32F10X_FLASH_SR   (STM32F10X_FLASH_BASE + 0x0C)
#define STM32F10X_FLASH_CR   (STM32F10X_FLASH_BASE + 0x10)
#define STM32F10X_FLASH_AR   (STM32F10X_FLASH_BASE + 0x14)
#define STM32F10X_FLASH_OBR   (STM32F10X_FLASH_BASE + 0x1C)
#define STM32F10X_FLASH_WRPR   (STM32F10X_FLASH_BASE + 0x20)
#define STM32F10X_KEY1   0x45670123
#define STM32F10X_KEY2   0xCDEF89ab
#define STM32F10X_RDPTR_KEY   0xa5

Function Documentation

int jt_stm32f10xflashEraseSector ( uint32_t  base_address,
uint32_t  address 

Support Function to Erase a Sector within the Flash

base_address First address of the Flash that has to be erased
address Addres within the sector which has to to be erased
Return values:
0 success
1 error

References convertDiffTimeToMsec, DBG_LEVEL_GDB_ARM_ERROR, DBG_LEVEL_GDB_ARM_WARN, dbgPrintf(), jtag_arm_ReadWord(), jtag_arm_WriteWord(), STM32F10X_FLASH_AR, STM32F10X_FLASH_CR, STM32F10X_FLASH_KEYR, STM32F10X_FLASH_SR, STM32F10X_KEY1, STM32F10X_KEY2, transactionActivate(), transactionCreate(), transactionErase(), and transactionExecute().

Referenced by stm32FlashErase().

int jt_stm32f10xOptionByteflashProgHalfword ( uint32_t  base_address,
uint32_t  address,
uint16_t  data,
unsigned  wait 

Support Function to write one Halfword to the OptionByte-Flash.
This is OK after an erase of a Sector.

base_address flash base address
address byte address to write
data 16-bit data value
wait if true wait for completion
Return values:
0 success
1 error

References DBG_LEVEL_GDB_ARM_WARN, and dbgPrintf().

void jt_stm32f10xSetupACR ( int  clk_in_mhz  ) 

Support Function to Setup STM32F10x Flash controller

clk_in_mhz System Clock (SYSCLK) in MHz

References jtag_arm_ReadWord(), jtag_arm_WriteWord(), STM32F10X_FLASH_ACR, transactionActivate(), transactionCreate(), transactionErase(), and transactionExecute().

This file is part of the documentation for JTAG-GDB Server for ARM .

Generated on Mon Feb 15 21:23:21 2010 by doxygen 1.6.2.