lriot 2.1.0.0
|
Bootloader driver definition for LR1110. More...
#include "common/lr1110_bootloader_types.h"
#include "common/lr1110_types.h"
#include "common/lr1110_hal.h"
Go to the source code of this file.
Typedefs | |
typedef uint32_t | lr1110_bootloader_irq_mask_t |
Functions | |
err_t | lr1110_bootloader_get_status (lriot_t *ctx, lr1110_bootloader_stat1_t *stat1, lr1110_bootloader_stat2_t *stat2, lr1110_bootloader_irq_mask_t *irq_status) |
Return the status registers and interrupt flags. | |
err_t | lr1110_bootloader_clear_reset_status_info (lriot_t *ctx) |
Clear the reset status information stored in stat2. | |
err_t | lr1110_bootloader_get_version (lriot_t *ctx, lr1110_bootloader_version_t *version) |
Return the version of the system (hardware and software) | |
err_t | lr1110_bootloader_erase_flash (lriot_t *ctx) |
Erase the whole flash memory of the chip. | |
err_t | lr1110_bootloader_write_flash_encrypted (lriot_t *ctx, uint32_t offset, const uint32_t *buffer, uint8_t length) |
Write encrypted data in program flash memory of the chip. | |
err_t | lr1110_bootloader_write_flash_encrypted_full (lriot_t *ctx, uint32_t offset, const uint32_t *buffer, uint32_t length) |
Write encrypted data in program flash memory of the chip. | |
err_t | lr1110_bootloader_reboot (lriot_t *ctx, bool stay_in_bootloader) |
Software reset of the chip. | |
err_t | lr1110_bootloader_read_pin (lriot_t *ctx, lr1110_bootloader_pin_t pin) |
Returns the 4-byte PIN which can be used to claim a device on cloud services. | |
err_t | lr1110_bootloader_read_chip_eui (lriot_t *ctx, lr1110_bootloader_chip_eui_t chip_eui) |
Read and return the Chip EUI. | |
err_t | lr1110_bootloader_read_join_eui (lriot_t *ctx, lr1110_bootloader_join_eui_t join_eui) |
Read and return the Join EUI. | |
Bootloader driver definition for LR1110.
The Clear BSD License Copyright Semtech Corporation 2021. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
typedef uint32_t lr1110_bootloader_irq_mask_t |
err_t lr1110_bootloader_clear_reset_status_info | ( | lriot_t * | ctx | ) |
Clear the reset status information stored in stat2.
[in] | ctx | Chip implementation context |
err_t lr1110_bootloader_erase_flash | ( | lriot_t * | ctx | ) |
Erase the whole flash memory of the chip.
This function shall be called before any attempt to write a new firmware in flash memory
[in] | ctx | Chip implementation context |
err_t lr1110_bootloader_get_status | ( | lriot_t * | ctx, |
lr1110_bootloader_stat1_t * | stat1, | ||
lr1110_bootloader_stat2_t * | stat2, | ||
lr1110_bootloader_irq_mask_t * | irq_status ) |
Return the status registers and interrupt flags.
[in] | ctx | Chip implementation context |
[out] | stat1 | Content of status register 1 |
[out] | stat2 | Content of status register 2 |
[out] | irq_status | Interrupt flags |
err_t lr1110_bootloader_get_version | ( | lriot_t * | ctx, |
lr1110_bootloader_version_t * | version ) |
Return the version of the system (hardware and software)
[in] | ctx | Chip implementation context |
[out] | version | Pointer to the structure holding the system version |
err_t lr1110_bootloader_read_chip_eui | ( | lriot_t * | ctx, |
lr1110_bootloader_chip_eui_t | chip_eui ) |
Read and return the Chip EUI.
[in] | ctx | Chip implementation context |
[out] | chip_eui | The buffer to be filled with chip EUI of the LR1110. It is up to the application to ensure chip_eui is long enough to hold the chip EUI |
err_t lr1110_bootloader_read_join_eui | ( | lriot_t * | ctx, |
lr1110_bootloader_join_eui_t | join_eui ) |
Read and return the Join EUI.
[in] | ctx | Chip implementation context |
[out] | join_eui | The buffer to be filled with Join EUI of the LR1110. It is up to the application to ensure join_eui is long enough to hold the join EUI |
err_t lr1110_bootloader_read_pin | ( | lriot_t * | ctx, |
lr1110_bootloader_pin_t | pin ) |
Returns the 4-byte PIN which can be used to claim a device on cloud services.
[in] | ctx | Chip implementation context |
[out] | pin | Pointer to the array to be populated with the PIN |
err_t lr1110_bootloader_reboot | ( | lriot_t * | ctx, |
bool | stay_in_bootloader ) |
Software reset of the chip.
This method should be used to reboot the chip in a specified mode. Rebooting in flash mode presumes that the content in flash memory is not corrupted (i.e. the integrity check performed by the bootloader before executing the first instruction in flash is OK).
[in] | ctx | Chip implementation context |
[in] | stay_in_bootloader | Selector to stay in bootloader or execute flash code after reboot. If true, the bootloader will not execute the flash code but activate SPI interface to allow firmware upgrade |
err_t lr1110_bootloader_write_flash_encrypted | ( | lriot_t * | ctx, |
uint32_t | offset, | ||
const uint32_t * | buffer, | ||
uint8_t | length ) |
Write encrypted data in program flash memory of the chip.
This function shall be used when updating the encrypted flash content of the LR1110. The encrypted flash payload to transfer shall be represented as an array of words (i.e. 4-byte values).
[in] | ctx | Chip implementation context |
[in] | offset | The offset from start register of flash |
[in] | buffer | Buffer holding the encrypted content. Its size in words must be at least length |
[in] | length | Number of words (i.e. 4 bytes) in the buffer to transfer |
err_t lr1110_bootloader_write_flash_encrypted_full | ( | lriot_t * | ctx, |
uint32_t | offset, | ||
const uint32_t * | buffer, | ||
uint32_t | length ) |
Write encrypted data in program flash memory of the chip.
This function shall be used when updating the encrypted flash content of the LR1110. The encrypted flash payload to transfer shall be represented as an array of words (ie 4-byte values).
[in] | ctx | Chip implementation context |
[in] | offset | The offset from start register of flash |
[in] | buffer | Buffer holding the encrypted content. Its size in words must be at least length |
[in] | length | Number of words (i.e. 4 bytes) in the buffer to transfer |