Skip to content

Programming TinyFPGA BX with userdata of size exactly 1244 bytes fails #23

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

Closed
matt-kimball opened this issue Sep 16, 2018 · 2 comments
Closed

Comments

@matt-kimball
Copy link

matt-kimball commented Sep 16, 2018

When I attempt to program with a PicoSoC hardware and a firmware of size exactly equal to 1244, the programming step fails when reading back the user data:

    TinyProg CLI
    ------------
    Using device id 1d50:6130
    Only one board with active bootloader, using it.
    Programming /dev/ttyACM0 with /tmp/hardware.bin
    Programming at addr 028000   
    Waking up SPI flash
    135100 bytes to program
    Erasing: 100%|████████████████████████████| 135k/135k [00:01<00:00, 112kB/s]
    Writing: 100%|███████████████████████████| 135k/135k [00:02<00:00, 62.3kB/s]
    Reading: 100%|████████████████████████████| 135k/135k [00:01<00:00, 111kB/s]
    Success!
    Programming /dev/ttyACM0 with ./firmware.1244.bin
    Programming at addr 050000   
    Waking up SPI flash
    1244 bytes to program
    Erasing: 100%|█████████████████████████| 1.24k/1.24k [00:00<00:00, 11.5kB/s]
    Writing: 100%|█████████████████████████| 1.24k/1.24k [00:00<00:00, 39.2kB/s]
    Reading: 100%|█████████████████████████| 1.24k/1.24k [00:01<00:00, 1.23kB/s]
    Failure!

Programming with firmware size of 1240 succeeds, and programming with firmware size of 1248 also succeeds. And yet, size 1244 fails. The firmware contents don't seem to matter -- a file generated with dd to have this specific size also fails:

dd if=/dev/zero of=firmware.1244.bin bs=1244 count=1

I am running tinyprog on my Raspberry Pi, running Raspbian.

@mithro
Copy link
Collaborator

mithro commented Jul 6, 2019

@ewenmcneill - I believe this has been fixed with your changes right?

@mithro mithro closed this as completed Jul 6, 2019
@ewenmcneill
Copy link
Contributor

@ewenmcneill - I believe this has been fixed with your changes right?

I haven't tested with a 1244 byte firmware file, but yes since 1244 = 4 * 256 + 220, which #52 would expand out to 5 * 256 (with 0xff fill at the end) it will hopefully now work.

Ewen

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

3 participants