API  2.2
TSmarT Software Library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Functions

FLASH_Status TSMART_INT_FLASH_Init (void)
 Initialize the internal flash. More...
 
FLASH_Status TSMART_INT_FLASH_EraseFlashArea (uint32_t TSMART_INT_FLASH_flash_addr, uint32_t TSMART_FLASH_pages)
 Erase an internal flash area. More...
 
FLASH_Status TSMART_INT_FLASH_WriteRegion (uint32_t *TSMART_FLASH_data, int32_t TSMART_FLASH_size, uint32_t TSMART_FLASH_address)
 Writes a region in the internal flash. More...
 
FLASH_Status TSMART_INT_FLASH_ReadRegion (uint32_t *TSMART_FLASH_data, int32_t TSMART_FLASH_size, uint32_t TSMART_FLASH_address)
 Reads data from the internal flash. More...
 

Detailed Description

Function Documentation

FLASH_Status TSMART_INT_FLASH_EraseFlashArea ( uint32_t  TSMART_INT_FLASH_flash_addr,
uint32_t  TSMART_FLASH_pages 
)

Erase an internal flash area.

Erases a number of pages (2 kBytes per page) in internal flash memory.

Parameters
TSMART_INT_FLASH_flash_addrBase memory address
TSMART_FLASH_pagesNumber of pages
Returns
  • FLASH_Status:
    • FLASH_BUSY
    • FLASH_ERROR_PG
    • FLASH_ERROR_WRP
    • FLASH_COMPLETE
    • FLASH_TIMEOUT
Examples:
int_flash.c.
FLASH_Status TSMART_INT_FLASH_Init ( void  )

Initialize the internal flash.

This functions initializes the hardware configuration of the internal flash and the associated OS mechanisms.

Attention
IMPORTANT: Before using this library, please be sure to know well your memory map, located in the .map file created after building your code. Writing in flash zones with binary code will corrupt your executable.
Returns
  • FLASH_Status:
    • FLASH_BUSY
    • FLASH_COMPLETE
Examples:
cellular_2g_ftp_receive.c, and int_flash.c.
FLASH_Status TSMART_INT_FLASH_ReadRegion ( uint32_t *  TSMART_FLASH_data,
int32_t  TSMART_FLASH_size,
uint32_t  TSMART_FLASH_address 
)

Reads data from the internal flash.

Parameters
TSMART_FLASH_dataData buffer to store the data.
TSMART_FLASH_sizeSize of data to read.
TSMART_FLASH_addressFlash memory address to read from.
Returns
  • FLASH_Status:
    • FLASH_BUSY
    • FLASH_ERROR_PG
    • FLASH_ERROR_WRP
    • FLASH_COMPLETE
    • FLASH_TIMEOUT
FLASH_Status TSMART_INT_FLASH_WriteRegion ( uint32_t *  TSMART_FLASH_data,
int32_t  TSMART_FLASH_size,
uint32_t  TSMART_FLASH_address 
)

Writes a region in the internal flash.

Data blocks shall be provided in multiples of 4 bytes (as the ARM Cortex M3 is a 32 bits CPU). Non-multiple of 4 will be padded up to the nearest 4-byte multiple.

Parameters
TSMART_FLASH_dataData buffer to write from.
TSMART_FLASH_sizeSize of the data provided.
TSMART_FLASH_addressFlash memory address to write the data.
Returns
  • FLASH_Status:
    • FLASH_BUSY
    • FLASH_ERROR_PG
    • FLASH_ERROR_WRP
    • FLASH_COMPLETE
    • FLASH_TIMEOUT
Examples:
int_flash.c.