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

Crash without EM after popup "SD card full" is issued by SD logs and USB is connected while popup is on display #3728

Closed
1 task done
mha1 opened this issue Jun 28, 2023 · 2 comments
Labels
bug 🪲 Something isn't working triage Bug report awaiting review / sorting

Comments

@mha1
Copy link
Contributor

mha1 commented Jun 28, 2023

Is there an existing issue for this problem?

  • I have searched the existing issues

What part of EdgeTX is the focus of this bug?

Transmitter firmware

Current Behavior

The SD log subsystem will not start logging if SD card full is detected. Instead POPUP_WARNING() is called to inform user. If while the popup is on display USB is connected (USB popup briefly appears) the radio crashes for good.

Note:

  • this needs prepped firmware to trigger the popup
  • the crash happened to me also the first time after flashing the prepped firmware upon activating SD logs

Expected Behavior

Don't crash

Steps To Reproduce

  1. pull current main
  2. change logs.cpp line 126 to mimic a SD card full situation:
if (sdGetFreeSectors() == 0)
    return STR_SDCARD_FULL;

to

if (true)
    return STR_SDCARD_FULL;
  1. build and flash firmware
  2. power up radio and hit SF switch to activate logging
  3. observe popup "SD card full"
  4. while popup is showing connect top USB-C to PC

Version

Nightly (Please give date/commit below)

Transmitter

Radiomaster TX16S / TX16SMK2

Operating System (OS)

No response

OS Version

No response

Anything else?

I was using commit f5ec9f4 to build the prepped firmware

@mha1 mha1 added bug 🪲 Something isn't working triage Bug report awaiting review / sorting labels Jun 28, 2023
@mha1
Copy link
Contributor Author

mha1 commented Jun 28, 2023

@philmoz I'd very much appreciate you looking into this

@mha1
Copy link
Contributor Author

mha1 commented Jun 28, 2023

I have a hunch this is due to the log system is running triggered by a software timer software timer.

Edit:
Changing POPUP_WARNING() to POPUP_WARNING_ON_UI_TASK solves the problem. But there is one remaining minor issue. Connecting USB while the "SD card ffull" popup is active doesn't crash the radio anymore. After closing the popup the USB ask popup comes up and selecting USB storage connects the SD card to the PC. After ejecting the PC device the "SD is full" popup comes up again (ok because SD card is still full) but the popup cannot be closed by touch. Only the hard key RTN will close the popup this time.

mha1 added a commit to mha1/edgetx that referenced this issue Jun 28, 2023
- checks SD card free space at startup, start of logging and writing screenshots
- issues warning to user if SD card has less than 50MB free space
- will not write logs or screenshots if free space is less than 50MB at activation timerReset
- fixes crash of warning popup in logs.cpp (EdgeTX#3728)
pfeerick pushed a commit that referenced this issue Jul 14, 2023
…ce (#3730)

* justification: #3666

- checks SD card free space at startup, start of logging and writing screenshots
- issues warning to user if SD card has less than 50MB free space
- will not write logs or screenshots if free space is less than 50MB at activation timerReset
- fixes crash of warning popup in logs.cpp (#3728)

* update: warning message if SD card fills up to threshold while logging

* empty commit

* call popup in non-blocking mode

* make b&w compatible to non-blocking popup calls

* 2nd attempt

* Popup:

- turns on backlight if dimmed due to inactivity setting
- if backlight is dimmed due to inactivity setting backlight can turnd on again by any controls

* #3599

* fixed b&w UI

* updated languages CN, CZ, DA, DE, FR, HE, IT, PL, PT, SE, TW

* chore: Update translations
pfeerick pushed a commit that referenced this issue Jul 14, 2023
…ce (#3730)

* justification: #3666

- checks SD card free space at startup, start of logging and writing screenshots
- issues warning to user if SD card has less than 50MB free space
- will not write logs or screenshots if free space is less than 50MB at activation timerReset
- fixes crash of warning popup in logs.cpp (#3728)

* update: warning message if SD card fills up to threshold while logging

* empty commit

* call popup in non-blocking mode

* make b&w compatible to non-blocking popup calls

* 2nd attempt

* Popup:

- turns on backlight if dimmed due to inactivity setting
- if backlight is dimmed due to inactivity setting backlight can turnd on again by any controls

* #3599

* fixed b&w UI

* updated languages CN, CZ, DA, DE, FR, HE, IT, PL, PT, SE, TW

* chore: Update translations
pfeerick pushed a commit that referenced this issue Jul 30, 2023
…ce (#3730)

* justification: #3666

- checks SD card free space at startup, start of logging and writing screenshots
- issues warning to user if SD card has less than 50MB free space
- will not write logs or screenshots if free space is less than 50MB at activation timerReset
- fixes crash of warning popup in logs.cpp (#3728)

* update: warning message if SD card fills up to threshold while logging

* empty commit

* call popup in non-blocking mode

* make b&w compatible to non-blocking popup calls

* 2nd attempt

* Popup:

- turns on backlight if dimmed due to inactivity setting
- if backlight is dimmed due to inactivity setting backlight can turnd on again by any controls

* #3599

* fixed b&w UI

* updated languages CN, CZ, DA, DE, FR, HE, IT, PL, PT, SE, TW

* chore: Update translations
pfeerick added a commit that referenced this issue Jul 30, 2023
…ce (#3802)

* fix: Prevent functional degradation if SD has less than 50MB free space (#3730)

* justification: #3666

- checks SD card free space at startup, start of logging and writing screenshots
- issues warning to user if SD card has less than 50MB free space
- will not write logs or screenshots if free space is less than 50MB at activation timerReset
- fixes crash of warning popup in logs.cpp (#3728)

* update: warning message if SD card fills up to threshold while logging

* empty commit

* call popup in non-blocking mode

* make b&w compatible to non-blocking popup calls

* 2nd attempt

* Popup:

- turns on backlight if dimmed due to inactivity setting
- if backlight is dimmed due to inactivity setting backlight can turnd on again by any controls

* #3599

* fixed b&w UI

* updated languages CN, CZ, DA, DE, FR, HE, IT, PL, PT, SE, TW

* chore: Update translations

* chore: Remove magic number

* chore: JP language update for SD card full (#3809)

* fix: Don't spam simulator log with file close msgs

---------

Co-authored-by: Michael <mha1@users.noreply.github.com>
@pfeerick pfeerick closed this as completed Apr 8, 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 triage Bug report awaiting review / sorting
Projects
None yet
Development

No branches or pull requests

2 participants