Open DeflateAwning opened 8 months ago
Wondering how to write MPI firmware bytes to a specific location in a file in the filesystem.
Looking at the lfs
functions, the write and seek functions zero-pad if the requested position is beyond the current file size.
Would this be sensible?
For every page,
lfs_file_open
for appendinglfs_file_seek
to the target addresslfs_file_write
the transmitted byteslfs_file_close
, and, possibly lfs_file_sync
Prior to flashing to the MPI, lfs_file_truncate
to the target file size (rather than doing this for each page). Or do this first, in which case the first telecommand would be for target address 0.
Totally out of curiousity, did your work-in-progress solution read the response from the MPI after each page/chunk was transmitted, or did it just "fire-hose" data towards the MPI?
I'm reading the text response each time. Eventually we should just check for a hash response. This so far is between the terminal and the dev kit, no MPI.
I've gotten writing to memory working, sort of. The first page gets written, then the dev kit hangs on the second one. LFS writing is very slow. Needs troubleshooting.
Good insight! I'll investigate the LFS speed issue (I've noticed it too); just created Issue #57 to track the progress of the LFS performance assessment and improvements.
Telecommand 1: uplink chunk of new MPI firmware
Function must write the incoming data to the "arg 2" byte address in a file in the filesystem.
Telecommand 2: check hash of new MPI firmware
Telecommand 3: flash MPI with a specific MPI firmware file
This telecommand must also verify the hash before flashing.