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

GDI4: configuration persistence is flaky #212

Closed
rusefillc opened this issue Jun 27, 2023 · 7 comments
Closed

GDI4: configuration persistence is flaky #212

rusefillc opened this issue Jun 27, 2023 · 7 comments

Comments

@rusefillc
Copy link
Contributor

See 97b1435

I have configuration update counter logged into UART console

at the moment rusEFI requests calibration modifications via CAN bus and I see counter going up

problem: on "reset" too often I see values roll back to previous configuration in 80% of the cases

8000 10 HAPPY
here 10 is configuration version.

@rusefillc
Copy link
Contributor Author

rusefillc commented Jun 27, 2023

shit I have GD32F103CBT6 C77979 chip

https://lists.gnupg.org/pipermail/gnuk-users/2018-March/000021.html

  1. Because the property of the underlying flash technology by GigaDevice,
    the first 32 KiB of the flash is zero-wait for reading, but the writing and
    erasing of the chip is significantly much more longer than STM32, as a
    result, the programming software needs some modifications.

The official application notes recommends:

i)  increase the erase timeout per page to 300ms,
    increase the mass erase timeout to 3s.

ii) increase the program time per word to 2ms,
    increase the program time per page to 300ms.

tried with
#define STM32_FLASH_WAIT_TIME_MS 300

but that did not help

@rusefillc
Copy link
Contributor Author

@rusefillc
Copy link
Contributor Author

rusefillc commented Jun 27, 2023

test project works same good on both stm32 and GD32 - now I am confused, that must be some silly error specifically in GDI4 firmware?

rusefi/rusefi@47d9642
rusefi/rusefi@19e032f

@rusefillc
Copy link
Contributor Author

@dron0gus actually NO, looks like different behavior between stm32 and GD32. Do you have GDf103 and stm32f103 handy?

@rusefillc
Copy link
Contributor Author

@dron0gus actually I got even stm32 to not behave as I expect - just much much less often

expected behavior: UART shows incrementing counter, counter is persisted with reset/power cycle

actual behavior: stm32 would rarely reset counter to zero, gd32 would often reset to zero. neither chip gives me reliable persistent counter

@rusefillc
Copy link
Contributor Author

stm32


0.000   writes=1077     reboots=317

0.000   writes=1078     reboots=317

0.000   writes=1079     reboots=317

0.000   writes=1080     reboots=317

0.000   writes=1081     reboots=317

0.000   writes=1082     reboots=317

0.000   writes=1083     reboots=317

@rusefillc
Copy link
Contributor Author

gd32


0.000   writes=2        reboots=0

0.000   writes=3        reboots=0

▒0.001  writes=0        reboots=0

▒0.001  writes=0        reboots=0

0.000   writes=1        reboots=0

▒0.001  writes=0        reboots=0

▒0.001  writes=0        reboots=0

▒0.001  writes=0        reboots=0

0.000   writes=1        reboots=0

0.000   writes=2        reboots=0

0.000   writes=3        reboots=0

0.000   writes=4        reboots=0

rusefillc added a commit to rusefi/rusefi that referenced this issue Jun 28, 2023
rusefillc added a commit to rusefi/rusefi that referenced this issue Jun 28, 2023
rusefillc pushed a commit to rusefi/rusefi that referenced this issue Jun 28, 2023
rusefillc pushed a commit to rusefi/rusefi that referenced this issue Jun 28, 2023
rusefillc pushed a commit to rusefi/rusefi that referenced this issue Jun 28, 2023
rusefillc pushed a commit to rusefi/rusefi that referenced this issue Jun 28, 2023
rusefillc pushed a commit to rusefi/rusefi that referenced this issue Jun 28, 2023
simpler code comment
rusefillc pushed a commit to rusefi/rusefi that referenced this issue Jun 28, 2023
we use master here
rusefillc pushed a commit to rusefi/rusefi that referenced this issue Jun 28, 2023
rusefillc pushed a commit to rusefi/rusefi that referenced this issue Jun 28, 2023
simpler code comment
rusefillc pushed a commit to rusefi/rusefi that referenced this issue Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant