-
Notifications
You must be signed in to change notification settings - Fork 218
Updated to latest IDF #89
Conversation
esp32/sdkconfig.h: Updated to latest IDF
|
I'm pretty sure those are booleans from the config file, the "y" is for purposes of the config UI. |
Done. |
| #define CONFIG_TASK_WDT_CHECK_IDLE_TASK 0 | ||
| #define CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1 0 | ||
|
|
||
| #define CONFIG_FREERTOS_UNICORE 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this switch the code to use dual core? If so is dual core working ok now, did you test it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to remove that to get the IDF to compile, since some (new) functions are hard-coded to use 2 cores. I did test it, and it's working fine. If you're interested in the exact area, I can try compiling with CONFIG_FREERTOS_UNICORE restored to 1.
Depends on what you mean by "test," hence my question in #88 WRT running tests.
I was just in "make it work" mode.
I did a make menuconfig on one of the IDF examples, and it un-defines this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some (new) functions are hard-coded to use 2 cores
Can you give examples of these? I'd be surprised if the IDF changed so much that it no longer works with single core.
I was just in "make it work" mode.
The esp32 port is still beta so as long as things work then it's ok. I assume you checked that wifi and your BT stuff works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dug into this:
Here's what you get if you restore CONFIG_FREERTOS_UNICORE:
/home/epoulsen/workspaces/esp-idf//components/esp32/dport_access.c: In function 'dport_access_init_core1':
/home/epoulsen/workspaces/esp-idf//components/esp32/dport_access.c:164:21: error: array subscript is above array bounds [-Werror=array-bounds]
dport_access_ref[core_id] = 0;
^
/home/epoulsen/workspaces/esp-idf//components/esp32/dport_access.c:165:23: error: array subscript is above array bounds [-Werror=array-bounds]
dport_access_start[core_id] = 0;
^
/home/epoulsen/workspaces/esp-idf//components/esp32/dport_access.c:166:21: error: array subscript is above array bounds [-Werror=array-bounds]
dport_access_end[core_id] = 0;
^
/home/epoulsen/workspaces/esp-idf//components/esp32/dport_access.c:167:21: error: array subscript is above array bounds [-Werror=array-bounds]
dport_core_state[core_id] = DPORT_CORE_STATE_RUNNING;
^
cc1: all warnings being treated as errors
make: *** [build//home/epoulsen/workspaces/esp-idf//components/esp32/dport_access.o] Error 1
make: *** Waiting for unfinished jobs....
epoulsen@banana ~/workspaces/micropython-esp32/esp32 $
Code in question:
Note that dport_access_init_core1 is not guarded by any #ifdef. Evidently the toolchain or the IDF code is set up to do static evaluation of assert() statements where possible.
esp-idf/components/esp32/dport_access.c:
static void dport_access_init_core1(void *arg)
{
int core_id = xPortGetCoreID();
assert(core_id == 1);
ESP_INTR_DISABLE(ETS_DPORT_INUM);
intr_matrix_set(core_id, ETS_FROM_CPU_INTR3_SOURCE, ETS_DPORT_INUM);
ESP_INTR_ENABLE(ETS_DPORT_INUM);
dport_access_ref[core_id] = 0;
dport_access_start[core_id] = 0;
dport_access_end[core_id] = 0;
dport_core_state[core_id] = DPORT_CORE_STATE_RUNNING;
vTaskDelete(NULL);
}esp-idf/components/freertos/include/freertos/FreeRTOSConfig.h:
/* ESP31 and ESP32 are dualcore processors. */
#ifndef CONFIG_FREERTOS_UNICORE
#define portNUM_PROCESSORS 2
#else
#define portNUM_PROCESSORS 1
#endifIf you removeesp-idf/components/esp32/dport_access.c from the Makefile, you get a whole bunch of link errors:
LINK build/application.elf
build//home/epoulsen/workspaces/esp-idf//components/freertos/xtensa_vectors.o:(.iram1.literal+0x54): undefined reference to `dport_access_start'
build//home/epoulsen/workspaces/esp-idf//components/freertos/xtensa_vectors.o:(.iram1.literal+0x58): undefined reference to `dport_access_end'
build//home/epoulsen/workspaces/esp-idf//components/newlib/time.o:(.literal.esp_setup_time_syscalls+0xc): undefined reference to `rtc_time_get'
build//home/epoulsen/workspaces/esp-idf//components/newlib/time.o: In function `esp_setup_time_syscalls':
... over 100 more lines ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiling the example get-started/hello_world with FreeRTOS/UNICORE set to "yes" succeeds. Try adding -Wno-error=array-bounds to CFLAGS for the dport_access.c file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try adding -Wno-error=array-bounds to CFLAGS for the dport_access.c file.
I'll try it, but that function is unconditionally a part of the IDF, however, I don't know if anything links to it.
The example I used was the gatt_server_service_table, though all I did was let it write the defaults for sdkconfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try adding -Wno-error=array-bounds to CFLAGS for the dport_access.c file.
Yes, this worked, with CONFIG_FREERTOS_UNICORE restored to 1, basic tests passed.
Wifi works well, per the towel.blinkenlights.nl telnet test.
@dpgeorge : Should I update this PR with those changes?
The whole point was to update the IDF to resolve espressif/esp-idf#520, because I kept getting hammered with crashes while testing BT. Let me test the WiFi thoroughly tomorrow (actually at home -- don't have any ESP32 here), but I was playing around with WiFi today, and it seemed OK. I'll post results here tomorrow. |
Speaking of which, I have a new branch (BT implementation) that is rebased off of this branch (IDF update), so if this PR is merged, then I'll have to retract #86 (BT implementation on old IDF), and resubmit, since the differences are substantial enough that a simple rebase won't suffice. |
esp32/sdkconfig.h: restored CONFIG_FREERTOS_UNICORE
Not entirely sure
CONFIG_ESP32_XTAL_FREQ_AUTOneeds to be1ory