project
Fork of X_NUCLEO_IDB0XA1 by
bluenrg_utils.h File Reference
BlueNRG IFR updater & BlueNRG stack updater utility APIs description. More...
Go to the source code of this file.
Functions | |
int | program_device (const uint8_t *fw_image, uint32_t fw_size) |
Flash a new firmware using internal bootloader. | |
int | read_IFR (uint8_t data[192]) |
Read raw data from IFR (3 64-bytes blocks). | |
uint8_t | verify_IFR (const IFR_config_TypeDef *ifr_data) |
Verify raw data from IFR (3 64-bytes blocks). | |
int | program_IFR (const IFR_config_TypeDef *ifr_image) |
Program raw data to IFR (3 64-bytes blocks). | |
void | parse_IFR_data_config (const uint8_t data[64], IFR_config2_TypeDef *IFR_config) |
Parse IFR raw data. | |
int | IFR_validate (IFR_config2_TypeDef *IFR_config) |
Check for the correctness of parsed data. | |
void | change_IFR_data_config (IFR_config2_TypeDef *IFR_config, uint8_t data[64]) |
Modify IFR data. | |
uint8_t | getBlueNRGVersion (uint8_t *hwVersion, uint16_t *fwVersion) |
Get BlueNRG hardware and firmware version. | |
uint8_t | getBlueNRGUpdaterVersion (uint8_t *version) |
Get BlueNRG updater version. | |
uint8_t | isHWBootloader_Patched (void) |
Verifies if the bootloader is patched or not. |
Detailed Description
BlueNRG IFR updater & BlueNRG stack updater utility APIs description.
Definition in file bluenrg_utils.h.
Function Documentation
void change_IFR_data_config | ( | IFR_config2_TypeDef * | IFR_config, |
uint8_t | data[64] | ||
) |
Modify IFR data.
(Last 64-bytes block).
- Parameters:
-
IFR_config Structure that contains the new parameters inside the IFR configuration data.
- Note:
- It is highly recommended to parse the IFR configuration from a working IFR block (this should be done with parse_IFR_data_config()). Then it is possible to write the new parameters inside the IFR_config structure.
- Parameters:
-
data Pointer to the buffer that contains the original data. It will be modified according to the new data in the IFR_config structure. Then this data must be written in the last 64-byte block in the IFR. Its size must be 64 bytes.
- Return values:
-
None
Definition at line 233 of file bluenrg_utils.c.
uint8_t getBlueNRGUpdaterVersion | ( | uint8_t * | version ) |
Get BlueNRG updater version.
- Parameters:
-
version This parameter returns the updater version. If the updadter version is 0x03 the chip has the updater old, needs to update the bootloader.
- Return values:
-
Status of the call
Definition at line 369 of file bluenrg_utils.c.
uint8_t getBlueNRGVersion | ( | uint8_t * | hwVersion, |
uint16_t * | fwVersion | ||
) |
Get BlueNRG hardware and firmware version.
- Parameters:
-
hwVersion This parameter returns the Hardware Version (i.e. CUT 3.0 = 0x30, CUT 3.1 = 0x31). fwVersion This parameter returns the Firmware Version in the format 0xJJMN where JJ = Major Version number, M = Minor Version number and N = Patch Version number.
- Return values:
-
Status of the call
Definition at line 348 of file bluenrg_utils.c.
int IFR_validate | ( | IFR_config2_TypeDef * | IFR_config ) |
Check for the correctness of parsed data.
- Parameters:
-
IFR_config Data structure filled with parsed data.
- Return values:
-
int It returns 0 if successful, or PARSE_ERROR in case data is not correct.
Definition at line 215 of file bluenrg_utils.c.
uint8_t isHWBootloader_Patched | ( | void | ) |
Verifies if the bootloader is patched or not.
This function shall be used to fix a bug on the HW bootloader related to the 32 MHz external crystal oscillator.
- Return values:
-
TRUE if the HW bootloader is already patched, FALSE otherwise
Definition at line 387 of file bluenrg_utils.c.
void parse_IFR_data_config | ( | const uint8_t | data[64], |
IFR_config2_TypeDef * | IFR_config | ||
) |
Parse IFR raw data.
- Parameters:
-
data Pointer to the raw data: last 64 bytes read from IFR sector. IFR_config Data structure that will be filled with parsed data.
- Return values:
-
None
Definition at line 204 of file bluenrg_utils.c.
int program_device | ( | const uint8_t * | fw_image, |
uint32_t | fw_size | ||
) |
Flash a new firmware using internal bootloader.
- Parameters:
-
fw_image Pointer to the firmware image (raw binary data, little-endian). fw_size Size of the firmware image. The firmware image size shall be multiple of 4 bytes.
- Return values:
-
int It returns 0 if successful, or a number not equal to 0 in case of error (ACI_ERROR, UNSUPPORTED_VERSION, WRONG_IMAGE_SIZE, CRC_ERROR)
Definition at line 89 of file bluenrg_utils.c.
int program_IFR | ( | const IFR_config_TypeDef * | ifr_image ) |
Program raw data to IFR (3 64-bytes blocks).
- Parameters:
-
ifr_image Pointer to the buffer that will contain the data to program. Its size must be 192 bytes.
- Return values:
-
int It returns 0 if successful
Definition at line 245 of file bluenrg_utils.c.
int read_IFR | ( | uint8_t | data[192] ) |
Read raw data from IFR (3 64-bytes blocks).
- Parameters:
-
data Pointer to the buffer that will contain the read data. Its size must be 192 bytes. This data can be parsed by parse_IFR_data_config().
- Return values:
-
int It returns 0 if successful, or a number not equal to 0 in case of error (ACI_ERROR, UNSUPPORTED_VERSION)
uint8_t verify_IFR | ( | const IFR_config_TypeDef * | ifr_data ) |
Verify raw data from IFR (3 64-bytes blocks).
- Parameters:
-
ifr_data Pointer to the buffer that will contain the data to verify. Its size must be 192 bytes.
- Return values:
-
int It returns 0 if successful, or a number not equal to 0 in case of error (ACI_ERROR, BLE_UTIL_WRONG_VERIFY)
Definition at line 322 of file bluenrg_utils.c.
Generated on Tue Jul 12 2022 19:31:15 by 1.7.2