flash_memory.c File Reference

#include <environment.h>
#include <msp430.h>
#include <flash_memory.h>

Include dependency graph for flash_memory.c:

Go to the source code of this file.

Functions

char * compute_flash_address (int segment, int block)
 function to compute memory address from segment and block number
void erase_flash_segment (int segment)
 erase of one segment of within flash memory
void erase_info_memory (int seg)
 function to erase info memory segment
void flash_info_write (char *buffer, int size, int segment)
 function to write data on flash information memory
void flash_write (char *buffer, int size, int segment, int block)
 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


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  seg  ) 

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 *  buffer,
int  size,
int  segment 
)

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:48 2009 for PowWow v1.0 by  doxygen 1.5.6