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

Apps: Geiger Counter: Fix furi_hal_gpio crash #549

Open
braw opened this issue Feb 10, 2024 · 10 comments
Open

Apps: Geiger Counter: Fix furi_hal_gpio crash #549

braw opened this issue Feb 10, 2024 · 10 comments
Assignees
Labels
bug Something isn't working release-pending This has been implemented and is waiting to be released publicly

Comments

@braw
Copy link

braw commented Feb 10, 2024

Describe the bug.

Geiger Counter app crashes Flipper. Using FlippenHeimer board. Worked in XFW-0052_09122023, but appears broken in XFW-0053_02022024. Rolled back to XFW-0052_09122023 and have no issues.

Screen shows this after reboot:

Flipper crashed but has been rebooted
targets/f7/furi_hal/furi_hal_gpio.c

Reproduction

  1. Plug in FlippenHeimer board.
  2. Launch Geiger Counter app.
  3. System crashes and reboots.

Target

targets/f7/furi_hal/furi_hal_gpio.c

Logs

No response

Anything else?

No response

@braw braw added the bug Something isn't working label Feb 10, 2024
@Willy-JL
Copy link
Contributor

Can you try on latest development build? I have a feeling that the expansion related changes fixed this, as I cannot reproduce it

@Willy-JL Willy-JL added the needs-info Further information is requested label Feb 10, 2024
@braw
Copy link
Author

braw commented Feb 10, 2024

I tried building Dev and installing. Both the Geiger Counter app and the Geiger Dice Roll still crash and reboot the Flipper. No issues when rolling back to XFW-0052_09122023. I tried formatting the SD and installing, rolling back to stock OS then to Dev XFW and it still crashes for me.

@braw
Copy link
Author

braw commented Feb 10, 2024

I also tried the build here, and get the same results. It crashes if I have the FlippenHeimer board plugged in or not.

@Willy-JL
Copy link
Contributor

managed to reproduce it, will have a fix soon. its related to the expansion stuff as i thought, but its just that its not been adapted to support them existing

@Willy-JL
Copy link
Contributor

for now can just set Settings > Expansion Modules > Listen UART = None

@Willy-JL
Copy link
Contributor

Willy-JL commented Feb 10, 2024

this is quite confusing... it crashes at

furi_hal_gpio_add_int_callback(&gpio_ext_pa7, gpiocallback, event_queue);

which looks fine as code... the reason it crashes i see in debugger is that &gpio_ext_pa7 already has a callback configured, but that doesnt make much sense... ill keep investigating

@braw
Copy link
Author

braw commented Feb 10, 2024

I appreciate you looking into it. Just wanted to report it.

@Willy-JL
Copy link
Contributor

this seems to be a problem with gpio pins callback from ofw. it stores interrupt callbacks based on pin index but not port. so pin 7 of right half of gpio had a callback, and setting a callback for pin 7 of left half conflicted, even though it should not have. for now, i can simply disable expansion modules in this app, but i mentioned this to ofw, hope it will get a proper fix

@Willy-JL
Copy link
Contributor

temporarily fixed via b9594f9, lets hope we get a proper fix from upstream

@Willy-JL Willy-JL added release-pending This has been implemented and is waiting to be released publicly and removed needs-info Further information is requested labels Feb 11, 2024
@Willy-JL
Copy link
Contributor

drzlo and skotopes explained the issue, seems like it cannot be fixed properly. gpio pin interrupts are done via exti lines, which are shared between gpio ports, so pin 7 of port a will share the interrupt with pin 7 of port b and all other ports... so yeah disabling expansion module is the only option, this is a hardware limitation of the cpu of flipper.

@Willy-JL Willy-JL changed the title App: Geiger Counter in XFW-0053_02022024 Apps: Geiger Counter: Fix furi_hal_gpio crash Feb 12, 2024
@Willy-JL Willy-JL self-assigned this Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working release-pending This has been implemented and is waiting to be released publicly
Projects
Status: 👀 Done (In next release)
Development

No branches or pull requests

2 participants