-
Notifications
You must be signed in to change notification settings - Fork 0
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
Simplify EEPROM implementation #1
Comments
Other approaches, thinking out loud:
|
Today's intended storage layout is
During our in-person discussion, we looked at an example of an app- / device-specific configuration that would be persisted. Let me know if this is the wrong structure. I'm realizing something I missed during our in-person: Although rust-analyzer suggests that the size of @dstric-aqueduct, do we have an upper-bound on the size of those strings, and do we know how they're serialized before they're written to flash? If we take this approach, I want to make sure we can fit within 580 bytes for device-specific data. |
This is correct - any
Whoops, missed this too - let's allocate 32 bytes to this field (same for other |
Sounds great, thanks!
If I actually replace With today's code, we should be able to stay under 1080 byte capacity for emulated EEPROM. |
I rebased the prototype from mciantyre/teensy4-rs#100 onto the You're right; the 4.0 and 4.1 have different persistence behaviors with this example. It seems that the 4.1 loses whatever is persisted once it's reprogrammed, whereas the 4.0 maintains that data. I never noticed the persistence loss during reprogramming until now. I'm using the command-line loader like this:
Here's the testing table.
"Data persists after power loss": after the "Data persists after reprogramming": after the Are these results consistent with your testing? |
Yep, same behavior I see...hmm |
This behavior may be expected. From the HalfKay communication protocol documentation,
(Assuming "all blocks" excludes those blocks used for storage.) If HalfKay knows that it's running on a Teensy 4.1, it would erase the blocks we're using for storage. Those same blocks are reserved for storage on the Teensy 4.0. This could explain why the Teensy 4.0 keeps its data while the 4.1 loses the same information (at the same absolute address). Just to double-check: Do we need to persist data after reprogramming? If we're already in communication with the device for the programming step, we could use a process like (1) read the value out of storage, (2) program the storage, (3) re-write the value to storage. Otherwise, looks like specializing the EEPROM driver / runtime for the Teensy 4.1 may be necessary. But before that, I'll make sure that placing the Teensy 4.1 storage address to the expected location fixes the reprogramming behavior. |
Wow...that looks like the issue.
No, no need to persist data during reprogramming, just power cycles. (fixed to read power cycles) |
With 7db6602 in place, programming then re-programming a Teensy 4.1 with the
Perfect. As long as we only need persistence during power cycles, we should be able to move forward with the EEPROM module as-is. Tomorrow, I'll double-check my test, making sure that the ✅ column remains checked, and I'll document the test procol. If that goes well, I'll simplify the EEPROM integration in this repo. |
Perfect - how does another 10AM meeting work for you? I can do earlier or later if another time is better... |
10AM works for me. I sent a calendar invite yesterday, but let me know if it wasn't received. Happy to reschedule anytime before 330pm. |
My rebase was based on an incorrect guess regarding this fork's origin. This repo appears to be based on commit |
mciantyre/teensy4-rs#86 notes that
teensy4-bsp
does not support the larger flash available on the Teensy 4.1. The emulated EEPROM prototype in mciantyre/teensy4-rs#100 includes this assumption: the EEPROM prototype exposes 1080 bytes of EEPROM, the max available on a Teensy 4.0.We could change mciantyre/teensy4-rs#86. But, adding dedicated support for both the Teensy 4.0 and 4.1 boards is tricky to get right. We should take this route if we really need more than 1080 bytes of storage capacity.
On the other hand, if we can stay under 1080 bytes of capacity, we shouldn't need to change anything from the mciantyre/teensy4-rs#100 prototype. This issue tracks this idea. If realized, we can simplify the EEPROM implementation proposed in this repo. But, going forward, we'll need to keep the emulated EEPROM utilization to under 1080 bytes.
The text was updated successfully, but these errors were encountered: