spinnaker_tools (BMP) latest
SpiNNaker BMP firmware
Loading...
Searching...
No Matches
Enumerations | Functions
bmp_flash.c File Reference

Flash routines for BMP LPC1768. More...

#include "lpc17xx.h"
#include "bmp.h"

Enumerations

enum  bmp_lpc_flash_command { FLASH_PREPARE = 50 , FLASH_COPY = 51 , FLASH_ERASE = 52 , FLASH_SERIAL = 58 }
 (Subset of) commands that can be passed to lpc_iap() More...
 

Functions

uint32_t is_blank (const void *buf, uint32_t len)
 Check if an area of memory is blank (filled with 0xFF)
 
uint32_t flash_sector (uint32_t addr)
 Convert flash address to sector number (LPC17xx specific)
 
uint32_t flash_erase (uint32_t start, uint32_t end)
 Erase sectors given start and end (byte) addresses.
 
uint32_t flash_write (uint32_t addr, uint32_t length, const uint32_t *buffer)
 Write to flash from supplied buffer. Only writes one sector.
 

Detailed Description

Flash routines for BMP LPC1768.

Author
Steve Temple, APT Group, School of Computer Science

Enumeration Type Documentation

◆ bmp_lpc_flash_command

(Subset of) commands that can be passed to lpc_iap()

Enumerator
FLASH_PREPARE 

Flash prepare.

FLASH_COPY 

Flash copy.

FLASH_ERASE 

Flash erase.

FLASH_SERIAL 

Flash get serial number.

Function Documentation

◆ is_blank()

uint32_t is_blank ( const void *  buf,
uint32_t  len 
)

Check if an area of memory is blank (filled with 0xFF)

Parameters
[in]bufThe address of the area of memory
[in]lenThe size of the area of memory, in bytes
Returns
True if all bytes are 0xFF, false otherwise

◆ flash_sector()

uint32_t flash_sector ( uint32_t  addr)

Convert flash address to sector number (LPC17xx specific)

Sectors 0..15 are 4096 bytes and sectors 16..29 are 32768 bytes

Parameters
[in]addrAddress in flash
Returns
Sector number

◆ flash_erase()

uint32_t flash_erase ( uint32_t  start,
uint32_t  end 
)

Erase sectors given start and end (byte) addresses.

Parameters
[in]startStarting address
[in]endEnding address
Returns
Result code

◆ flash_write()

uint32_t flash_write ( uint32_t  addr,
uint32_t  length,
const uint32_t *  buffer 
)

Write to flash from supplied buffer. Only writes one sector.

Parameters
[in]addrbyte address in flash
[in]lengthnumber of bytes to write
[in]bufferdata to write
Returns
Result code