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

System locked when RTC data is broken #3005

Closed
1 task done
padcom opened this issue Jan 8, 2023 · 2 comments · Fixed by #3006
Closed
1 task done

System locked when RTC data is broken #3005

padcom opened this issue Jan 8, 2023 · 2 comments · Fixed by #3006
Labels
bug 🪲 Something isn't working triage Bug report awaiting review / sorting

Comments

@padcom
Copy link
Contributor

padcom commented Jan 8, 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

When the RTC data is broken, the transmitter will not turn on. The bootloader starts ok. No indication of the situation of broken RTC data.

Expected Behavior

The transmitter turns on.

Steps To Reproduce

  1. Get a transmitter with broken RTC data
  2. Turn the transmitter on
  3. Observe it is locked

Version

2.8.0

Transmitter

Radiomaster TX16S / TX16SMK2

Anything else?

The problem is with __mktime_internal and its processing:

edgetx/radio/src/rtc.cpp

Lines 396 to 407 in 1bffd26

/* Repeatedly use the error to improve the guess. */
for (t = t1 = t2 = t0;
(gt = guess_time_tm(year, yday, hour, min, sec, &t, ranged_convert(convert, &t, &tm)), t != gt);
t1 = t2, t2 = t, t = gt) {
if (t == t1 && t != t2)
goto offset_found;
else if (--remaining_probes == 0)
return -1;
}
offset_found:
*offset = guessed_offset + t - t0;

With broken data this loop never finishes.

@padcom padcom added bug 🪲 Something isn't working triage Bug report awaiting review / sorting labels Jan 8, 2023
@raphaelcoeffic
Copy link
Member

We should probably add some unit tests for gmktime to test this properly with invalid values.

@padcom
Copy link
Contributor Author

padcom commented Jan 10, 2023

The idea behind this PR is to know when the problem occurs to help diagnose it - not to fix the underlying problem. It occurs rarely and at present finding out what happened is next to impossible for users without programming skills.

I presume there will be another PR, done by someone who has much deeper knowledge about the platform, that will try to address the root cause of the problem.

padcom added a commit to padcom/edgetx that referenced this issue Jan 10, 2023
pfeerick pushed a commit that referenced this issue Jan 15, 2023
* Added turning the red LED before RTC data and blue LED afterwards

With the LED turned RED if the RTC data retrieval fails it will stay red.
This will at least be an indication that the RTC startup encountered
a problem. For now there is no indication that this problem occurred.

* GH-3005 Moved LED manipulation to conditionally compiled when RTC operation happens
pfeerick pushed a commit that referenced this issue Jan 25, 2023
* Added turning the red LED before RTC data and blue LED afterwards

With the LED turned RED if the RTC data retrieval fails it will stay red.
This will at least be an indication that the RTC startup encountered
a problem. For now there is no indication that this problem occurred.

* GH-3005 Moved LED manipulation to conditionally compiled when RTC operation happens
pfeerick pushed a commit that referenced this issue May 16, 2023
Formatting.

chore(ui): Convert GVAR tab to LVGL (#2945)

fix(ui): Adjust model setup button layout to better fit portrait screen (#2956)

* Adjust model setup layout to better fix on portrait LCD screen.

* Set buttons to fixed width and allow to grow vertically to fit text.

* Cleanup layout logic - buttons stretched horizontally, centered vertically.

fix(color): Invalid custom curves + layout updates (#2973)

* Layout updates and bug fixes for curve editor.
- Fix issue 2972 where an invalid curve could be created
- Use vertical layout or list of points
- Add border to preview to better show end points
- Fix issue where preview was redrawn very frequently
- Better organisation of curve edit classes

* Fix to refresh curve preview on input edit page when parameters changed.

chore: freeRTOS task stack diagnostics (#2976)

* migrated stack diagnostics (available, free) to using built in FreeRTOS builtin function

Note: main stack must be and is treated differently as it is not under FreeRTOS control. main stack is painted by the STM32 startup routine. free main stack is calculated checking the remaining painted stack area.

* corrected my merge error

* missed a blank

fix(lua): fix drawHudRectangle for roll = 0 (#2978)

- fixed an extra line at the bottom of the hud rectangle
- fixed overflowing hud rectangle for horizon outside viewport (pitch > 0)

fix(lua): Remove faulty carryTrim, replace with trimSource (#2995)

* Fix carryTrim in LUA

* Remove carryTrim

feat(diags): Red LED before RTC data, blue LED after (#3006)

* Added turning the red LED before RTC data and blue LED afterwards

With the LED turned RED if the RTC data retrieval fails it will stay red.
This will at least be an indication that the RTC startup encountered
a problem. For now there is no indication that this problem occurred.

* GH-3005 Moved LED manipulation to conditionally compiled when RTC operation happens

fix(color): Update top bar date & time when in setup pages (#3037)

fix(translation): JP had overlapping strings due to line breaks (#3004)

fix(cpn): Translate OFF in external module setup (#2998)

* Translate OFF in external module setup

* Update moduledata.cpp

Add B/W and CP support

Init enabled to 1

delete extra file

Fix Save/Read operations

Cleanup and fix R/W

Cleanup based on review

Change the fields order to match YAML

change the fields order to match the YAML

Add headers, set new CF to enabled

Remove "ON" label from "Enabled" field.
Fix "disabled" when swicthing functions.

Set enable==1 when changing the function.

Set "enabled" if function is changed on B/W radios
philmoz pushed a commit that referenced this issue Oct 28, 2023
Formatting.

chore(ui): Convert GVAR tab to LVGL (#2945)

fix(ui): Adjust model setup button layout to better fit portrait screen (#2956)

* Adjust model setup layout to better fix on portrait LCD screen.

* Set buttons to fixed width and allow to grow vertically to fit text.

* Cleanup layout logic - buttons stretched horizontally, centered vertically.

fix(color): Invalid custom curves + layout updates (#2973)

* Layout updates and bug fixes for curve editor.
- Fix issue 2972 where an invalid curve could be created
- Use vertical layout or list of points
- Add border to preview to better show end points
- Fix issue where preview was redrawn very frequently
- Better organisation of curve edit classes

* Fix to refresh curve preview on input edit page when parameters changed.

chore: freeRTOS task stack diagnostics (#2976)

* migrated stack diagnostics (available, free) to using built in FreeRTOS builtin function

Note: main stack must be and is treated differently as it is not under FreeRTOS control. main stack is painted by the STM32 startup routine. free main stack is calculated checking the remaining painted stack area.

* corrected my merge error

* missed a blank

fix(lua): fix drawHudRectangle for roll = 0 (#2978)

- fixed an extra line at the bottom of the hud rectangle
- fixed overflowing hud rectangle for horizon outside viewport (pitch > 0)

fix(lua): Remove faulty carryTrim, replace with trimSource (#2995)

* Fix carryTrim in LUA

* Remove carryTrim

feat(diags): Red LED before RTC data, blue LED after (#3006)

* Added turning the red LED before RTC data and blue LED afterwards

With the LED turned RED if the RTC data retrieval fails it will stay red.
This will at least be an indication that the RTC startup encountered
a problem. For now there is no indication that this problem occurred.

* GH-3005 Moved LED manipulation to conditionally compiled when RTC operation happens

fix(color): Update top bar date & time when in setup pages (#3037)

fix(translation): JP had overlapping strings due to line breaks (#3004)

fix(cpn): Translate OFF in external module setup (#2998)

* Translate OFF in external module setup

* Update moduledata.cpp

Add B/W and CP support

Init enabled to 1

delete extra file

Fix Save/Read operations

Cleanup and fix R/W

Cleanup based on review

Change the fields order to match YAML

change the fields order to match the YAML

Add headers, set new CF to enabled

Remove "ON" label from "Enabled" field.
Fix "disabled" when swicthing functions.

Set enable==1 when changing the function.

Set "enabled" if function is changed on B/W radios
pfeerick pushed a commit that referenced this issue Nov 12, 2023
Formatting.

chore(ui): Convert GVAR tab to LVGL (#2945)

fix(ui): Adjust model setup button layout to better fit portrait screen (#2956)

* Adjust model setup layout to better fix on portrait LCD screen.

* Set buttons to fixed width and allow to grow vertically to fit text.

* Cleanup layout logic - buttons stretched horizontally, centered vertically.

fix(color): Invalid custom curves + layout updates (#2973)

* Layout updates and bug fixes for curve editor.
- Fix issue 2972 where an invalid curve could be created
- Use vertical layout or list of points
- Add border to preview to better show end points
- Fix issue where preview was redrawn very frequently
- Better organisation of curve edit classes

* Fix to refresh curve preview on input edit page when parameters changed.

chore: freeRTOS task stack diagnostics (#2976)

* migrated stack diagnostics (available, free) to using built in FreeRTOS builtin function

Note: main stack must be and is treated differently as it is not under FreeRTOS control. main stack is painted by the STM32 startup routine. free main stack is calculated checking the remaining painted stack area.

* corrected my merge error

* missed a blank

fix(lua): fix drawHudRectangle for roll = 0 (#2978)

- fixed an extra line at the bottom of the hud rectangle
- fixed overflowing hud rectangle for horizon outside viewport (pitch > 0)

fix(lua): Remove faulty carryTrim, replace with trimSource (#2995)

* Fix carryTrim in LUA

* Remove carryTrim

feat(diags): Red LED before RTC data, blue LED after (#3006)

* Added turning the red LED before RTC data and blue LED afterwards

With the LED turned RED if the RTC data retrieval fails it will stay red.
This will at least be an indication that the RTC startup encountered
a problem. For now there is no indication that this problem occurred.

* GH-3005 Moved LED manipulation to conditionally compiled when RTC operation happens

fix(color): Update top bar date & time when in setup pages (#3037)

fix(translation): JP had overlapping strings due to line breaks (#3004)

fix(cpn): Translate OFF in external module setup (#2998)

* Translate OFF in external module setup

* Update moduledata.cpp

Add B/W and CP support

Init enabled to 1

delete extra file

Fix Save/Read operations

Cleanup and fix R/W

Cleanup based on review

Change the fields order to match YAML

change the fields order to match the YAML

Add headers, set new CF to enabled

Remove "ON" label from "Enabled" field.
Fix "disabled" when swicthing functions.

Set enable==1 when changing the function.

Set "enabled" if function is changed on B/W radios
pfeerick pushed a commit that referenced this issue Nov 12, 2023
Formatting.

chore(ui): Convert GVAR tab to LVGL (#2945)

fix(ui): Adjust model setup button layout to better fit portrait screen (#2956)

* Adjust model setup layout to better fix on portrait LCD screen.

* Set buttons to fixed width and allow to grow vertically to fit text.

* Cleanup layout logic - buttons stretched horizontally, centered vertically.

fix(color): Invalid custom curves + layout updates (#2973)

* Layout updates and bug fixes for curve editor.
- Fix issue 2972 where an invalid curve could be created
- Use vertical layout or list of points
- Add border to preview to better show end points
- Fix issue where preview was redrawn very frequently
- Better organisation of curve edit classes

* Fix to refresh curve preview on input edit page when parameters changed.

chore: freeRTOS task stack diagnostics (#2976)

* migrated stack diagnostics (available, free) to using built in FreeRTOS builtin function

Note: main stack must be and is treated differently as it is not under FreeRTOS control. main stack is painted by the STM32 startup routine. free main stack is calculated checking the remaining painted stack area.

* corrected my merge error

* missed a blank

fix(lua): fix drawHudRectangle for roll = 0 (#2978)

- fixed an extra line at the bottom of the hud rectangle
- fixed overflowing hud rectangle for horizon outside viewport (pitch > 0)

fix(lua): Remove faulty carryTrim, replace with trimSource (#2995)

* Fix carryTrim in LUA

* Remove carryTrim

feat(diags): Red LED before RTC data, blue LED after (#3006)

* Added turning the red LED before RTC data and blue LED afterwards

With the LED turned RED if the RTC data retrieval fails it will stay red.
This will at least be an indication that the RTC startup encountered
a problem. For now there is no indication that this problem occurred.

* GH-3005 Moved LED manipulation to conditionally compiled when RTC operation happens

fix(color): Update top bar date & time when in setup pages (#3037)

fix(translation): JP had overlapping strings due to line breaks (#3004)

fix(cpn): Translate OFF in external module setup (#2998)

* Translate OFF in external module setup

* Update moduledata.cpp

Add B/W and CP support

Init enabled to 1

delete extra file

Fix Save/Read operations

Cleanup and fix R/W

Cleanup based on review

Change the fields order to match YAML

change the fields order to match the YAML

Add headers, set new CF to enabled

Remove "ON" label from "Enabled" field.
Fix "disabled" when swicthing functions.

Set enable==1 when changing the function.

Set "enabled" if function is changed on B/W radios
pfeerick pushed a commit that referenced this issue Nov 27, 2023
Formatting.

chore(ui): Convert GVAR tab to LVGL (#2945)

fix(ui): Adjust model setup button layout to better fit portrait screen (#2956)

* Adjust model setup layout to better fix on portrait LCD screen.

* Set buttons to fixed width and allow to grow vertically to fit text.

* Cleanup layout logic - buttons stretched horizontally, centered vertically.

fix(color): Invalid custom curves + layout updates (#2973)

* Layout updates and bug fixes for curve editor.
- Fix issue 2972 where an invalid curve could be created
- Use vertical layout or list of points
- Add border to preview to better show end points
- Fix issue where preview was redrawn very frequently
- Better organisation of curve edit classes

* Fix to refresh curve preview on input edit page when parameters changed.

chore: freeRTOS task stack diagnostics (#2976)

* migrated stack diagnostics (available, free) to using built in FreeRTOS builtin function

Note: main stack must be and is treated differently as it is not under FreeRTOS control. main stack is painted by the STM32 startup routine. free main stack is calculated checking the remaining painted stack area.

* corrected my merge error

* missed a blank

fix(lua): fix drawHudRectangle for roll = 0 (#2978)

- fixed an extra line at the bottom of the hud rectangle
- fixed overflowing hud rectangle for horizon outside viewport (pitch > 0)

fix(lua): Remove faulty carryTrim, replace with trimSource (#2995)

* Fix carryTrim in LUA

* Remove carryTrim

feat(diags): Red LED before RTC data, blue LED after (#3006)

* Added turning the red LED before RTC data and blue LED afterwards

With the LED turned RED if the RTC data retrieval fails it will stay red.
This will at least be an indication that the RTC startup encountered
a problem. For now there is no indication that this problem occurred.

* GH-3005 Moved LED manipulation to conditionally compiled when RTC operation happens

fix(color): Update top bar date & time when in setup pages (#3037)

fix(translation): JP had overlapping strings due to line breaks (#3004)

fix(cpn): Translate OFF in external module setup (#2998)

* Translate OFF in external module setup

* Update moduledata.cpp

Add B/W and CP support

Init enabled to 1

delete extra file

Fix Save/Read operations

Cleanup and fix R/W

Cleanup based on review

Change the fields order to match YAML

change the fields order to match the YAML

Add headers, set new CF to enabled

Remove "ON" label from "Enabled" field.
Fix "disabled" when swicthing functions.

Set enable==1 when changing the function.

Set "enabled" if function is changed on B/W radios
pfeerick pushed a commit that referenced this issue Dec 3, 2023
Formatting.

chore(ui): Convert GVAR tab to LVGL (#2945)

fix(ui): Adjust model setup button layout to better fit portrait screen (#2956)

* Adjust model setup layout to better fix on portrait LCD screen.

* Set buttons to fixed width and allow to grow vertically to fit text.

* Cleanup layout logic - buttons stretched horizontally, centered vertically.

fix(color): Invalid custom curves + layout updates (#2973)

* Layout updates and bug fixes for curve editor.
- Fix issue 2972 where an invalid curve could be created
- Use vertical layout or list of points
- Add border to preview to better show end points
- Fix issue where preview was redrawn very frequently
- Better organisation of curve edit classes

* Fix to refresh curve preview on input edit page when parameters changed.

chore: freeRTOS task stack diagnostics (#2976)

* migrated stack diagnostics (available, free) to using built in FreeRTOS builtin function

Note: main stack must be and is treated differently as it is not under FreeRTOS control. main stack is painted by the STM32 startup routine. free main stack is calculated checking the remaining painted stack area.

* corrected my merge error

* missed a blank

fix(lua): fix drawHudRectangle for roll = 0 (#2978)

- fixed an extra line at the bottom of the hud rectangle
- fixed overflowing hud rectangle for horizon outside viewport (pitch > 0)

fix(lua): Remove faulty carryTrim, replace with trimSource (#2995)

* Fix carryTrim in LUA

* Remove carryTrim

feat(diags): Red LED before RTC data, blue LED after (#3006)

* Added turning the red LED before RTC data and blue LED afterwards

With the LED turned RED if the RTC data retrieval fails it will stay red.
This will at least be an indication that the RTC startup encountered
a problem. For now there is no indication that this problem occurred.

* GH-3005 Moved LED manipulation to conditionally compiled when RTC operation happens

fix(color): Update top bar date & time when in setup pages (#3037)

fix(translation): JP had overlapping strings due to line breaks (#3004)

fix(cpn): Translate OFF in external module setup (#2998)

* Translate OFF in external module setup

* Update moduledata.cpp

Add B/W and CP support

Init enabled to 1

delete extra file

Fix Save/Read operations

Cleanup and fix R/W

Cleanup based on review

Change the fields order to match YAML

change the fields order to match the YAML

Add headers, set new CF to enabled

Remove "ON" label from "Enabled" field.
Fix "disabled" when swicthing functions.

Set enable==1 when changing the function.

Set "enabled" if function is changed on B/W radios
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

Successfully merging a pull request may close this issue.

2 participants