ulp_riscv.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdint.h>
  8. #include <stddef.h>
  9. #include <stdlib.h>
  10. #include "esp_err.h"
  11. #include "ulp_common.h"
  12. /**
  13. * @brief Run the program loaded into RTC memory
  14. * @return ESP_OK on success
  15. */
  16. esp_err_t ulp_riscv_run(void);
  17. /**
  18. * @brief Load ULP-RISC-V program binary into RTC memory
  19. *
  20. * Different than ULP FSM, the binary program has no special format, it is the ELF
  21. * file generated by RISC-V toolchain converted to binary format using objcopy.
  22. *
  23. * Linker script in components/ulp/ld/esp32s2.ulp.riscv.ld produces ELF files which
  24. * correspond to this format. This linker script produces binaries with load_addr == 0.
  25. *
  26. * @param program_binary pointer to program binary
  27. * @param program_size_bytes size of the program binary
  28. * @return
  29. * - ESP_OK on success
  30. * - ESP_ERR_INVALID_SIZE if program_size_bytes is more than 8KiB
  31. */
  32. esp_err_t ulp_riscv_load_binary(const uint8_t* program_binary, size_t program_size_bytes);