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

MicroPython fs-builder: Incorrect generation of a full chunk. #4

Closed
microbit-carlos opened this issue Feb 14, 2019 · 1 comment
Closed
Assignees
Labels

Comments

@microbit-carlos
Copy link
Collaborator

microbit-carlos commented Feb 14, 2019

Creating a file that takes exactly 1 chunk (128 Bytes) doesn't generate the right hex content:

Code to create the file (Chunk has 1 Byte marker, 1 Byte ail, 1 Byte offset, 1 Byte file name length, 13 Bytes file name, 111 Bytes of data):

microbitFs.write(
    'a.py',
    'a = """abcdefghijklmnopqrstuvwxyz\n' +
        'abcdefghijklmnopqrstuvwxyz\n' +
        'abcdefghijklmnopqrstuvwxyz\n' +
        'abcdefghijklmnopqrstuvwxyz\n' +
        'a"""\n'
);

Generates 1 chunk:

:108D0000FE0004612E707961203D202222226162E2
:108D1000636465666768696A6B6C6D6E6F707172AB
:108D2000737475767778797A0A61626364656667C9
:108D300068696A6B6C6D6E6F70717273747576773B
:108D400078797A0A6162636465666768696A6B6CE0
:108D50006D6E6F707172737475767778797A0A6157
:108D600062636465666768696A6B6C6D6E6F70716B
:108D700072737475767778797A0A612222220AFFF3

MicroPython generates 2 chunks (second one is empty):

:10CA0000FE0004612E707961203D202222226162A5
:10CA1000636465666768696A6B6C6D6E6F7071726E
:10CA2000737475767778797A0A616263646566678C
:10CA300068696A6B6C6D6E6F7071727374757677FE
:10CA400078797A0A6162636465666768696A6B6CA3
:10CA50006D6E6F707172737475767778797A0A611A
:10CA600062636465666768696A6B6C6D6E6F70712E
:10CA700072737475767778797A0A612222220A7E37
:10CA80007DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF38
:10CA9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA6
:10CAA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF96
:10CAB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF86
:10CAC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF76
:10CAD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF66
:10CAE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56
:10CAF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF46
@microbit-carlos
Copy link
Collaborator Author

Implemented in 6aa7034.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants