ulp_load_binary() function
Load ULP program binary into RTC memory ULP program binary should have the following format (all values little-endian): 1. MAGIC, (value 0x00706c75, 4 bytes) 2. TEXT_OFFSET, offset of .text section from binary start (2 bytes) 3. TEXT_SIZE, size of .text section (2 bytes) 4. DATA_SIZE, size of .data section (2 bytes) 5. BSS_SIZE, size of .bss section (2 bytes) 6. (TEXT_OFFSET - 12) bytes of arbitrary data (will not be loaded into RTC memory) 7. .text section 8. .data section Linker script in components/ulp/ld/esp32.ulp.ld produces ELF files which correspond to this format. This linker script produces binaries with load_addr == 0.
Arguments
load_addr
address where the program should be loaded, expressed in 32-bit words
program_binary
pointer to program binary
program_size
size of the program binary
Return value
- ESP_OK on success - ESP_ERR_INVALID_ARG if load_addr is out of range - ESP_ERR_INVALID_SIZE if program_size doesn't match (TEXT_OFFSET + TEXT_SIZE + DATA_SIZE) - ESP_ERR_NOT_SUPPORTED if the magic number is incorrect
ulp_load_binary() calls 2 functions:
![]()
ulp_load_binary()
ulp_load_binary() reads 11 variables:
![]()
ulp_load_binary()