GithubHelp home page GithubHelp logo

Comments (17)

bjoernQ avatar bjoernQ commented on July 27, 2024 1

On Xtensa based chips the interrupt handlers correspond to the interrupt level (in contrast to RISCV based ones). That might be quite confusing I guess - and we should do a better job explaining both. Actually, user code shouldn't even use levels 4-7.

So having level1 to level7 is enough (and more than you should use)

There is also an interrupt matrix involved which maps the peripheral interrupts to CPU interrupts.

That might reduce some of the confusion, I hope.

However, it doesn't explain why it doesn't work you. My own tests look fine so I need to just try your code

from esp-hal.

bjoernQ avatar bjoernQ commented on July 27, 2024 1

It seems like #55 should fix this

from esp-hal.

orangecms avatar orangecms commented on July 27, 2024 1

With the changes in https://github.com/orangecms/esp-hal/tree/gpio-input-pullup-fix the two GPIOs 0 and 5 are working now.
πŸ₯³

So I guess that 2 and 12 are special as mentioned in #55.

from esp-hal.

bjoernQ avatar bjoernQ commented on July 27, 2024 1

Good to hear that - GPIO 2 and 12 issues should be solved by #55 - hope to get to that soon

Also, thanks for raising this issue - it's very valuable

from esp-hal.

orangecms avatar orangecms commented on July 27, 2024 1

@orangecms I have put together something here: https://github.com/bjoernQ/esp-hal/tree/bugfix/errata_3_6 Would be great if you can find some time to give this a try - hopefully this will fix the issue

YES! I am happy to report that indeed this fixes both GPIOs 2 and 12 πŸ₯³ Thank you so much! \o/

from esp-hal.

bjoernQ avatar bjoernQ commented on July 27, 2024 1

Greate - thanks for giving it a try. Will create a PR for this

from esp-hal.

orangecms avatar orangecms commented on July 27, 2024

Looking through the linker scripts and various repos - hal, pac, rt -, I am a bit confused that only interrupt functions 1-7 are defined.
So I need to extend the linker script? And how would I do that?

https://github.com/esp-rs/xtensa-lx-rt/blob/master/exception-esp32.x.jinja Is this what I need to do, map to the low-level functions?

from esp-hal.

orangecms avatar orangecms commented on July 27, 2024

Browsing other issues, I also found this, is it related?

espressif/svd#6

from esp-hal.

bjoernQ avatar bjoernQ commented on July 27, 2024

So, I gave your code a try and it seems like there is an issue with GPIO5 for me but the others are working.
I modified your code here: https://gist.github.com/bjoernQ/71999fd43eba4680a09a9870eb7e9311
Maybe you can give that a try and see if the inputs beside GPIO5 is working for you

from esp-hal.

bjoernQ avatar bjoernQ commented on July 27, 2024

Looking further into this it seems it's more an issue of configuring pull-downs / pull-ups than an issue with interrupts

from esp-hal.

orangecms avatar orangecms commented on July 27, 2024

Thank you a lot - I will adhust the title and try your suggestions. :-)
Since I want to check for edge triggers, I understand now that I need to use a lower priority interrupt handler for that, because level 1 is not available for that. The relationship between the handler numbering and the level was indeed not clear to me. Thank you so much!

I'll also see that I file some PRs against the hal repo to simplify and explain the example. :-)

from esp-hal.

bjoernQ avatar bjoernQ commented on July 27, 2024

@orangecms would you mind posting your working MicroPython code? Thanks

from esp-hal.

orangecms avatar orangecms commented on July 27, 2024

@orangecms would you mind posting your working MicroPython code? Thanks

Sure :)

https://github.com/das-labor/badge-2021/blob/main/sw-demo/spi_rects.py#L12

from esp-hal.

bjoernQ avatar bjoernQ commented on July 27, 2024

There is definitely one thing that looks wrong:

self.init_input(false, false);

PU should be true here

Still that doesn't solve the problem for all the pins as it seems

from esp-hal.

orangecms avatar orangecms commented on July 27, 2024

Awesome, thank you so much! πŸ™‡

I'll gladly test this and report back. :-)

We'll be at GPN and bring a few of these fancy badges. Let me know if you're also around and I'll gladly give you one. 🎁

from esp-hal.

bjoernQ avatar bjoernQ commented on July 27, 2024

@orangecms I have put together something here: https://github.com/bjoernQ/esp-hal/tree/bugfix/errata_3_6
Would be great if you can find some time to give this a try - hopefully this will fix the issue

from esp-hal.

orangecms avatar orangecms commented on July 27, 2024

Just one note: They also both trigger once initially. That can be worked around, but might be surprising.

from esp-hal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.