You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We recently implemented persistent data storage on Powered Up hubs in pybricks/pybricks-micropython#112.
The following non-critical tasks were deferred to this issue to improve at a later date.
Describe the solution you'd like
Consider yielding the (otherwise blocking) block device store protothread between erases/writes. Although writing the maximum size takes only about 50--100 ms, so we could just leave it. It may be needed when we use more pages, see below.
In pybricks/pybricks-micropython@5e3fada, I have opted to delete the whole user space instead of only the pages needed. This simplifies the checksum computation because we can assume that everything after the new data is going to be 0xFFFFFFFF.
But a page delete takes about 20--30ms, so we could speed things up for smaller programs by asking the flash driver how many pages/bytes it did (not) erase, so we can take that into account with the checksum.
Activity
bricks/move_hub: Increase stack size.
laurensvalk commentedon Aug 30, 2022
In pybricks/pybricks-micropython@5e3fada, I have opted to delete the whole user space instead of only the pages needed. This simplifies the checksum computation because we can assume that everything after the new data is going to be
0xFFFFFFFF.But a page delete takes about 20--30ms, so we could speed things up for smaller programs by asking the flash driver how many pages/bytes it did (not) erase, so we can take that into account with the checksum.