Skip to content

Commit ca50718

Browse files
committed
Merge branch 'refactor/startup' into 'master'
Startup flow refactor See merge request espressif/esp-idf!7533
2 parents cf15516 + 98f4cca commit ca50718

40 files changed

+1799
-1751
lines changed

components/efuse/src/esp_efuse_api.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ const static char *TAG = "efuse";
2424
#if defined(BOOTLOADER_BUILD)
2525
#define EFUSE_LOCK_ACQUIRE()
2626
#define EFUSE_LOCK_RELEASE()
27-
#define EFUSE_LOCK_ACQUIRE_RUCURSIVE()
28-
#define EFUSE_LOCK_RELEASE_RUCURSIVE()
27+
#define EFUSE_LOCK_ACQUIRE_RECURSIVE()
28+
#define EFUSE_LOCK_RELEASE_RECURSIVE()
2929
#else
3030
#include <sys/lock.h>
3131
static _lock_t s_efuse_lock;
3232
#define EFUSE_LOCK_ACQUIRE() _lock_acquire(&s_efuse_lock)
3333
#define EFUSE_LOCK_RELEASE() _lock_release(&s_efuse_lock)
34-
#define EFUSE_LOCK_ACQUIRE_RUCURSIVE() _lock_acquire_recursive(&s_efuse_lock)
35-
#define EFUSE_LOCK_RELEASE_RUCURSIVE() _lock_release_recursive(&s_efuse_lock)
34+
#define EFUSE_LOCK_ACQUIRE_RECURSIVE() _lock_acquire_recursive(&s_efuse_lock)
35+
#define EFUSE_LOCK_RELEASE_RECURSIVE() _lock_release_recursive(&s_efuse_lock)
3636
#endif
3737

3838
static bool s_batch_writing_mode = false;
@@ -80,7 +80,7 @@ esp_err_t esp_efuse_read_field_cnt(const esp_efuse_desc_t* field[], size_t* out_
8080
// write array to EFUSE
8181
esp_err_t esp_efuse_write_field_blob(const esp_efuse_desc_t* field[], const void* src, size_t src_size_bits)
8282
{
83-
EFUSE_LOCK_ACQUIRE_RUCURSIVE();
83+
EFUSE_LOCK_ACQUIRE_RECURSIVE();
8484
esp_err_t err = ESP_OK;
8585
if (field == NULL || src == NULL || src_size_bits == 0) {
8686
err = ESP_ERR_INVALID_ARG;
@@ -100,14 +100,14 @@ esp_err_t esp_efuse_write_field_blob(const esp_efuse_desc_t* field[], const void
100100
esp_efuse_utility_reset();
101101
}
102102
}
103-
EFUSE_LOCK_RELEASE_RUCURSIVE();
103+
EFUSE_LOCK_RELEASE_RECURSIVE();
104104
return err;
105105
}
106106

107107
// program cnt bits to "1"
108108
esp_err_t esp_efuse_write_field_cnt(const esp_efuse_desc_t* field[], size_t cnt)
109109
{
110-
EFUSE_LOCK_ACQUIRE_RUCURSIVE();
110+
EFUSE_LOCK_ACQUIRE_RECURSIVE();
111111
esp_err_t err = ESP_OK;
112112
if (field == NULL || cnt == 0) {
113113
err = ESP_ERR_INVALID_ARG;
@@ -135,7 +135,7 @@ esp_err_t esp_efuse_write_field_cnt(const esp_efuse_desc_t* field[], size_t cnt)
135135
esp_efuse_utility_reset();
136136
}
137137
}
138-
EFUSE_LOCK_RELEASE_RUCURSIVE();
138+
EFUSE_LOCK_RELEASE_RECURSIVE();
139139
return err;
140140
}
141141

@@ -184,7 +184,7 @@ uint32_t esp_efuse_read_reg(esp_efuse_block_t blk, unsigned int num_reg)
184184
// writing efuse register.
185185
esp_err_t esp_efuse_write_reg(esp_efuse_block_t blk, unsigned int num_reg, uint32_t val)
186186
{
187-
EFUSE_LOCK_ACQUIRE_RUCURSIVE();
187+
EFUSE_LOCK_ACQUIRE_RECURSIVE();
188188
if (s_batch_writing_mode == false) {
189189
esp_efuse_utility_reset();
190190
}
@@ -198,7 +198,7 @@ esp_err_t esp_efuse_write_reg(esp_efuse_block_t blk, unsigned int num_reg, uint3
198198
}
199199
esp_efuse_utility_reset();
200200
}
201-
EFUSE_LOCK_RELEASE_RUCURSIVE();
201+
EFUSE_LOCK_RELEASE_RECURSIVE();
202202
return err;
203203
}
204204

components/esp32/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ else()
1515
"cache_err_int.c"
1616
"cache_sram_mmu.c"
1717
"clk.c"
18-
"cpu_start.c"
1918
"crosscore_int.c"
2019
"dport_access.c"
2120
"esp_himem.c"
@@ -48,8 +47,6 @@ else()
4847

4948
target_linker_script(${COMPONENT_LIB} INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/esp32_out.ld")
5049

51-
# Rely on user code to define app_main
52-
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u app_main")
5350

5451
if(CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY)
5552
# This has to be linked before esp32.project.ld

components/esp32/cache_err_int.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,22 @@
2323
#include <stdio.h>
2424
#include <stdlib.h>
2525
#include <stdbool.h>
26-
#include "freertos/FreeRTOS.h"
26+
2727
#include "esp_err.h"
28-
#include "esp_intr_alloc.h"
2928
#include "esp_attr.h"
29+
30+
#include "esp_intr_alloc.h"
3031
#include "soc/dport_reg.h"
32+
#include "hal/cpu_hal.h"
33+
34+
#include "esp32/dport_access.h"
35+
#include "esp32/rom/ets_sys.h"
36+
3137
#include "sdkconfig.h"
3238

3339
void esp_cache_err_int_init(void)
3440
{
35-
uint32_t core_id = xPortGetCoreID();
41+
uint32_t core_id = cpu_hal_get_core_id();
3642
ESP_INTR_DISABLE(ETS_MEMACCESS_ERR_INUM);
3743

3844
// We do not register a handler for the interrupt because it is interrupt

0 commit comments

Comments
 (0)