Search found 18 matches

by go4retro
Fri Jan 18, 2019 4:24 am
Forum: ESP-IDF
Topic: Overriding linker location for a single IDF routine?
Replies: 21
Views: 18143

Overriding linker location for a single IDF routine?

For performance reasons, I need to ensure gpio_set_level runs from IRAM, not flash. But, when I do this: [mapping] archive: libdriver.a entries: driver:gpio_set_level (noflash) and add the requisite item in component.mk: OMPONENT_ADD_LDFRAGMENTS += linker.lf I get the following error: ERROR: Duplica...
by go4retro
Wed Jan 16, 2019 4:49 am
Forum: ESP-IDF
Topic: IRQ Startup latency
Replies: 11
Views: 11009

Re: IRQ Startup latency

bump in case someone can help...
by go4retro
Mon Jan 14, 2019 3:19 am
Forum: ESP-IDF
Topic: IRQ Startup latency
Replies: 11
Views: 11009

Re: IRQ Startup latency

You can also move any other function you call from your ISR to IRAM, such as gpio_set_level. To do this you can add a linker script fragment to your component (https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/linker-script-generation.html). Example linker.lf: [mapping] archive: libd...
by go4retro
Sun Jan 13, 2019 11:33 pm
Forum: ESP-IDF
Topic: IRQ Startup latency
Replies: 11
Views: 11009

Re: IRQ Startup latency

He meant did you also set ESP_INTR_FLAG_IRAM https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/system/intr_alloc.html#iram-safe-interrupt-handlers Ah, I didn't fully understand. No, I had not. I went back and changed it: gpio_install_isr_service(ESP_INTR_FLAG_IRAM); And, I moved a...
by go4retro
Sun Jan 13, 2019 9:46 pm
Forum: ESP-IDF
Topic: IRQ Startup latency
Replies: 11
Views: 11009

Re: IRQ Startup latency

Yep: static void IRAM_ATTR jim_isr_handler(void* arg) { And, all variables and functions used in the ISR are marked as IRAM_ATTR. It may be that I have to call gpio_set_level() at the very beginning of the ISR, and I suspect that's not in IRAM. So, pulling it from SPI flash makes the response too la...
by go4retro
Sat Jan 12, 2019 6:24 am
Forum: ESP-IDF
Topic: IRQ Startup latency
Replies: 11
Views: 11009

Re: IRQ Startup latency

Regrettably, it has returned. It was working fine after putting in IRAM_ATTR, and I got much further in development. Then, I added a second task to do some Wifi and TCP, and the issue returned. I used the code in this example: https://github.com/sankarcheppali/esp_idf_esp32_posts TO see how my code ...
by go4retro
Thu Jan 10, 2019 6:02 pm
Forum: ESP-IDF
Topic: IRQ Startup latency
Replies: 11
Views: 11009

Re: IRQ Startup latency

I appreciate the response. I will do just that and test. Ironically, the code I copied to start the ISR had that in there, but an article I was reading at the time said that it was no longer necessary to use the modifier, so I left it out of the declaration. Oh well, I guess it's better to see the e...
by go4retro
Thu Jan 10, 2019 6:26 am
Forum: ESP-IDF
Topic: IRQ Startup latency
Replies: 11
Views: 11009

IRQ Startup latency

I am seeing a similar issue as noted here: https://www.esp32.com/viewtopic.php?t=1108 The use case is a legacy bus interface, where the bi-directional nature of the bus is like I2S (open collector lines with pullups), but the data size is 4 bits. The master will pull the "nybble" line low after plac...