CANopen Bootloader Documentation
Version 4.10.00
|
This file contains prototypes for In-Application Programming (IAP) functions. The IAP provides an interface to exchange data between the CANopen Bootloader and an application, as depicted in the following picture.
The functions declared in this header file are mutuallay exclusive used by the CANopen bootloader or the application. The Backup Register are intended to store values for data exchange between the CANopen Bootloader and the application. Since the functions are hardware platform dependent, the file mc_iap.c
provides only dummy functions.
CANopen bootloader | Application | Description |
---|---|---|
McIapAppSizeLimit() | - | Maximum size of memory for application |
McIapClearBootLock() | - | Clear CANopen bootloader locking |
McIapGetBitrate() | McIapSetBitrate() | Configure bit-rate of CANopen bootloader |
McIapSetModuleUid() | McIapGetModuleUid() | Configure hardware platform UID |
McIapGetNodeId() | McIapSetNodeId() | Configure node-ID of CANopen bootloader |
McIapIsBootLocked() | McIapSetBootLock() | Lock CANopen bootloader upon start |
McIapJumpToApp() | McIapJumpToBoot() | Jump to application or CANopen bootloader |
Enumerations | |
enum | IAP_APP_e { eIAP_APP_INVALID_LEN = 0 , eIAP_APP_INVALID_CRC , eIAP_APP_VALID , eIAP_APP_AUTOSTART } |
Functions | |
uint32_t | McIapAppSizeLimit (void) |
void | McIapClearBootLock (void) |
uint8_t | McIapGetBitrate (void) |
uint32_t | McIapGetModuleUid (void) |
uint8_t | McIapGetNodeId (void) |
uint8_t | McIapIsAppValid (void) |
bool_t | McIapIsBootLocked (void) |
void | McIapJumpToApp (void) |
void | McIapJumpToBoot (void) |
void | McIapSetAppValid (bool btAppIsValidV) |
void | McIapSetBitrate (uint8_t ubBitrateSelV) |
void | McIapSetBootLock (void) |
void | McIapSetModuleUid (uint32_t ulModuleUidV) |
void | McIapSetNodeId (uint8_t ubNodeIdV) |
enum IAP_APP_e |
This enumeration defines values to mark an application as valid or not valid. The values are returned by the function McIapIsAppValid().
uint32_t McIapAppSizeLimit | ( | void | ) |
This function returns the total number of available bytes for the application.
void McIapClearBootLock | ( | void | ) |
This function clears the boot-lock flag.
uint8_t McIapGetBitrate | ( | void | ) |
This function returns the nominal bit-rate value that was configured by the application. The value is defined by the enumeration CpBitrate_e. The CANopen bootloader uses this bit-rate value for CAN initialisation.
uint32_t McIapGetModuleUid | ( | void | ) |
This function returns the unique module identification, i.e. a hardware platform identifier. The value is used by the application in order to identify the hardware platform.
uint8_t McIapGetNodeId | ( | void | ) |
This function returns the node-ID value that was configured by the application. A valid value is in the range from 1 to 127. The bootloader uses this node-ID value for CAN initialisation.
uint8_t McIapIsAppValid | ( | void | ) |
This functions checks if the application is valid and returns an appropriate code. Possible return values are listed in the IAP_APP_e enumeration.
bool_t McIapIsBootLocked | ( | void | ) |
A boot-lock indicates that the bootloader needs to be started after power up, e.g. for a firmware update. The boot-lock prevents the start of an valid application. Possible return values are true
or false
.
void McIapJumpToApp | ( | void | ) |
This function starts the application. It is responsible for:
void McIapJumpToBoot | ( | void | ) |
This function performs a jump to the CANopen bootloader. It is used by the application.
void McIapSetAppValid | ( | bool | btAppIsValidV | ) |
[in] | btAppIsValidV | validation flag |
The function is used to indicate if a stored application is valid. A value of true
for parameter btAppIsValidV indicates that the application is a valid firmware and it can be executed. A value of false
shall mark the application as invalid for execution.
void McIapSetBitrate | ( | uint8_t | ubBitrateSelV | ) |
[in] | ubBitrateSelV | bit-rate selection |
This function stores the parameter ubBitrateSelV value in non-volatile memory in order to be available by the bootloader after an IAP jump (McIapJumpToBoot()). The bootloader will use that bit-rate for CAN initialisation.
void McIapSetBootLock | ( | void | ) |
A boot-lock indicates that the bootloader has to be started after a reset, e.g. for a firmware update.
This function is called by the application. The boot-lock value must be stored in a way that it is available for the bootloader (refer to McIapIsBootLocked()).
void McIapSetModuleUid | ( | uint32_t | ulModuleUidV | ) |
[in] | ulModuleUidV | Unique ID for module |
This function sets the unique module identification, i.e. a hardware platform identifier. The value is configured by the CANopen bootloader.
void McIapSetNodeId | ( | uint8_t | ubNodeIdV | ) |
ubNodeIdV | - Node ID (1..127) |
This function shall store the parameter ubNodeIdV in non-volatile memory in order to be available by the CANopen bootloader after an IAP jump (McIapJumpToBoot()). The CANopen bootloader will use this node-ID value for CAN initialisation.