TinyFPGA-BX Won't Program Anymore


I just did this on Windows are got:

PS C:\Users\lawri> python __main__.py -m
“boardmeta”: {
“name”: “TinyFPGA BX”,
“fpga”: “ice40lp8k-cm81”,
“hver”: “1.0.0”,
“uuid”: “5e205407-2f6d-4a7a-b7df-1b1d2286fa8d”
“bootmeta”: {
“bootloader”: “TinyFPGA USB Bootloader”,
“bver”: “1.0.1”,
“update”: “https://tinyfpga.com/update/tinyfpga-bx”,
“addrmap”: {
“bootloader”: “0x000a0-0x28000”,
“userimage”: “0x28000-0x50000”,
“userdata”: “0x50000-0x100000”
“port”: “COM5”

I then added “+ [0]” to the meta_roots and got:

PS C:\Users\lawri> python __main__.py -m
Traceback (most recent call last):
File “main.py”, line 417, in
File “main.py”, line 259, in main
m[“port”] = str(port)
TypeError: ‘int’ object does not support item assignment


python __main__.py -l

TinyProg CLI
Using device id 1d50:6130
Only one board with active bootloader, using it.
Boards with active bootloaders:

    COM5: No metadata


Hi Lawrie,

Thanks for your help.
I was able to run the script with the new “-z” function that you have added.
The result is this: (I don’t have “od” installed)


Then, I have commented the line 170 of the init.py.
However, the result is exactly the same when I try to program the FPGA.


Would it be possible to modify the lines 179, 182 and 185, and write there the data that the script was supposed to read correctly?


That confirms you still have the metadata in security pages, as I thought.

You may not be using the init.py that you edited - I hit that problem. Put a print statement in it to make sure you are getting the edited version. Python picks up the system version of tinyprog not the one in the current directory. To fix that, I put __init__.py in a tinyprog directory below __main__.py and then it finds the edited version.


Yes, you could do that and avoid using the metadata at all, but I am still convinced the problem is what I said it was, until I get evidence to the contrary.


Your hypothesis that I was running a different file than the one that I was editing was correct!
Now it returns other errors in lines 182 and 188.
“TypeError: ‘NoneType’ object is not subscriptable”


Actually I have done a mistake, and have commented the 2 lines 169 and 170.
Commenting only the 170 it works perfectly!


Thank you very much Lawrie!
I was stuck with this for a few days and your help was very useful!
Finally I managed to program again the TinyFPGA-BX!
Have a nice day.


I suspect that code on line 170 is incorrect. I could not work out what it was doing when I first saw it. I suspected it was trying to find the last page on flash memory for different flash memory sizes. But it might just be wrong and if it accidentally finds a page with non-zero data, it can cause the problem.