Core Dump Upload Service

[中文]

To investigate crashes in some sold devices, the backtrace is needed for analysis. The core dump upload service transmits the backtrace stored in the device partition over HTTP. To enable this feature, select ESP_COREDUMP_ENABLE_TO_FLASH.

Application Example

Implementation of this API is demonstrated in the following example:

Header File

Functions

bool coredump_need_upload()

This function will check the reset code and determine whether to upload the coredump.

Return

  • true: last reboot is a abnormal reset.

  • false

esp_err_t coredump_upload(periph_service_handle_t handle, char *url)

Upload the core dump image to the url. This function will block the current task until the upload process finished.

Return

  • ESP_OK

  • ESP_FAIL

Parameters
  • [in] handle: the ‘periph_service_handle_t’

  • [in] url: server addr

periph_service_handle_t coredump_upload_service_create(coredump_upload_service_config_t *config)

Create the core dump upload service instance.

Return

  • NULL: Failed

  • Others: Success

Parameters
  • config: configuration of the OTA service

Structures

struct coredump_upload_service_config_t

coredump service configuration parameters

Public Members

int task_stack

>0 Service task stack; =0 with out task created

int task_prio

Service task priority (based on freeRTOS priority)

int task_core

Service task running in core (0 or 1)

periph_service_cb evt_cb

Service callback function

void *cb_ctx

Callback context

bool (*do_post)(char *url, uint8_t *data, size_t len)

POST interface, users can override this to customize the http client. if left NULL, the service will use the default one

Macros

COREDUMP_UPLOAD_SERVICE_DEFAULT_CONFIG()