diff --git a/components/ulp/component_ulp_common.mk b/components/ulp/component_ulp_common.mk index 70e5b0205..e051af078 100644 --- a/components/ulp/component_ulp_common.mk +++ b/components/ulp/component_ulp_common.mk @@ -81,7 +81,7 @@ build: $(COMPONENT_BUILD_DIR)/$(ULP_EXPORTS_HEADER) \ $(ULP_EXP_DEP_OBJECTS) : $(ULP_EXPORTS_HEADER) $(ULP_SYM) # Finally, set all the variables processed by the build system. -COMPONENT_EXTRA_CLEAN := $(ULP_OBJECTS) \ +COMPONENT_EXTRA_CLEAN += $(ULP_OBJECTS) \ $(ULP_LD_SCRIPT) \ $(ULP_PREPROCESSED) \ $(ULP_ELF) $(ULP_BIN) \ @@ -91,6 +91,6 @@ COMPONENT_EXTRA_CLEAN := $(ULP_OBJECTS) \ $(ULP_DEP) \ $(ULP_LISTINGS) -COMPONENT_EMBED_FILES := $(COMPONENT_BUILD_DIR)/$(ULP_BIN) -COMPONENT_ADD_LDFLAGS := -l$(COMPONENT_NAME) -T $(COMPONENT_BUILD_DIR)/$(ULP_EXPORTS_LD) -COMPONENT_EXTRA_INCLUDES := $(COMPONENT_BUILD_DIR) +COMPONENT_EMBED_FILES += $(COMPONENT_BUILD_DIR)/$(ULP_BIN) +COMPONENT_ADD_LDFLAGS += -l$(COMPONENT_NAME) -T $(COMPONENT_BUILD_DIR)/$(ULP_EXPORTS_LD) +COMPONENT_EXTRA_INCLUDES += $(COMPONENT_BUILD_DIR) diff --git a/components/ulp/include/esp32/ulp.h b/components/ulp/include/esp32/ulp.h index 64bfff8c4..8acbd7120 100644 --- a/components/ulp/include/esp32/ulp.h +++ b/components/ulp/include/esp32/ulp.h @@ -17,6 +17,7 @@ #include #include #include "esp_err.h" +#include "soc/soc.h" #ifdef __cplusplus extern "C" { @@ -860,7 +861,7 @@ esp_err_t ulp_process_macros_and_load(uint32_t load_addr, const ulp_insn_t* prog * 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 - 16) bytes of arbitrary data (will not be loaded into RTC memory) + * 6. (TEXT_OFFSET - 12) bytes of arbitrary data (will not be loaded into RTC memory) * 7. .text section * 8. .data section * diff --git a/docs/en/api-guides/ulp.rst b/docs/en/api-guides/ulp.rst index 9f913ff81..a5e54d062 100644 --- a/docs/en/api-guides/ulp.rst +++ b/docs/en/api-guides/ulp.rst @@ -134,7 +134,7 @@ Each ULP program is embedded into the ESP-IDF application as a binary blob. Appl Once the program is loaded into RTC memory, application can start it, passing the address of the entry point to ``ulp_run`` function:: - ESP_ERROR_CHECK( ulp_run((&ulp_entry - RTC_SLOW_MEM) / sizeof(uint32_t)) ); + ESP_ERROR_CHECK( ulp_run(&ulp_entry - RTC_SLOW_MEM) ); .. doxygenfunction:: ulp_run diff --git a/examples/system/ulp/main/ulp_example_main.c b/examples/system/ulp/main/ulp_example_main.c index c03ab20ee..74c4febe4 100644 --- a/examples/system/ulp/main/ulp_example_main.c +++ b/examples/system/ulp/main/ulp_example_main.c @@ -87,7 +87,7 @@ static void init_ulp_program() ulp_set_wakeup_period(0, 20000); /* Start the program */ - err = ulp_run((&ulp_entry - RTC_SLOW_MEM) / sizeof(uint32_t)); + err = ulp_run(&ulp_entry - RTC_SLOW_MEM); ESP_ERROR_CHECK(err); } diff --git a/examples/system/ulp_adc/main/ulp_adc_example_main.c b/examples/system/ulp_adc/main/ulp_adc_example_main.c index 29d8eac9a..fd7d4ef43 100644 --- a/examples/system/ulp_adc/main/ulp_adc_example_main.c +++ b/examples/system/ulp_adc/main/ulp_adc_example_main.c @@ -89,6 +89,6 @@ static void start_ulp_program() ulp_sample_counter = 0; /* Start the program */ - esp_err_t err = ulp_run((&ulp_entry - RTC_SLOW_MEM) / sizeof(uint32_t)); + esp_err_t err = ulp_run(&ulp_entry - RTC_SLOW_MEM); ESP_ERROR_CHECK(err); }