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

Can't flash firmware #1

Open
splinedrive opened this issue Feb 15, 2022 · 2 comments
Open

Can't flash firmware #1

splinedrive opened this issue Feb 15, 2022 · 2 comments

Comments

@splinedrive
Copy link

Hi,

I can only flash the example-fw-flash.v! When I build a firmware with make flash I can't flash it! Do you know why?
Also make brom will not fit: /opt/riscv32i/lib/gcc/riscv32-unknown-elf/11.1.0/../../../../riscv32-unknown-elf/bin/ld: region `BROM' overflowed by 1296 bytes

make -C fw/fw-flash
make[1]: Entering directory '/home/hd/tmp/TangNano-9K-example/picotiny/fw/fw-flash'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/hd/tmp/TangNano-9K-example/picotiny/fw/fw-flash'
python sw/pico-programmer.py fw/fw-flash/build/fw-flash.v /dev/ttyUSB4
Read program with 8912 bytes

  • Waiting for reset -
    ...
    Total sectors 3
    Total pages 35
    Flashing 1 / 3
    Flashing 2 / 3
    Flashing 3 / 3
    Too many retires on sending data to page buffer
    Flashing failed
@jmthompson
Copy link

Looks like the issue is with the way the loop is written in the isp_exec_wbuf method. If the checksum is legitimately 0x00 the second while loop will terminate immediately without waiting for write confirmation, falling through to the end of the function and returning False.

@nekomona
Copy link
Collaborator

BROM overflow is due to a compiler flag problem where my old gcc produce reasonably small code with -O3 while later gcc produce large code with -O3 and small code with -O2. Using -O2 in current gcc generate ispflasher firmware for about 1.4KB code which could fit in the BROM.

Flash failing is, as said, due to an ancient, ancient, buggy python code 😿

Both issue should have been solved in #5

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