Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Fix ISR #181

Merged
merged 1 commit into from
Feb 3, 2022
Merged

Fix ISR #181

merged 1 commit into from
Feb 3, 2022

Conversation

Bartvelp
Copy link
Contributor

@Bartvelp Bartvelp commented Oct 5, 2020

Q A
Bug fix? yes
New feature? no
Doc update? no
BC breaks? no
Deprecations? no
Relative Issues #

Currently the ESP8266 is getting stuck in a bootloop with the following error messages:

14:27:55.525 ->  ets Jan  8 2013,rst cause:1, boot mode:(3,6)
14:27:55.525 -> 
14:27:55.525 -> load 0x4010f000, len 3456, room 16 
14:27:55.525 -> tail 0
14:27:55.525 -> chksum 0x84
14:27:55.525 -> csum 0x84
14:27:55.525 -> va5432625
14:27:55.525 -> ~ld

This is because the interrupt service routine is not loaded correctly and I think the watchdog trips immediately. Anyhow this commit fixes that and the library can be used again.

@Sonic0
Copy link
Contributor

Sonic0 commented Oct 5, 2020

Hi @Bartvelp,
interesting, we have never deal with this problem with our ESP8266. How can I reproduce this error?

@Bartvelp
Copy link
Contributor Author

Bartvelp commented Oct 5, 2020

Thats weird, I always have this problem. These are my build options:
image

Any sketch that includes the library gives me the bootloop. I used the basicConnectivty example for the the above log.

@Sonic0
Copy link
Contributor

Sonic0 commented Oct 5, 2020

Thanks, @Bartvelp. I'm away for work, as soon as possible I will try your pull requests (this and the #180).
Do you have time to test pull request #177 and #178 on your ESP8266 (probably with this fix)?

@Bartvelp
Copy link
Contributor Author

Bartvelp commented Oct 5, 2020

#178 Only seems to apply to ESP32, #177 looks fine but I am unable to test atm since I only have one dw1000 currently with me

@Bartvelp
Copy link
Contributor Author

Bartvelp commented Oct 6, 2020

Upon some more debugging I specifcally got this error:

11:43:27.653 -> �⸮�⸮⸮=�⸮ISR not in IRAM!
11:43:27.733 -> 
11:43:27.733 -> User exception (panic/abort/assert)
11:43:27.772 -> Abort called
11:43:27.772 -> 
11:43:27.772 -> >>>stack>>>
11:43:27.812 -> 
11:43:27.812 -> ctx: cont
11:43:27.812 -> sp: 3ffffe90 end: 3fffffc0 offset: 0000
11:43:27.852 -> 3ffffe90:  feefeffe feefeffe feefeffe feefeffe  
11:43:27.893 -> 3ffffea0:  000000fe 00000000 00000000 00000000  
11:43:27.972 -> 3ffffeb0:  00000000 00000000 00000000 00ff0000  
11:43:28.023 -> 3ffffec0:  5ffffe00 5ffffe00 feefeffe 00000000  
11:43:28.062 -> 3ffffed0:  00000001 00000004 00000005 40203782  
11:43:28.102 -> 3ffffee0:  401004de 00000000 00000001 40203794  
11:43:28.183 -> 3ffffef0:  009c1001 00002af4 00000005 40203ca9  
11:43:28.223 -> 3fffff00:  00000000 3ffee698 00000005 00000004  
11:43:28.262 -> 3fffff10:  3ffe84ce 00000000 3ffee4ec 00000004  
11:43:28.344 -> 3fffff20:  3ffe84ce 3ffe84cd 00000005 40203d58  
11:43:28.388 -> 3fffff30:  00000000 0000000f 00000005 40201908  
11:43:28.434 -> 3fffff40:  00000000 feefeffe feefeffe feefeffe  
11:43:28.483 -> 3fffff50:  00002580 0000001c 00000000 3ffee638  
11:43:28.526 -> 3fffff60:  3fffdad0 00000000 3ffee518 40201069  
11:43:28.571 -> 3fffff70:  feefeffe feefeffe feefeffe feefeffe  
11:43:28.616 -> 3fffff80:  feefeffe feefeffe feefeffe feefeffe  
11:43:28.706 -> 3fffff90:  feefeffe feefeffe feefeffe 3ffee638  
11:43:28.751 -> 3fffffa0:  3fffdad0 00000000 3ffee5f8 40203388  
11:43:28.798 -> 3fffffb0:  feefeffe feefeffe 3ffe84e8 40100dfd  
11:43:28.843 -> <<<stack<<<

@Sonic0
Copy link
Contributor

Sonic0 commented Oct 20, 2020

Hi @Bartvelp, I tried your FIX on our NodeMCU 1.0 anchors and it works well. I think it is possible to merge this PR. @0nism ?

@Yashvardhan-A
Copy link

Hey

The commit suggested by @Bartvelp solves the problem that I was referring to in the new pull request.

I tried implementing the example 'BasicConnectivityTest' on a NodeMcu 1.0, i was getting the same 'ISR not in IRAM!' error, I found out that in the new board update ie. anything later to 2.5.1 will throw this error if interrupt function is used in the esp8266. Downgrading to older version is a solution but that isn't advised as handling interrupt in the new method is fairly simple and recommended to avoid unexpected crashes.

By adding changing void interruptServiceRoutine() to void ICACHE_RAM_ATTR interruptServiceRoutine() in the DW1000Ng.cpp file, the code runs without throwing the 'ISR not in IRAM' error.

ICACHE_RAM_ATTR is basically a linker attribute which tells the esp8266 to run the function in the RAM and not in in FLASH.

@Sonic0 Sonic0 merged commit bb3f7d8 into F-Army:master Feb 3, 2022
@Sonic0
Copy link
Contributor

Sonic0 commented Feb 3, 2022

@Bartvelp and @Yashvardhan001109 thanks a lot!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants