-
Notifications
You must be signed in to change notification settings - Fork 29
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
icezprog flakey with Pi zero-W connected to icezero #3
Comments
Same here, but on a PiZ, not PiZ-W. It used to work reliably with a few simple tests. I did an apt update/upgrade of Raspbian today, and now it fails to upload most of the time (not sure there's a causal relation), although the upload does eventually succeed:
Update - working fine again, no changes to icezprog. Maybe there was some background activity while the above happened, hard to tell afterwards. |
Same issue on PiZ W but replace 3 x uwait_barrier_sync(25); in spi_xfer works for me too. |
I believe the issue is caused by the -Os flag to gcc From icotools/examples/icezero/Makefile
Compile instead with: This produces a stable and reliable icezprog for me instead of the string of read errors I used to get. |
I ran into the same issue with an Raspberry Pi Zero W, but removing the -Os flag didn't solve it for me. Changing the uwait_barrier_sync() to ~40 seems to work, but makes the process a bit slow. I dug around in the code a bit, and added some delays to the spi_begin()/end() while removing the delay in the spi_xfer(). I also moved the digitalRead to the high-edge of CLK. Both things seem to help pretty well, so now it actually flashes significantly faster & without readback errors. Code is currently forked here: https://github.com/thekroko/icotools |
Note that without |
Python programming routine works reliably. However, I get some programming errors with icezprog.c unless delays in ...
uint32_t spi_xfer(uint32_t data, int nbits)
... are increased.
This works for me ...
uwait_barrier_sync(25);
Some of the time! Still unreliable sometimes so not sure this is the problem!
Device is a Micron N25Q128A
The text was updated successfully, but these errors were encountered: