2022-01-05 03:17:12 -05:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2020-04-17 15:34:56 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "esp_err.h"
|
|
|
|
#include "ulp_common.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Run the program loaded into RTC memory
|
|
|
|
* @return ESP_OK on success
|
|
|
|
*/
|
|
|
|
esp_err_t ulp_riscv_run(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Load ULP-RISC-V program binary into RTC memory
|
2020-11-10 02:40:01 -05:00
|
|
|
*
|
2020-04-17 15:34:56 -04:00
|
|
|
* Different than ULP FSM, the binary program has no special format, it is the ELF
|
|
|
|
* file generated by RISC-V toolchain converted to binary format using objcopy.
|
|
|
|
*
|
2020-08-13 07:44:46 -04:00
|
|
|
* Linker script in components/ulp/ld/esp32s2.ulp.riscv.ld produces ELF files which
|
2020-04-17 15:34:56 -04:00
|
|
|
* correspond to this format. This linker script produces binaries with load_addr == 0.
|
|
|
|
*
|
|
|
|
* @param program_binary pointer to program binary
|
|
|
|
* @param program_size_bytes size of the program binary
|
|
|
|
* @return
|
|
|
|
* - ESP_OK on success
|
2020-11-10 02:40:01 -05:00
|
|
|
* - ESP_ERR_INVALID_SIZE if program_size_bytes is more than 8KiB
|
2020-04-17 15:34:56 -04:00
|
|
|
*/
|
|
|
|
esp_err_t ulp_riscv_load_binary(const uint8_t* program_binary, size_t program_size_bytes);
|