Kaynağa Gözat

Merge branch 'bugfix/ulp_fixes' into 'master'

ULP fixes

See merge request idf/esp-idf!2948
Ivan Grokhotkov 7 yıl önce
ebeveyn
işleme
80c5547b97

+ 4 - 4
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)

+ 2 - 1
components/ulp/include/esp32/ulp.h

@@ -17,6 +17,7 @@
 #include <stddef.h>
 #include <stdlib.h>
 #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
  *

+ 1 - 1
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
 

+ 1 - 1
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);
 }
 

+ 1 - 1
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);
 }