ESP32 high level interrupt memory access issue
Posted: Mon Dec 06, 2021 10:45 am
Hello All,
Looking for some help on an issue I'm having with using high level interrupts and memory access inconsistencies.
In a HLI level 5, I'm trying to get the GPIO_STATUS_REG value but the program kept returning 0. Then randomly I added a few lines of code, that simple increments a variable and suddenly GPIO_STATUS_REG = 262144, what I expected. I'm hoping someone may be able to tell me what's going on in the background here. Is it a memory timing issue? Did some cache fill up to a trigger point where it finally executed my memory access? Am I using L32i incorrectly?
I've managed to capture a consistent way of showing the issue. I wonder if other people will experience the same. My issue can be found here, https://github.com/HaydenDekker/ls-t-gp ... -int-alloc
In this example, I get my expected results, when applying 3.3v to pin 18 and then pin 19.
VECTOR INTERRUPT VAL 2147581952. VECTOR INTENABLE value 2466250820. GPIO_STATUS_REG. 262144. DPORT_APP_GPIO_INTERRUPT_MAP_REG. 31. ISR runs total 679.
VECTOR INTERRUPT VAL 2147581952. VECTOR INTENABLE value 2466250820. GPIO_STATUS_REG. 524288. DPORT_APP_GPIO_INTERRUPT_MAP_REG. 31. ISR runs total 694.
But after removing/commenting out lines 55 to 59 in highint5.S this causes GPIO_STATUS_REG = 0. And I can't work out why and what I'm going wrong. The code I remove is totally unrelated to the code getting GPIO_STATUS_REG.
Thankyou for you help.
For reference, it's built on Darth Clouds example here, https://github.com/darthcloud/esp32_hig ... aster/main
Looking for some help on an issue I'm having with using high level interrupts and memory access inconsistencies.
In a HLI level 5, I'm trying to get the GPIO_STATUS_REG value but the program kept returning 0. Then randomly I added a few lines of code, that simple increments a variable and suddenly GPIO_STATUS_REG = 262144, what I expected. I'm hoping someone may be able to tell me what's going on in the background here. Is it a memory timing issue? Did some cache fill up to a trigger point where it finally executed my memory access? Am I using L32i incorrectly?
I've managed to capture a consistent way of showing the issue. I wonder if other people will experience the same. My issue can be found here, https://github.com/HaydenDekker/ls-t-gp ... -int-alloc
In this example, I get my expected results, when applying 3.3v to pin 18 and then pin 19.
VECTOR INTERRUPT VAL 2147581952. VECTOR INTENABLE value 2466250820. GPIO_STATUS_REG. 262144. DPORT_APP_GPIO_INTERRUPT_MAP_REG. 31. ISR runs total 679.
VECTOR INTERRUPT VAL 2147581952. VECTOR INTENABLE value 2466250820. GPIO_STATUS_REG. 524288. DPORT_APP_GPIO_INTERRUPT_MAP_REG. 31. ISR runs total 694.
But after removing/commenting out lines 55 to 59 in highint5.S this causes GPIO_STATUS_REG = 0. And I can't work out why and what I'm going wrong. The code I remove is totally unrelated to the code getting GPIO_STATUS_REG.
Code: Select all
//movi a14, isr_runs_total
//l32i a15, a14, 0
//addi a15, a15, 1
//s32i a15, a14, 0
//memw
For reference, it's built on Darth Clouds example here, https://github.com/darthcloud/esp32_hig ... aster/main