flash_memory.h File Reference

Description : prototypes of functions used in flash_memory.c. More...

#include <bite.h>

Include dependency graph for flash_memory.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define BLOCK_SIZE   0x40
#define FLASH_BASE   0xFDFF
#define FLASH_INFO_BASE   0x10FF
#define SEGMENT_INFO_SIZE   0x80
#define SEGMENT_SIZE   0x200

Functions

char * compute_flash_address (int, int)
 function to compute memory address from segment and block number
void erase_flash_segment (int)
 erase of one segment of within flash memory
void erase_info_memory (int)
 function to erase info memory segment
void flash_info_write (char *, int, int)
 function to write data on flash information memory
void flash_write (char *, int, int, int)
 function to write data on flash memory
void init_flash (void)
 operations to start flash controller before writing data on memory
void stop_flash (void)
 operations to stop flash controller after writing data on memory


Detailed Description

Description : prototypes of functions used in flash_memory.c.

Definition in file flash_memory.h.


Define Documentation

#define BLOCK_SIZE   0x40

Definition at line 18 of file flash_memory.h.

Referenced by compute_flash_address(), and flash_write().

#define FLASH_BASE   0xFDFF

Definition at line 16 of file flash_memory.h.

Referenced by compute_flash_address(), erase_flash_segment(), flash_write(), and main().

#define FLASH_INFO_BASE   0x10FF

Definition at line 20 of file flash_memory.h.

Referenced by flash_info_write().

#define SEGMENT_INFO_SIZE   0x80

Definition at line 21 of file flash_memory.h.

Referenced by flash_info_write().

#define SEGMENT_SIZE   0x200

Definition at line 17 of file flash_memory.h.

Referenced by compute_flash_address(), erase_flash_segment(), flash_write(), and main().


Function Documentation

char* compute_flash_address ( int  segment,
int  block 
)

function to compute memory address from segment and block number

Parameters:
[in] segment : segment (512 bytes) where you want to write data [0-100]
[in] block : to choose a block (64 bytes) in a segment to write data [0-7]
Returns:
0 -> echec : wrong segment or block number,

other -> memory address

Definition at line 125 of file flash_memory.c.

References BLOCK_SIZE, FLASH_BASE, and SEGMENT_SIZE.

Referenced by main().

Here is the caller graph for this function:

void erase_flash_segment ( int  segment  ) 

erase of one segment of within flash memory

Note:
program memory area may change in function of loaded code size

Definition at line 61 of file flash_memory.c.

References _DINT, _EINT, FLASH_BASE, init_flash(), SEGMENT_SIZE, and stop_flash().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void erase_info_memory ( int   ) 

function to erase info memory segment

Definition at line 92 of file flash_memory.c.

References init_flash(), and stop_flash().

Referenced by check_online_code_version(), copy_interrupt_vector(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

void flash_info_write ( char *  ,
int  ,
int   
)

function to write data on flash information memory

Definition at line 188 of file flash_memory.c.

References _DINT, _EINT, FLASH_INFO_BASE, init_flash(), SEGMENT_INFO_SIZE, and stop_flash().

Referenced by check_online_code_version(), and copy_interrupt_vector().

Here is the call graph for this function:

Here is the caller graph for this function:

void flash_write ( char *  buffer,
int  size,
int  segment,
int  block 
)

function to write data on flash memory

Parameters:
[in] buffer : points to data to write address.
[in] size : number of bytes we have to write.
[in] segment : segment (512 bytes) where you want to write data [0-100]
[in] block : to choose a block (64 bytes) in a segment to write data [0-7]
Note:
ISP don't work if supply voltage is under 2.7V

You must erase memory segment before write it to be sure of data integrity you want to write

CPU execution is stopped during flash memory write operation

interrupt are disabled during flash memory write operation. It could imply timing base error.

See attached document write_flash_timing.ods to have more informations about function execution timing

See attached document msp430_memory organisation.odt to have more informations

program memory area may change in function of loaded code size (check for your application)

Definition at line 154 of file flash_memory.c.

References _DINT, _EINT, BLOCK_SIZE, FLASH_BASE, init_flash(), SEGMENT_SIZE, and stop_flash().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void init_flash ( void   ) 

operations to start flash controller before writing data on memory

Definition at line 35 of file flash_memory.c.

Referenced by erase_flash_segment(), erase_info_memory(), erase_interrupt_vector(), flash_info_write(), flash_write(), write_interrupt_vector(), and write_start_end_adress().

Here is the caller graph for this function:

void stop_flash ( void   ) 

operations to stop flash controller after writing data on memory

Definition at line 46 of file flash_memory.c.

Referenced by erase_flash_segment(), erase_info_memory(), erase_interrupt_vector(), flash_info_write(), flash_write(), write_interrupt_vector(), and write_start_end_adress().

Here is the caller graph for this function:


Generated on Wed Jun 3 12:05:49 2009 for PowWow v1.0 by  doxygen 1.5.6