Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write a GPIO driver for ESP32 #3721

Closed
zephyrbot opened this issue Jun 16, 2017 · 7 comments
Closed

Write a GPIO driver for ESP32 #3721

zephyrbot opened this issue Jun 16, 2017 · 7 comments
Labels
area: GPIO area: Xtensa Xtensa Architecture Enhancement Changes/Updates/Additions to existing features priority: high High impact/importance bug
Milestone

Comments

@zephyrbot
Copy link
Collaborator

zephyrbot commented Jun 16, 2017

Reported by Leandro Pereira:

Write a GPIO driver for ESP32.

(Imported from Jira ZEP-2286)

@zephyrbot
Copy link
Collaborator Author

by Leandro Pereira:

Got most of the driver written today; will likely post the code up for review tomorrow after testing and confirming it works as expected.

@zephyrbot
Copy link
Collaborator Author

by Leandro Pereira:

The driver is working for outputs; however, I can't get interrupts to work when attached to the GPIO interrupt source: an exception is thrown while trying to execute the ISR:
{code}*** Unhandled exception ****
Exception cause 28 (load prohibited):
EPC1 : 0x40080f5a EXCSAVE1 : 0x00040021 EXCVADDR : 0x00000054
Program state (PS):
INTLEVEL : 03 EXCM : 0 UM : 1 RING : 0 WOE : 1
OWB : 01 CALLINC : 2
Current thread ID = 0x3ffb1eb0
Faulting instruction address = 0xdeaddead
Fatal fault in ISR! Spinning...{code}

It's the same exception that happens when using IRQ offloading, so I think they're related. I know that the ISR is in the IRAM region, so in theory it should work. Will investigate more on Monday.

@zephyrbot
Copy link
Collaborator Author

by Leandro Pereira:

Spent some time on this driver today:

  • The GPIO driver was refactored to use the pin mux driver.
  • Exception 28 still happens right before calling the ISR. The difference is that the panic happens only when the pin is toggled, proving that setting the interrupt source is working properly now.

@zephyrbot
Copy link
Collaborator Author

by Leandro Pereira:

Found the culprit for the exception when calling the ISR, and the callback function is working as expected. Will clean everything up tomorrow and post it up for review.

@zephyrbot
Copy link
Collaborator Author

by Mark Linkmeyer:

Since Leandro is now on vacation I'm reassigning this to Andy Ross to finish driving it to the Merged state before the 1.9 Feature Merge Window closes next week. Thanks for the help Andy!

@zephyrbot
Copy link
Collaborator Author

by Chandrakala Kempanna:

Nirmala Devi M Please Verify the Story

@zephyrbot
Copy link
Collaborator Author

by Nirmala Devi M:

This story can be tested with $Zephyr_base/tests/drivers/gpio/gpio_basic_api. And code support for ESP32 for this story is merged in zephyr/master.

Tested and verified this story in master/1f46eb66.

@zephyrbot zephyrbot added priority: high High impact/importance bug area: Xtensa Xtensa Architecture area: GPIO Enhancement Changes/Updates/Additions to existing features labels Sep 23, 2017
@zephyrbot zephyrbot added this to the v1.9.0 milestone Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: GPIO area: Xtensa Xtensa Architecture Enhancement Changes/Updates/Additions to existing features priority: high High impact/importance bug
Projects
None yet
Development

No branches or pull requests

1 participant