MSP430 DriverLib for MSP430F5xx_6xx Devices  2.91.13.01
flashctl

Functions

void FlashCtl_eraseSegment (uint8_t *flash_ptr)
 Erase a single segment of the flash memory. More...
 
void FlashCtl_eraseBank (uint8_t *flash_ptr)
 Erase a single bank of the flash memory. More...
 
void FlashCtl_performMassErase (uint8_t *flash_ptr)
 Erase all flash memory. More...
 
bool FlashCtl_performEraseCheck (uint8_t *flash_ptr, uint16_t numberOfBytes)
 Erase check of the flash memory. More...
 
void FlashCtl_write8 (uint8_t *data_ptr, uint8_t *flash_ptr, uint16_t count)
 Write data into the flash memory in byte format, pass by reference. More...
 
void FlashCtl_write16 (uint16_t *data_ptr, uint16_t *flash_ptr, uint16_t count)
 Write data into the flash memory in 16-bit word format, pass by reference. More...
 
void FlashCtl_write32 (uint32_t *data_ptr, uint32_t *flash_ptr, uint16_t count)
 Write data into the flash memory in 32-bit word format, pass by reference. More...
 
void FlashCtl_fillMemory32 (uint32_t value, uint32_t *flash_ptr, uint16_t count)
 Write data into the flash memory in 32-bit word format, pass by value. More...
 
uint8_t FlashCtl_getStatus (uint8_t mask)
 Check FlashCtl status to see if it is currently busy erasing or programming. More...
 
void FlashCtl_lockInfoA (void)
 Locks the information flash memory segment A. More...
 
void FlashCtl_unlockInfoA (void)
 Unlocks the information flash memory segment A. More...
 

Detailed Description

Function Documentation

§ FlashCtl_eraseBank()

void FlashCtl_eraseBank ( uint8_t *  flash_ptr)

Erase a single bank of the flash memory.

This function erases a single bank of the flash memory. This API will erase the entire flash if device contains only one flash bank.

Parameters
flash_ptris a pointer into the bank to be erased
Returns
None

§ FlashCtl_eraseSegment()

void FlashCtl_eraseSegment ( uint8_t *  flash_ptr)

Erase a single segment of the flash memory.

For devices like MSP430i204x, if the specified segment is the information flash segment, the FLASH_unlockInfo API must be called prior to calling this API.

Parameters
flash_ptris the pointer into the flash segment to be erased
Returns
None

§ FlashCtl_fillMemory32()

void FlashCtl_fillMemory32 ( uint32_t  value,
uint32_t *  flash_ptr,
uint16_t  count 
)

Write data into the flash memory in 32-bit word format, pass by value.

This function writes a 32-bit data value into flash memory, count times. Assumes the flash memory is already erased and unlocked. FlashCtl_eraseSegment can be used to erase a segment.

Parameters
valuevalue to fill memory with
flash_ptris the pointer into which to write the data
countnumber of times to write the value
Returns
None

§ FlashCtl_getStatus()

uint8_t FlashCtl_getStatus ( uint8_t  mask)

Check FlashCtl status to see if it is currently busy erasing or programming.

This function checks the status register to determine if the flash memory is ready for writing.

Parameters
maskFLASHCTL status to read Mask value is the logical OR of any of the following:
  • FLASHCTL_READY_FOR_NEXT_WRITE
  • FLASHCTL_ACCESS_VIOLATION_INTERRUPT_FLAG
  • FLASHCTL_PASSWORD_WRITTEN_INCORRECTLY
  • FLASHCTL_BUSY
Returns
Logical OR of any of the following:
  • FLASHCTL_READY_FOR_NEXT_WRITE
  • FLASHCTL_ACCESS_VIOLATION_INTERRUPT_FLAG
  • FLASHCTL_PASSWORD_WRITTEN_INCORRECTLY
  • FLASHCTL_BUSY
    indicating the status of the FlashCtl

§ FlashCtl_lockInfoA()

void FlashCtl_lockInfoA ( void  )

Locks the information flash memory segment A.

This function is typically called after an erase or write operation on the information flash segment is performed by any of the other API functions in order to re-lock the information flash segment.

Returns
None

§ FlashCtl_performEraseCheck()

bool FlashCtl_performEraseCheck ( uint8_t *  flash_ptr,
uint16_t  numberOfBytes 
)

Erase check of the flash memory.

This function checks bytes in flash memory to make sure that they are in an erased state (are set to 0xFF).

Parameters
flash_ptris the pointer to the starting location of the erase check
numberOfBytesis the number of bytes to be checked
Returns
STATUS_SUCCESS or STATUS_FAIL

§ FlashCtl_performMassErase()

void FlashCtl_performMassErase ( uint8_t *  flash_ptr)

Erase all flash memory.

This function erases all the flash memory banks. For devices like MSP430i204x, this API erases main memory and information flash memory if the FLASH_unlockInfo API was previously executed (otherwise the information flash is not erased). Also note that erasing information flash memory in the MSP430i204x impacts the TLV calibration constants located at the information memory.

Parameters
flash_ptris a pointer into the bank to be erased
Returns
None

§ FlashCtl_unlockInfoA()

void FlashCtl_unlockInfoA ( void  )

Unlocks the information flash memory segment A.

This function must be called before an erase or write operation on the information flash segment is performed by any of the other API functions.

Returns
None

§ FlashCtl_write16()

void FlashCtl_write16 ( uint16_t *  data_ptr,
uint16_t *  flash_ptr,
uint16_t  count 
)

Write data into the flash memory in 16-bit word format, pass by reference.

This function writes a 16-bit word array of size count into flash memory. Assumes the flash memory is already erased and unlocked. FlashCtl_eraseSegment can be used to erase a segment.

Parameters
data_ptris the pointer to the data to be written
flash_ptris the pointer into which to write the data
countnumber of times to write the value
Returns
None

§ FlashCtl_write32()

void FlashCtl_write32 ( uint32_t *  data_ptr,
uint32_t *  flash_ptr,
uint16_t  count 
)

Write data into the flash memory in 32-bit word format, pass by reference.

This function writes a 32-bit array of size count into flash memory. Assumes the flash memory is already erased and unlocked. FlashCtl_eraseSegment can be used to erase a segment.

Parameters
data_ptris the pointer to the data to be written
flash_ptris the pointer into which to write the data
countnumber of times to write the value
Returns
None

§ FlashCtl_write8()

void FlashCtl_write8 ( uint8_t *  data_ptr,
uint8_t *  flash_ptr,
uint16_t  count 
)

Write data into the flash memory in byte format, pass by reference.

This function writes a byte array of size count into flash memory. Assumes the flash memory is already erased and unlocked. FlashCtl_eraseSegment can be used to erase a segment.

Parameters
data_ptris the pointer to the data to be written
flash_ptris the pointer into which to write the data
countnumber of times to write the value
Returns
None

Copyright 2020, Texas Instruments Incorporated