Arrow / Mbed OS DAPLink Reset
Embed: (wiki syntax)

« Back to documentation index

FlashPrg.h File Reference

FlashPrg.h File Reference

DAPLink Interface Firmware Copyright (c) 2009-2016, ARM Limited, All Rights Reserved SPDX-License-Identifier: Apache-2.0. More...

Go to the source code of this file.

Functions

uint32_t Init (uint32_t adr, uint32_t clk, uint32_t fnc)
 Initialize programming functions.
uint32_t UnInit (uint32_t fnc)
 De-Initialize programming functions [optional].
uint32_t BlankCheck (uint32_t adr, uint32_t sz, uint8_t pat)
 Check region for erased memory.
uint32_t EraseChip (void)
 Perform a full chip erase.
uint32_t EraseSector (uint32_t adr)
 Erase a single sector of memory.
uint32_t ProgramPage (uint32_t adr, uint32_t sz, uint32_t *buf)
 Program data into memory.
uint32_t Verify (uint32_t adr, uint32_t sz, uint32_t *buf)
 Verify contents in memory.

Detailed Description

DAPLink Interface Firmware Copyright (c) 2009-2016, ARM Limited, All Rights Reserved SPDX-License-Identifier: Apache-2.0.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file FlashPrg.h.


Function Documentation

uint32_t BlankCheck ( uint32_t  adr,
uint32_t  sz,
uint8_t  pat 
)

Check region for erased memory.

Parameters:
adraddress to start from
szthe amount of memory to check
patthe pattern of erased memory (usually 0xff)
Returns:
0 on success, an error code otherwise
uint32_t EraseChip ( void   )

Perform a full chip erase.

Returns:
0 on success, an error code otherwise

Definition at line 101 of file freescale/iap/FlashPrg.c.

uint32_t EraseSector ( uint32_t  adr )

Erase a single sector of memory.

Parameters:
adraddress of a sector to erase
Returns:
0 on success, an error code otherwise

Definition at line 118 of file freescale/iap/FlashPrg.c.

uint32_t Init ( uint32_t  adr,
uint32_t  clk,
uint32_t  fnc 
)

Initialize programming functions.

Parameters:
adrdevice base address
clkclock frequency (Hz)
fncfunction code (1 - Erase, 2 - Program, 3 - Verify)
Returns:
0 on success, an error code otherwise

Definition at line 29 of file freescale/iap/FlashPrg.c.

uint32_t ProgramPage ( uint32_t  adr,
uint32_t  sz,
uint32_t *  buf 
)

Program data into memory.

Parameters:
adraddress to start programming from
szthe amount of data to program
bufmemory contents to be programmed
Returns:
0 on success, an error code otherwise

Definition at line 137 of file freescale/iap/FlashPrg.c.

uint32_t UnInit ( uint32_t  fnc )

De-Initialize programming functions [optional].

Parameters:
fncfunction code (1 - Erase, 2 - Program, 3 - Verify)
Returns:
0 on success, an error code otherwise

Definition at line 54 of file freescale/iap/FlashPrg.c.

uint32_t Verify ( uint32_t  adr,
uint32_t  sz,
uint32_t *  buf 
)

Verify contents in memory.

Parameters:
adrstart address of the verification
szthe amount of data to be verified
bufmemory contents to be compared against
Returns:
0 on success, an error code otherwise