Firmware Update APIs#

Functions#

int32_t

Request wireless firmware upgrade. This is a blocking API.

int32_t
rsi_fwup(uint8_t type, uint8_t *content, uint16_t length)

Helper function for actual APIs.

int32_t
rsi_fwup_start(uint8_t *rps_header)

Send the RPS header content of firmware file. This is a blocking API.

int32_t
rsi_fwup_load(uint8_t *content, uint16_t length)

Send the firmware file content. This is a blocking API.

int32_t
rsi_http_fw_update(uint8_t flags, uint8_t *ip_address, uint16_t port, uint8_t *resource, uint8_t *host_name, uint8_t *extended_header, uint8_t *user_name, uint8_t *password, void(*http_otaf_response_handler)(uint16_t status, const uint8_t *buffer))

Initiate firmware update from an HTTP server. This is non-blocking API.

Function Documentation#

rsi_req_wireless_fwup#

int32_t rsi_req_wireless_fwup (void )

Request wireless firmware upgrade. This is a blocking API.

Parameters
[in]

Returns

  • 0 - Success

  • Non-Zero Value - Failure (Possible Error Codes - 0xfffffffe, 0xfffffffc)

Note

  • Precondition - rsi_config_ipaddress() API needs to be called before this API.

  • For wireless firmware upgrade, it will take approximately 85 seconds for upgrading the firmware file of 1.5 MB

  • Need to call rsi_bl_module_power_cycle() API, for the module to reboot after successful firmware upgradation and wait for 50 seconds for the upgraded firmware to be reflected.

  • Refer to Error Codes section for the description of the above error codes Error Codes.


Definition at line 605 of file network/protocols/http_server/rsi_http_server.c

rsi_fwup#

static int32_t rsi_fwup (uint8_t type, uint8_t * content, uint16_t length)

Helper function for actual APIs.

Parameters
[in]type

- Firmware upgrade chunk type

[in]content

- Firmware content

[in]length

- Length of the content

Returns

  • 0 - Success

  • 3 - Firmware upgrade completed successfully

  • Negative Value - Failure


Definition at line 35 of file network/protocols/rsi_firmware_upgradation.c

rsi_fwup_start#

int32_t rsi_fwup_start (uint8_t * rps_header)

Send the RPS header content of firmware file. This is a blocking API.

Parameters
[in]rps_header

- Pointer to the RPS header content

Returns

  • 0 - Success

  • Non-Zero Value - Failure (Possible Error Codes - 0xfffffffe, 0xfffffffc)

Note


Definition at line 120 of file network/protocols/rsi_firmware_upgradation.c

rsi_fwup_load#

int32_t rsi_fwup_load (uint8_t * content, uint16_t length)

Send the firmware file content. This is a blocking API.

Parameters
[in]content

- Pointer to the firmware file content

[in]length

- Length of the content

Returns

  • 0 - Success

  • 3 - Firmware upgradate is completed successfully

  • Negative Value - Failure (Possible Error Codes - 0xfffffffe, 0xfffffffc)

Note


Definition at line 152 of file network/protocols/rsi_firmware_upgradation.c

References RSI_SUCCESS , and SL_PRINTF

rsi_http_fw_update#

int32_t rsi_http_fw_update (uint8_t flags, uint8_t * ip_address, uint16_t port, uint8_t * resource, uint8_t * host_name, uint8_t * extended_header, uint8_t * user_name, uint8_t * password, void(*)(uint16_t status, const uint8_t *buffer) http_otaf_response_handler, status, buffer)

Initiate firmware update from an HTTP server. This is non-blocking API.

Parameters
[in]flags

- Select version and security

Flags

Macro

Description

BIT(0)

RSI_IPV6

Set this bit to enable IPv6 , by default it is configured to IPv4

BIT(1)

RSI_SSL_ENABLE

Set this bit to enable SSL feature

BIT(2)

RSI_SSL_V_1_0

Set this bit to support SSL TLS Version 1.0 if HTTPS is enabled

BIT(3)

RSI_SSL_V_1_2

Set this bit to support SSL_TLS Version 1.2 if HTTPS is enabled

BIT(4)

RSI_SSL_V_1_1

Set this bit to support SSL_TLS Version 1.1 if HTTPS is enabled

BIT(5)

HTTP_POST_DATA

Set this bit to enable Http_post large data feature

BIT(6)

HTTP_V_1_1

Set this bit to use HTTP version 1.1

[in]ip_address

- Server IP address

[in]port

- Port number, default : 80 - HTTP, 443 - HTTPS

[in]resource

- URL string for requested resource

[in]host_name

- Host name

[in]extended_header

- Extender header if present

[in]user_name

- Username for server Authentication

[in]password

- Password for server Authentication

[in]http_otaf_response_handler

- Callback is called when asynchronous response is received from module for HTTP firmware update request

[out]status

- Status code

[out]buffer

- NULL

Returns

  • 0 - Success

  • Non-Zero value - Failure (Possible Error Codes - BBED,BB40,BB38,BBD2,FF74,FFF4)

Note

  • Refer to Error Codes for the description of above error codes.


Definition at line 52 of file network/protocols/rsi_http_ota_fw_up.c