External Flash lose files



  • @tuftec it's here: https://github.com/robert-hh/Shared-Stuff.git
    Changes to the recent Dev version:

    • use lfs 2.3 with block level wear-leveling enabled
    • support UART inverted mode
    • enforce guard time for the RGB LED
    • some minor tweaks, which may not apply for FiPy

    In addition, the frozen modules contain the upysh module (see: https://github.com/micropython/micropython-lib/tree/master/upysh) and the onboard editor pye (see: https://github.com/robert-hh/Micropython-Editor)

    Edit: LFS2.3 clears all files. So save them beforehand.



  • No Pybytes and FiPy.
    Thanks



  • @tuftec For which board. And do you needPyBytes support?



  • Hi Guys, Thanks for that. Some really good insight.
    I do not have experience in re-building Pycom.
    Has anyone built a very recent version 1.20.2.r3 or later that has the enhanced lfs in it. Last time I tried to use lfs, it didn't work very well for me.

    Peter.



  • @robert-hh

    Ok, Tks Robert, I will try that.

    Best Regards,



  • @serafimsaudade @Lourenço-Frade Going through the various versions of lfs, it might be worth to update to the actual version 2.3. Pycom uses 2.0.3, as it seems. There were some bug fixes between 2.0.3 and 2.3, even in the wear leveling mechanism. The upgrade is easy: just replace the lfs.* and lfsutil.* files. The firmware build properly. In one case test the old file system was not readable any more. So that may have to checked more deeply.



  • @Lourenço-Frade Sorry, I hardly know anything about the mechanisms and implementation of lfs. But the in their repository is a SPEC.md document with a lot of explanations. See: https://github.com/littlefs-project/littlefs.git

    But I made at least two tests:

    1. I have set the block_cycle value to 100 and did ~2000 single file writes (create a file "logfile", write 2k, close it). So the number of files is constant. Then I looked at the number of free blocks before and after the test. This number did not change. So the block wear leveling for the superblocks does no affect the free space.
    2. I repeated that test with debug messages enable on block erase and block prog. Each file write causes two erase/prog calls. The first to a block with an increasing number, which is for the data. And the second to an alternating pair of block numbers. These are the superblocks with directory entries. Every 100 calls, one member of this pair changes. That's what was expected because block cycle was set to 100. But then there was also a erase/prog pair to blocks 0 and 1, alternating every 100 file writes. So it looks like a single step indirection, in that
    • blocks 0 and 1 are still used, but 'block_cycle' times more rarely.
    • blocks 0 and 1 point to the 'active' superblocks, which are changes after having been used 'block_cycle' time. These blocks are then considered as free for reuse. And being used e.g. only 1000 times, this creates no additional risk.

    Given these observations, a good value for block_cycle would be about the number of blocks in the file system. For WiPy3 that is 1024. So 1000 is a good value. And the wear out number for blocks 0 and 1 would be increased by a factor of 1000.
    In your case of writing every minute that would be a guaranteed time of 190 years. That should be long enough.

    Edit: Below is a small section of the logfile for test 2.

    --Erase 746  ++Prog 746  --Erase 646  ++Prog 646
    --Erase 747  ++Prog 747  --Erase 544  ++Prog 544
    --Erase 748  ++Prog 748  --Erase 646  ++Prog 646
    --Erase 749  ++Prog 749  --Erase 544  ++Prog 544
    --Erase 750  ++Prog 750  --Erase 646  ++Prog 646
    --Erase 751  ++Prog 751  --Erase 544  ++Prog 544
    --Erase 752  ++Prog 752  --Erase 646  ++Prog 646
    --Erase 753  ++Prog 753  --Erase 754  ++Prog 754  --Erase 0  ++Prog 0
    --Erase 755  ++Prog 755  --Erase 646  ++Prog 646
    --Erase 756  ++Prog 756  --Erase 754  ++Prog 754
    --Erase 757  ++Prog 757  --Erase 646  ++Prog 646
    --Erase 758  ++Prog 758  --Erase 754  ++Prog 754
    --Erase 759  ++Prog 759  --Erase 646  ++Prog 646
    --Erase 760  ++Prog 760  --Erase 754  ++Prog 754
    --Erase 761  ++Prog 761  --Erase 646  ++Prog 646
    --Erase 762  ++Prog 762  --Erase 754  ++Prog 754
    --Erase 763  ++Prog 763  --Erase 646  ++Prog 646
    --Erase 764  ++Prog 764  --Erase 754  ++Prog 754
    --Erase 765  ++Prog 765  --Erase 646  ++Prog 646
    --Erase 766  ++Prog 766  --Erase 754  ++Prog 754
    --Erase 767  ++Prog 767  --Erase 646  ++Prog 646
    --Erase 768  ++Prog 768  --Erase 754  ++Prog 754
    --Erase 769  ++Prog 769  --Erase 646  ++Prog 646
    --Erase 770  ++Prog 770  --Erase 754  ++Prog 754
    --Erase 771  ++Prog 771  --Erase 646  ++Prog 646
    --Erase 772  ++Prog 772  --Erase 754  ++Prog 754
    --Erase 773  ++Prog 773  --Erase 646  ++Prog 646
    --Erase 774  ++Prog 774  --Erase 754  ++Prog 754
    --Erase 775  ++Prog 775  --Erase 646  ++Prog 646
    --Erase 776  ++Prog 776  --Erase 754  ++Prog 754
    --Erase 777  ++Prog 777  --Erase 646  ++Prog 646
    --Erase 778  ++Prog 778  --Erase 754  ++Prog 754
    --Erase 779  ++Prog 779  --Erase 646  ++Prog 646
    --Erase 780  ++Prog 780  --Erase 754  ++Prog 754
    --Erase 781  ++Prog 781  --Erase 646  ++Prog 646
    --Erase 782  ++Prog 782  --Erase 754  ++Prog 754
    --Erase 783  ++Prog 783  --Erase 646  ++Prog 646
    --Erase 784  ++Prog 784  --Erase 754  ++Prog 754
    --Erase 785  ++Prog 785  --Erase 646  ++Prog 646
    --Erase 786  ++Prog 786  --Erase 754  ++Prog 754
    --Erase 787  ++Prog 787  --Erase 646  ++Prog 646
    --Erase 788  ++Prog 788  --Erase 754  ++Prog 754
    --Erase 789  ++Prog 789  --Erase 646  ++Prog 646
    --Erase 790  ++Prog 790  --Erase 754  ++Prog 754
    --Erase 791  ++Prog 791  --Erase 646  ++Prog 646
    --Erase 792  ++Prog 792  --Erase 754  ++Prog 754
    --Erase 793  ++Prog 793  --Erase 646  ++Prog 646
    --Erase 794  ++Prog 794  --Erase 754  ++Prog 754
    --Erase 795  ++Prog 795  --Erase 646  ++Prog 646
    --Erase 796  ++Prog 796  --Erase 754  ++Prog 754
    --Erase 797  ++Prog 797  --Erase 646  ++Prog 646
    --Erase 798  ++Prog 798  --Erase 754  ++Prog 754
    --Erase 799  ++Prog 799  --Erase 646  ++Prog 646
    --Erase 800  ++Prog 800  --Erase 754  ++Prog 754
    --Erase 801  ++Prog 801  --Erase 646  ++Prog 646
    --Erase 802  ++Prog 802  --Erase 754  ++Prog 754
    --Erase 803  ++Prog 803  --Erase 646  ++Prog 646
    --Erase 804  ++Prog 804  --Erase 754  ++Prog 754
    --Erase 805  ++Prog 805  --Erase 646  ++Prog 646
    --Erase 806  ++Prog 806  --Erase 754  ++Prog 754
    --Erase 807  ++Prog 807  --Erase 646  ++Prog 646
    --Erase 808  ++Prog 808  --Erase 754  ++Prog 754
    --Erase 809  ++Prog 809  --Erase 646  ++Prog 646
    --Erase 810  ++Prog 810  --Erase 754  ++Prog 754
    --Erase 811  ++Prog 811  --Erase 646  ++Prog 646
    --Erase 812  ++Prog 812  --Erase 754  ++Prog 754
    --Erase 813  ++Prog 813  --Erase 646  ++Prog 646
    --Erase 814  ++Prog 814  --Erase 754  ++Prog 754
    --Erase 815  ++Prog 815  --Erase 646  ++Prog 646
    --Erase 816  ++Prog 816  --Erase 754  ++Prog 754
    --Erase 817  ++Prog 817  --Erase 646  ++Prog 646
    --Erase 818  ++Prog 818  --Erase 754  ++Prog 754
    --Erase 819  ++Prog 819  --Erase 646  ++Prog 646
    --Erase 820  ++Prog 820  --Erase 754  ++Prog 754
    --Erase 821  ++Prog 821  --Erase 646  ++Prog 646
    --Erase 822  ++Prog 822  --Erase 754  ++Prog 754
    --Erase 823  ++Prog 823  --Erase 646  ++Prog 646
    --Erase 824  ++Prog 824  --Erase 754  ++Prog 754
    --Erase 825  ++Prog 825  --Erase 646  ++Prog 646
    --Erase 826  ++Prog 826  --Erase 754  ++Prog 754
    --Erase 827  ++Prog 827  --Erase 646  ++Prog 646
    --Erase 828  ++Prog 828  --Erase 754  ++Prog 754
    --Erase 829  ++Prog 829  --Erase 646  ++Prog 646
    --Erase 830  ++Prog 830  --Erase 754  ++Prog 754
    --Erase 831  ++Prog 831  --Erase 646  ++Prog 646
    --Erase 832  ++Prog 832  --Erase 754  ++Prog 754
    --Erase 833  ++Prog 833  --Erase 646  ++Prog 646
    --Erase 834  ++Prog 834  --Erase 754  ++Prog 754
    --Erase 835  ++Prog 835  --Erase 646  ++Prog 646
    --Erase 836  ++Prog 836  --Erase 754  ++Prog 754
    --Erase 837  ++Prog 837  --Erase 646  ++Prog 646
    --Erase 838  ++Prog 838  --Erase 754  ++Prog 754
    --Erase 839  ++Prog 839  --Erase 646  ++Prog 646
    --Erase 840  ++Prog 840  --Erase 754  ++Prog 754
    --Erase 841  ++Prog 841  --Erase 646  ++Prog 646
    --Erase 842  ++Prog 842  --Erase 754  ++Prog 754
    --Erase 843  ++Prog 843  --Erase 646  ++Prog 646
    --Erase 844  ++Prog 844  --Erase 754  ++Prog 754
    --Erase 845  ++Prog 845  --Erase 646  ++Prog 646
    --Erase 846  ++Prog 846  --Erase 754  ++Prog 754
    --Erase 847  ++Prog 847  --Erase 646  ++Prog 646
    --Erase 848  ++Prog 848  --Erase 754  ++Prog 754
    --Erase 849  ++Prog 849  --Erase 646  ++Prog 646
    --Erase 850  ++Prog 850  --Erase 754  ++Prog 754
    --Erase 851  ++Prog 851  --Erase 646  ++Prog 646
    --Erase 852  ++Prog 852  --Erase 754  ++Prog 754
    --Erase 853  ++Prog 853  --Erase 646  ++Prog 646
    --Erase 854  ++Prog 854  --Erase 754  ++Prog 754
    --Erase 855  ++Prog 855  --Erase 856  ++Prog 856  --Erase 1  ++Prog 1
    --Erase 857  ++Prog 857  --Erase 754  ++Prog 754
    --Erase 858  ++Prog 858  --Erase 856  ++Prog 856
    --Erase 859  ++Prog 859  --Erase 754  ++Prog 754
    --Erase 860  ++Prog 860  --Erase 856  ++Prog 856
    --Erase 861  ++Prog 861  --Erase 754  ++Prog 754
    --Erase 862  ++Prog 862  --Erase 856  ++Prog 856
    --Erase 863  ++Prog 863  --Erase 754  ++Prog 754
    --Erase 864  ++Prog 864  --Erase 856  ++Prog 856
    --Erase 865  ++Prog 865  --Erase 754  ++Prog 754
    --Erase 866  ++Prog 866  --Erase 856  ++Prog 856
    --Erase 867  ++Prog 867  --Erase 754  ++Prog 754
    --Erase 868  ++Prog 868  --Erase 856  ++Prog 856
    --Erase 869  ++Prog 869  --Erase 754  ++Prog 754
    --Erase 870  ++Prog 870  --Erase 856  ++Prog 856
    --Erase 871  ++Prog 871  --Erase 754  ++Prog 754
    --Erase 872  ++Prog 872  --Erase 856  ++Prog 856
    --Erase 873  ++Prog 873  --Erase 754  ++Prog 754
    --Erase 874  ++Prog 874  --Erase 856  ++Prog 856
    --Erase 875  ++Prog 875  --Erase 754  ++Prog 754
    --Erase 876  ++Prog 876  --Erase 856  ++Prog 856
    --Erase 877  ++Prog 877  --Erase 754  ++Prog 754
    --Erase 878  ++Prog 878  --Erase 856  ++Prog 856
    --Erase 879  ++Prog 879  --Erase 754  ++Prog 754
    --Erase 880  ++Prog 880  --Erase 856  ++Prog 856
    --Erase 881  ++Prog 881  --Erase 754  ++Prog 754
    --Erase 882  ++Prog 882  --Erase 856  ++Prog 856
    --Erase 883  ++Prog 883  --Erase 754  ++Prog 754
    --Erase 884  ++Prog 884  --Erase 856  ++Prog 856
    --Erase 885  ++Prog 885  --Erase 754  ++Prog 754
    --Erase 886  ++Prog 886  --Erase 856  ++Prog 856
    --Erase 887  ++Prog 887  --Erase 754  ++Prog 754
    --Erase 888  ++Prog 888  --Erase 856  ++Prog 856
    --Erase 889  ++Prog 889  --Erase 754  ++Prog 754
    --Erase 890  ++Prog 890  --Erase 856  ++Prog 856
    --Erase 891  ++Prog 891  --Erase 754  ++Prog 754
    --Erase 892  ++Prog 892  --Erase 856  ++Prog 856
    --Erase 893  ++Prog 893  --Erase 754  ++Prog 754
    --Erase 894  ++Prog 894  --Erase 856  ++Prog 856
    --Erase 895  ++Prog 895  --Erase 754  ++Prog 754
    --Erase 896  ++Prog 896  --Erase 856  ++Prog 856
    --Erase 897  ++Prog 897  --Erase 754  ++Prog 754
    --Erase 898  ++Prog 898  --Erase 856  ++Prog 856
    --Erase 899  ++Prog 899  --Erase 754  ++Prog 754
    --Erase 900  ++Prog 900  --Erase 856  ++Prog 856
    --Erase 901  ++Prog 901  --Erase 754  ++Prog 754
    --Erase 902  ++Prog 902  --Erase 856  ++Prog 856
    --Erase 903  ++Prog 903  --Erase 754  ++Prog 754
    --Erase 904  ++Prog 904  --Erase 856  ++Prog 856
    --Erase 905  ++Prog 905  --Erase 754  ++Prog 754
    --Erase 906  ++Prog 906  --Erase 856  ++Prog 856
    --Erase 907  ++Prog 907  --Erase 754  ++Prog 754
    --Erase 908  ++Prog 908  --Erase 856  ++Prog 856
    --Erase 909  ++Prog 909  --Erase 754  ++Prog 754
    --Erase 910  ++Prog 910  --Erase 856  ++Prog 856
    --Erase 911  ++Prog 911  --Erase 754  ++Prog 754
    --Erase 912  ++Prog 912  --Erase 856  ++Prog 856
    --Erase 913  ++Prog 913  --Erase 754  ++Prog 754
    --Erase 914  ++Prog 914  --Erase 856  ++Prog 856
    --Erase 915  ++Prog 915  --Erase 754  ++Prog 754
    --Erase 916  ++Prog 916  --Erase 856  ++Prog 856
    --Erase 917  ++Prog 917  --Erase 754  ++Prog 754
    --Erase 918  ++Prog 918  --Erase 856  ++Prog 856
    --Erase 919  ++Prog 919  --Erase 754  ++Prog 754
    --Erase 920  ++Prog 920  --Erase 856  ++Prog 856
    --Erase 921  ++Prog 921  --Erase 754  ++Prog 754
    --Erase 922  ++Prog 922  --Erase 856  ++Prog 856
    --Erase 923  ++Prog 923  --Erase 754  ++Prog 754
    --Erase 924  ++Prog 924  --Erase 856  ++Prog 856
    --Erase 925  ++Prog 925  --Erase 754  ++Prog 754
    --Erase 926  ++Prog 926  --Erase 856  ++Prog 856
    --Erase 927  ++Prog 927  --Erase 754  ++Prog 754
    --Erase 928  ++Prog 928  --Erase 856  ++Prog 856
    --Erase 929  ++Prog 929  --Erase 754  ++Prog 754
    --Erase 930  ++Prog 930  --Erase 856  ++Prog 856
    --Erase 931  ++Prog 931  --Erase 754  ++Prog 754
    --Erase 932  ++Prog 932  --Erase 856  ++Prog 856
    --Erase 933  ++Prog 933  --Erase 754  ++Prog 754
    --Erase 934  ++Prog 934  --Erase 856  ++Prog 856
    --Erase 935  ++Prog 935  --Erase 754  ++Prog 754
    --Erase 936  ++Prog 936  --Erase 856  ++Prog 856
    --Erase 937  ++Prog 937  --Erase 754  ++Prog 754
    --Erase 938  ++Prog 938  --Erase 856  ++Prog 856
    --Erase 939  ++Prog 939  --Erase 754  ++Prog 754
    --Erase 940  ++Prog 940  --Erase 856  ++Prog 856
    --Erase 941  ++Prog 941  --Erase 754  ++Prog 754
    --Erase 942  ++Prog 942  --Erase 856  ++Prog 856
    --Erase 943  ++Prog 943  --Erase 754  ++Prog 754
    --Erase 944  ++Prog 944  --Erase 856  ++Prog 856
    --Erase 945  ++Prog 945  --Erase 754  ++Prog 754
    --Erase 946  ++Prog 946  --Erase 856  ++Prog 856
    --Erase 947  ++Prog 947  --Erase 754  ++Prog 754
    --Erase 948  ++Prog 948  --Erase 856  ++Prog 856
    --Erase 949  ++Prog 949  --Erase 754  ++Prog 754
    --Erase 950  ++Prog 950  --Erase 856  ++Prog 856
    --Erase 951  ++Prog 951  --Erase 754  ++Prog 754
    --Erase 952  ++Prog 952  --Erase 856  ++Prog 856
    --Erase 953  ++Prog 953  --Erase 754  ++Prog 754
    --Erase 954  ++Prog 954  --Erase 856  ++Prog 856
    --Erase 955  ++Prog 955  --Erase 754  ++Prog 754
    --Erase 956  ++Prog 956  --Erase 856  ++Prog 856
    --Erase 957  ++Prog 957  --Erase 958  ++Prog 958  --Erase 0  ++Prog 0
    --Erase 959  ++Prog 959  --Erase 856  ++Prog 856
    --Erase 960  ++Prog 960  --Erase 958  ++Prog 958
    --Erase 961  ++Prog 961  --Erase 856  ++Prog 856
    --Erase 962  ++Prog 962  --Erase 958  ++Prog 958
    --Erase 963  ++Prog 963  --Erase 856  ++Prog 856
    --Erase 964  ++Prog 964  --Erase 958  ++Prog 958
    --Erase 965  ++Prog 965  --Erase 856  ++Prog 856
    --Erase 966  ++Prog 966  --Erase 958  ++Prog 958
    --Erase 967  ++Prog 967  --Erase 856  ++Prog 856
    --Erase 968  ++Prog 968  --Erase 958  ++Prog 958
    --Erase 969  ++Prog 969  --Erase 856  ++Prog 856
    --Erase 970  ++Prog 970  --Erase 958  ++Prog 958
    --Erase 971  ++Prog 971  --Erase 856  ++Prog 856
    --Erase 972  ++Prog 972  --Erase 958  ++Prog 958
    --Erase 973  ++Prog 973  --Erase 856  ++Prog 856
    --Erase 974  ++Prog 974  --Erase 958  ++Prog 958
    --Erase 975  ++Prog 975  --Erase 856  ++Prog 856
    --Erase 976  ++Prog 976  --Erase 958  ++Prog 958
    --Erase 977  ++Prog 977  --Erase 856  ++Prog 856
    --Erase 978  ++Prog 978  --Erase 958  ++Prog 958
    --Erase 979  ++Prog 979  --Erase 856  ++Prog 856
    --Erase 980  ++Prog 980  --Erase 958  ++Prog 958
    --Erase 981  ++Prog 981  --Erase 856  ++Prog 856
    --Erase 982  ++Prog 982  --Erase 958  ++Prog 958
    --Erase 983  ++Prog 983  --Erase 856  ++Prog 856
    --Erase 984  ++Prog 984  --Erase 958  ++Prog 958
    --Erase 985  ++Prog 985  --Erase 856  ++Prog 856
    --Erase 986  ++Prog 986  --Erase 958  ++Prog 958
    --Erase 987  ++Prog 987  --Erase 856  ++Prog 856
    --Erase 988  ++Prog 988  --Erase 958  ++Prog 958
    --Erase 989  ++Prog 989  --Erase 856  ++Prog 856
    --Erase 990  ++Prog 990  --Erase 958  ++Prog 958
    --Erase 991  ++Prog 991  --Erase 856  ++Prog 856
    --Erase 992  ++Prog 992  --Erase 958  ++Prog 958
    --Erase 993  ++Prog 993  --Erase 856  ++Prog 856
    --Erase 994  ++Prog 994  --Erase 958  ++Prog 958
    --Erase 995  ++Prog 995  --Erase 856  ++Prog 856
    --Erase 996  ++Prog 996  --Erase 958  ++Prog 958
    --Erase 997  ++Prog 997  --Erase 856  ++Prog 856
    --Erase 998  ++Prog 998  --Erase 958  ++Prog 958
    --Erase 999  ++Prog 999  --Erase 856  ++Prog 856
    --Erase 1000  ++Prog 1000  --Erase 958  ++Prog 958
    --Erase 1001  ++Prog 1001  --Erase 856  ++Prog 856
    --Erase 1002  ++Prog 1002  --Erase 958  ++Prog 958
    --Erase 1003  ++Prog 1003  --Erase 856  ++Prog 856
    --Erase 1004  ++Prog 1004  --Erase 958  ++Prog 958
    --Erase 1005  ++Prog 1005  --Erase 856  ++Prog 856
    --Erase 1006  ++Prog 1006  --Erase 958  ++Prog 958
    --Erase 1007  ++Prog 1007  --Erase 856  ++Prog 856
    --Erase 1008  ++Prog 1008  --Erase 958  ++Prog 958
    --Erase 1009  ++Prog 1009  --Erase 856  ++Prog 856
    --Erase 1010  ++Prog 1010  --Erase 958  ++Prog 958
    --Erase 1012  ++Prog 1012  --Erase 856  ++Prog 856
    --Erase 1013  ++Prog 1013  --Erase 958  ++Prog 958
    --Erase 1014  ++Prog 1014  --Erase 856  ++Prog 856
    --Erase 1015  ++Prog 1015  --Erase 958  ++Prog 958
    --Erase 1016  ++Prog 1016  --Erase 856  ++Prog 856
    --Erase 1017  ++Prog 1017  --Erase 958  ++Prog 958
    --Erase 1018  ++Prog 1018  --Erase 856  ++Prog 856
    --Erase 1019  ++Prog 1019  --Erase 958  ++Prog 958
    --Erase 1020  ++Prog 1020  --Erase 856  ++Prog 856
    --Erase 1021  ++Prog 1021  --Erase 958  ++Prog 958
    --Erase 1022  ++Prog 1022  --Erase 856  ++Prog 856
    --Erase 1023  ++Prog 1023  --Erase 958  ++Prog 958
    --Erase 2  ++Prog 2  --Erase 856  ++Prog 856
    --Erase 3  ++Prog 3  --Erase 958  ++Prog 958
    --Erase 4  ++Prog 4  --Erase 856  ++Prog 856
    --Erase 5  ++Prog 5  --Erase 958  ++Prog 958
    --Erase 6  ++Prog 6  --Erase 856  ++Prog 856
    --Erase 7  ++Prog 7  --Erase 958  ++Prog 958
    --Erase 8  ++Prog 8  --Erase 856  ++Prog 856
    --Erase 9  ++Prog 9  --Erase 958  ++Prog 958
    --Erase 10  ++Prog 10  --Erase 856  ++Prog 856
    --Erase 11  ++Prog 11  --Erase 958  ++Prog 958
    --Erase 12  ++Prog 12  --Erase 856  ++Prog 856
    --Erase 13  ++Prog 13  --Erase 958  ++Prog 958
    --Erase 14  ++Prog 14  --Erase 856  ++Prog 856
    --Erase 15  ++Prog 15  --Erase 958  ++Prog 958
    --Erase 16  ++Prog 16  --Erase 856  ++Prog 856
    --Erase 17  ++Prog 17  --Erase 958  ++Prog 958
    --Erase 18  ++Prog 18  --Erase 856  ++Prog 856
    --Erase 19  ++Prog 19  --Erase 958  ++Prog 958
    --Erase 20  ++Prog 20  --Erase 856  ++Prog 856
    --Erase 21  ++Prog 21  --Erase 958  ++Prog 958
    --Erase 22  ++Prog 22  --Erase 856  ++Prog 856
    --Erase 23  ++Prog 23  --Erase 958  ++Prog 958
    --Erase 24  ++Prog 24  --Erase 856  ++Prog 856
    --Erase 25  ++Prog 25  --Erase 958  ++Prog 958
    --Erase 26  ++Prog 26  --Erase 856  ++Prog 856
    --Erase 27  ++Prog 27  --Erase 958  ++Prog 958
    --Erase 28  ++Prog 28  --Erase 856  ++Prog 856
    --Erase 29  ++Prog 29  --Erase 958  ++Prog 958
    --Erase 30  ++Prog 30  --Erase 856  ++Prog 856
    --Erase 31  ++Prog 31  --Erase 958  ++Prog 958
    --Erase 32  ++Prog 32  --Erase 856  ++Prog 856
    --Erase 33  ++Prog 33  --Erase 958  ++Prog 958
    --Erase 34  ++Prog 34  --Erase 856  ++Prog 856
    --Erase 35  ++Prog 35  --Erase 958  ++Prog 958
    --Erase 36  ++Prog 36  --Erase 856  ++Prog 856
    --Erase 37  ++Prog 37  --Erase 958  ++Prog 958
    --Erase 38  ++Prog 38  --Erase 39  ++Prog 39  --Erase 1  ++Prog 1
    --Erase 40  ++Prog 40  --Erase 958  ++Prog 958
    --Erase 41  ++Prog 41  --Erase 39  ++Prog 39
    --Erase 42  ++Prog 42  --Erase 958  ++Prog 958
    --Erase 43  ++Prog 43  --Erase 39  ++Prog 39
    --Erase 44  ++Prog 44  --Erase 958  ++Prog 958
    --Erase 45  ++Prog 45  --Erase 39  ++Prog 39
    --Erase 46  ++Prog 46  --Erase 958  ++Prog 958
    --Erase 47  ++Prog 47  --Erase 39  ++Prog 39
    --Erase 48  ++Prog 48  --Erase 958  ++Prog 958
    --Erase 49  ++Prog 49  --Erase 39  ++Prog 39
    --Erase 50  ++Prog 50  --Erase 958  ++Prog 958
    --Erase 51  ++Prog 51  --Erase 39  ++Prog 39
    --Erase 52  ++Prog 52  --Erase 958  ++Prog 958
    --Erase 53  ++Prog 53  --Erase 39  ++Prog 39
    --Erase 54  ++Prog 54  --Erase 958  ++Prog 958
    --Erase 55  ++Prog 55  --Erase 39  ++Prog 39
    --Erase 56  ++Prog 56  --Erase 958  ++Prog 958
    --Erase 57  ++Prog 57  --Erase 39  ++Prog 39
    --Erase 58  ++Prog 58  --Erase 958  ++Prog 958
    --Erase 59  ++Prog 59  --Erase 39  ++Prog 39
    --Erase 60  ++Prog 60  --Erase 958  ++Prog 958
    --Erase 61  ++Prog 61  --Erase 39  ++Prog 39
    --Erase 62  ++Prog 62  --Erase 958  ++Prog 958
    --Erase 63  ++Prog 63  --Erase 39  ++Prog 39
    --Erase 64  ++Prog 64  --Erase 958  ++Prog 958
    --Erase 65  ++Prog 65  --Erase 39  ++Prog 39
    --Erase 66  ++Prog 66  --Erase 958  ++Prog 958
    --Erase 67  ++Prog 67  --Erase 39  ++Prog 39
    --Erase 68  ++Prog 68  --Erase 958  ++Prog 958
    --Erase 69  ++Prog 69  --Erase 39  ++Prog 39
    --Erase 70  ++Prog 70  --Erase 958  ++Prog 958
    --Erase 71  ++Prog 71  --Erase 39  ++Prog 39
    --Erase 72  ++Prog 72  --Erase 958  ++Prog 958
    --Erase 73  ++Prog 73  --Erase 39  ++Prog 39
    --Erase 74  ++Prog 74  --Erase 958  ++Prog 958
    --Erase 75  ++Prog 75  --Erase 39  ++Prog 39
    --Erase 76  ++Prog 76  --Erase 958  ++Prog 958
    --Erase 77  ++Prog 77  --Erase 39  ++Prog 39
    --Erase 78  ++Prog 78  --Erase 958  ++Prog 958
    --Erase 79  ++Prog 79  --Erase 39  ++Prog 39
    --Erase 80  ++Prog 80  --Erase 958  ++Prog 958
    --Erase 81  ++Prog 81  --Erase 39  ++Prog 39
    --Erase 82  ++Prog 82  --Erase 958  ++Prog 958
    --Erase 83  ++Prog 83  --Erase 39  ++Prog 39
    --Erase 84  ++Prog 84  --Erase 958  ++Prog 958
    --Erase 85  ++Prog 85  --Erase 39  ++Prog 39
    --Erase 86  ++Prog 86  --Erase 958  ++Prog 958
    --Erase 87  ++Prog 87  --Erase 39  ++Prog 39
    --Erase 88  ++Prog 88  --Erase 958  ++Prog 958
    --Erase 89  ++Prog 89  --Erase 39  ++Prog 39
    --Erase 90  ++Prog 90  --Erase 958  ++Prog 958
    --Erase 91  ++Prog 91  --Erase 39  ++Prog 39
    --Erase 92  ++Prog 92  --Erase 958  ++Prog 958
    --Erase 93  ++Prog 93  --Erase 39  ++Prog 39
    --Erase 94  ++Prog 94  --Erase 958  ++Prog 958
    --Erase 95  ++Prog 95  --Erase 39  ++Prog 39
    --Erase 96  ++Prog 96  --Erase 958  ++Prog 958
    --Erase 97  ++Prog 97  --Erase 39  ++Prog 39
    --Erase 98  ++Prog 98  --Erase 958  ++Prog 958
    --Erase 99  ++Prog 99  --Erase 39  ++Prog 39
    --Erase 100  ++Prog 100  --Erase 958  ++Prog 958
    --Erase 101  ++Prog 101  --Erase 39  ++Prog 39
    --Erase 102  ++Prog 102  --Erase 958  ++Prog 958
    --Erase 103  ++Prog 103  --Erase 39  ++Prog 39
    --Erase 104  ++Prog 104  --Erase 958  ++Prog 958
    --Erase 105  ++Prog 105  --Erase 39  ++Prog 39
    --Erase 106  ++Prog 106  --Erase 958  ++Prog 958
    --Erase 107  ++Prog 107  --Erase 39  ++Prog 39
    --Erase 108  ++Prog 108  --Erase 958  ++Prog 958
    --Erase 109  ++Prog 109  --Erase 39  ++Prog 39
    --Erase 110  ++Prog 110  --Erase 958  ++Prog 958
    --Erase 111  ++Prog 111  --Erase 39  ++Prog 39
    --Erase 112  ++Prog 112  --Erase 958  ++Prog 958
    --Erase 113  ++Prog 113  --Erase 39  ++Prog 39
    --Erase 114  ++Prog 114  --Erase 958  ++Prog 958
    --Erase 115  ++Prog 115  --Erase 39  ++Prog 39
    --Erase 116  ++Prog 116  --Erase 958  ++Prog 958
    --Erase 117  ++Prog 117  --Erase 39  ++Prog 39
    --Erase 118  ++Prog 118  --Erase 958  ++Prog 958
    --Erase 119  ++Prog 119  --Erase 39  ++Prog 39
    --Erase 120  ++Prog 120  --Erase 958  ++Prog 958
    --Erase 121  ++Prog 121  --Erase 39  ++Prog 39
    --Erase 122  ++Prog 122  --Erase 958  ++Prog 958
    --Erase 123  ++Prog 123  --Erase 39  ++Prog 39
    --Erase 124  ++Prog 124  --Erase 958  ++Prog 958
    --Erase 125  ++Prog 125  --Erase 39  ++Prog 39
    --Erase 126  ++Prog 126  --Erase 958  ++Prog 958
    --Erase 127  ++Prog 127  --Erase 39  ++Prog 39
    --Erase 128  ++Prog 128  --Erase 958  ++Prog 958
    --Erase 129  ++Prog 129  --Erase 39  ++Prog 39
    --Erase 130  ++Prog 130  --Erase 958  ++Prog 958
    --Erase 131  ++Prog 131  --Erase 39  ++Prog 39
    --Erase 132  ++Prog 132  --Erase 958  ++Prog 958
    --Erase 133  ++Prog 133  --Erase 39  ++Prog 39
    --Erase 134  ++Prog 134  --Erase 958  ++Prog 958
    --Erase 135  ++Prog 135  --Erase 39  ++Prog 39
    --Erase 136  ++Prog 136  --Erase 958  ++Prog 958
    --Erase 137  ++Prog 137  --Erase 39  ++Prog 39
    --Erase 138  ++Prog 138  --Erase 958  ++Prog 958
    --Erase 139  ++Prog 139  --Erase 39  ++Prog 39
    --Erase 140  ++Prog 140  --Erase 141  ++Prog 141  --Erase 0  ++Prog 0
    --Erase 142  ++Prog 142  --Erase 39  ++Prog 39
    --Erase 143  ++Prog 143  --Erase 141  ++Prog 141
    --Erase 144  ++Prog 144  --Erase 39  ++Prog 39
    --Erase 145  ++Prog 145  --Erase 141  ++Prog 141
    --Erase 146  ++Prog 146  --Erase 39  ++Prog 39
    --Erase 147  ++Prog 147  --Erase 141  ++Prog 141
    --Erase 148  ++Prog 148  --Erase 39  ++Prog 39
    --Erase 149  ++Prog 149  --Erase 141  ++Prog 141
    --Erase 150  ++Prog 150  --Erase 39  ++Prog 39
    --Erase 151  ++Prog 151  --Erase 141  ++Prog 141
    --Erase 152  ++Prog 152  --Erase 39  ++Prog 39
    --Erase 153  ++Prog 153  --Erase 141  ++Prog 141
    --Erase 154  ++Prog 154  --Erase 39  ++Prog 39
    --Erase 155  ++Prog 155  --Erase 141  ++Prog 141
    --Erase 156  ++Prog 156  --Erase 39  ++Prog 39
    --Erase 157  ++Prog 157  --Erase 141  ++Prog 141
    --Erase 158  ++Prog 158  --Erase 39  ++Prog 39
    --Erase 159  ++Prog 159  --Erase 141  ++Prog 141
    --Erase 160  ++Prog 160  --Erase 39  ++Prog 39
    --Erase 161  ++Prog 161  --Erase 141  ++Prog 141
    --Erase 162  ++Prog 162  --Erase 39  ++Prog 39
    --Erase 163  ++Prog 163  --Erase 141  ++Prog 141
    --Erase 164  ++Prog 164  --Erase 39  ++Prog 39
    --Erase 165  ++Prog 165  --Erase 141  ++Prog 141
    --Erase 166  ++Prog 166  --Erase 39  ++Prog 39
    --Erase 167  ++Prog 167  --Erase 141  ++Prog 141
    --Erase 168  ++Prog 168  --Erase 39  ++Prog 39
    --Erase 169  ++Prog 169  --Erase 141  ++Prog 141
    --Erase 170  ++Prog 170  --Erase 39  ++Prog 39
    --Erase 171  ++Prog 171  --Erase 141  ++Prog 141
    --Erase 172  ++Prog 172  --Erase 39  ++Prog 39
    --Erase 173  ++Prog 173  --Erase 141  ++Prog 141
    --Erase 174  ++Prog 174  --Erase 39  ++Prog 39
    --Erase 175  ++Prog 175  --Erase 141  ++Prog 141
    --Erase 176  ++Prog 176  --Erase 39  ++Prog 39
    --Erase 177  ++Prog 177  --Erase 141  ++Prog 141
    --Erase 178  ++Prog 178  --Erase 39  ++Prog 39
    --Erase 179  ++Prog 179  --Erase 141  ++Prog 141
    --Erase 180  ++Prog 180  --Erase 39  ++Prog 39
    --Erase 181  ++Prog 181  --Erase 141  ++Prog 141
    --Erase 182  ++Prog 182  --Erase 39  ++Prog 39
    --Erase 183  ++Prog 183  --Erase 141  ++Prog 141
    --Erase 184  ++Prog 184  --Erase 39  ++Prog 39
    --Erase 185  ++Prog 185  --Erase 141  ++Prog 141
    --Erase 186  ++Prog 186  --Erase 39  ++Prog 39
    --Erase 187  ++Prog 187  --Erase 141  ++Prog 141
    --Erase 188  ++Prog 188  --Erase 39  ++Prog 39
    --Erase 189  ++Prog 189  --Erase 141  ++Prog 141
    --Erase 190  ++Prog 190  --Erase 39  ++Prog 39
    --Erase 191  ++Prog 191  --Erase 141  ++Prog 141
    --Erase 192  ++Prog 192  --Erase 39  ++Prog 39
    --Erase 193  ++Prog 193  --Erase 141  ++Prog 141
    --Erase 194  ++Prog 194  --Erase 39  ++Prog 39
    --Erase 195  ++Prog 195  --Erase 141  ++Prog 141
    --Erase 196  ++Prog 196  --Erase 39  ++Prog 39
    --Erase 197  ++Prog 197  --Erase 141  ++Prog 141
    --Erase 198  ++Prog 198  --Erase 39  ++Prog 39
    --Erase 199  ++Prog 199  --Erase 141  ++Prog 141
    --Erase 200  ++Prog 200  --Erase 39  ++Prog 39
    --Erase 201  ++Prog 201  --Erase 141  ++Prog 141
    --Erase 202  ++Prog 202  --Erase 39  ++Prog 39
    --Erase 203  ++Prog 203  --Erase 141  ++Prog 141
    --Erase 204  ++Prog 204  --Erase 39  ++Prog 39
    --Erase 205  ++Prog 205  --Erase 141  ++Prog 141
    --Erase 206  ++Prog 206  --Erase 39  ++Prog 39
    --Erase 207  ++Prog 207  --Erase 141  ++Prog 141
    --Erase 208  ++Prog 208  --Erase 39  ++Prog 39
    --Erase 209  ++Prog 209  --Erase 141  ++Prog 141
    --Erase 210  ++Prog 210  --Erase 39  ++Prog 39
    --Erase 211  ++Prog 211  --Erase 141  ++Prog 141
    --Erase 212  ++Prog 212  --Erase 39  ++Prog 39
    --Erase 213  ++Prog 213  --Erase 141  ++Prog 141
    --Erase 214  ++Prog 214  --Erase 39  ++Prog 39
    --Erase 215  ++Prog 215  --Erase 141  ++Prog 141
    --Erase 216  ++Prog 216  --Erase 39  ++Prog 39
    --Erase 217  ++Prog 217  --Erase 141  ++Prog 141
    --Erase 218  ++Prog 218  --Erase 39  ++Prog 39
    --Erase 219  ++Prog 219  --Erase 141  ++Prog 141
    --Erase 220  ++Prog 220  --Erase 39  ++Prog 39
    --Erase 221  ++Prog 221  --Erase 141  ++Prog 141
    --Erase 222  ++Prog 222  --Erase 39  ++Prog 39
    --Erase 223  ++Prog 223  --Erase 141  ++Prog 141
    --Erase 224  ++Prog 224  --Erase 39  ++Prog 39
    --Erase 225  ++Prog 225  --Erase 141  ++Prog 141
    --Erase 226  ++Prog 226  --Erase 39  ++Prog 39
    --Erase 227  ++Prog 227  --Erase 141  ++Prog 141
    --Erase 228  ++Prog 228  --Erase 39  ++Prog 39
    --Erase 229  ++Prog 229  --Erase 141  ++Prog 141
    --Erase 230  ++Prog 230  --Erase 39  ++Prog 39
    --Erase 231  ++Prog 231  --Erase 141  ++Prog 141
    --Erase 232  ++Prog 232  --Erase 39  ++Prog 39
    --Erase 233  ++Prog 233  --Erase 141  ++Prog 141
    --Erase 234  ++Prog 234  --Erase 39  ++Prog 39
    --Erase 235  ++Prog 235  --Erase 141  ++Prog 141
    --Erase 236  ++Prog 236  --Erase 39  ++Prog 39
    --Erase 237  ++Prog 237  --Erase 141  ++Prog 141
    --Erase 238  ++Prog 238  --Erase 39  ++Prog 39
    --Erase 239  ++Prog 239  --Erase 141  ++Prog 141
    --Erase 240  ++Prog 240  --Erase 39  ++Prog 39
    --Erase 241  ++Prog 241  --Erase 141  ++Prog 141
    --Erase 242  ++Prog 242  --Erase 243  ++Prog 243  --Erase 1  ++Prog 1
    --Erase 244  ++Prog 244  --Erase 141  ++Prog 141
    --Erase 245  ++Prog 245  --Erase 243  ++Prog 243
    --Erase 246  ++Prog 246  --Erase 141  ++Prog 141
    --Erase 247  ++Prog 247  --Erase 243  ++Prog 243
    --Erase 248  ++Prog 248  --Erase 141  ++Prog 141
    --Erase 249  ++Prog 249  --Erase 243  ++Prog 243
    --Erase 250  ++Prog 250  --Erase 141  ++Prog 141
    --Erase 251  ++Prog 251  --Erase 243  ++Prog 243
    --Erase 252  ++Prog 252  --Erase 141  ++Prog 141
    --Erase 253  ++Prog 253  --Erase 243  ++Prog 243
    --Erase 254  ++Prog 254  --Erase 141  ++Prog 141
    --Erase 255  ++Prog 255  --Erase 243  ++Prog 243
    --Erase 256  ++Prog 256  --Erase 141  ++Prog 141
    --Erase 257  ++Prog 257  --Erase 243  ++Prog 243
    --Erase 258  ++Prog 258  --Erase 141  ++Prog 141
    --Erase 259  ++Prog 259  --Erase 243  ++Prog 243
    --Erase 260  ++Prog 260  --Erase 141  ++Prog 141
    --Erase 261  ++Prog 261  --Erase 243  ++Prog 243
    --Erase 262  ++Prog 262  --Erase 141  ++Prog 141
    --Erase 263  ++Prog 263  --Erase 243  ++Prog 243
    --Erase 264  ++Prog 264  --Erase 141  ++Prog 141
    --Erase 265  ++Prog 265  --Erase 243  ++Prog 243
    --Erase 266  ++Prog 266  --Erase 141  ++Prog 141
    --Erase 267  ++Prog 267  --Erase 243  ++Prog 243
    --Erase 268  ++Prog 268  --Erase 141  ++Prog 141
    --Erase 269  ++Prog 269  --Erase 243  ++Prog 243
    --Erase 270  ++Prog 270  --Erase 141  ++Prog 141
    --Erase 271  ++Prog 271  --Erase 243  ++Prog 243
    --Erase 272  ++Prog 272  --Erase 141  ++Prog 141
    --Erase 273  ++Prog 273  --Erase 243  ++Prog 243
    --Erase 274  ++Prog 274  --Erase 141  ++Prog 141
    --Erase 275  ++Prog 275  --Erase 243  ++Prog 243
    --Erase 276  ++Prog 276  --Erase 141  ++Prog 141
    --Erase 277  ++Prog 277  --Erase 243  ++Prog 243
    --Erase 278  ++Prog 278  --Erase 141  ++Prog 141
    --Erase 279  ++Prog 279  --Erase 243  ++Prog 243
    --Erase 280  ++Prog 280  --Erase 141  ++Prog 141
    --Erase 281  ++Prog 281  --Erase 243  ++Prog 243
    --Erase 282  ++Prog 282  --Erase 141  ++Prog 141
    --Erase 283  ++Prog 283  --Erase 243  ++Prog 243
    --Erase 284  ++Prog 284  --Erase 141  ++Prog 141
    --Erase 285  ++Prog 285  --Erase 243  ++Prog 243
    --Erase 286  ++Prog 286  --Erase 141  ++Prog 141
    --Erase 287  ++Prog 287  --Erase 243  ++Prog 243
    --Erase 288  ++Prog 288  --Erase 141  ++Prog 141
    --Erase 289  ++Prog 289  --Erase 243  ++Prog 243
    --Erase 290  ++Prog 290  --Erase 141  ++Prog 141
    --Erase 291  ++Prog 291  --Erase 243  ++Prog 243
    --Erase 292  ++Prog 292  --Erase 141  ++Prog 141
    --Erase 293  ++Prog 293  --Erase 243  ++Prog 243
    --Erase 294  ++Prog 294  --Erase 141  ++Prog 141
    --Erase 295  ++Prog 295  --Erase 243  ++Prog 243
    --Erase 296  ++Prog 296  --Erase 141  ++Prog 141
    --Erase 297  ++Prog 297  --Erase 243  ++Prog 243
    --Erase 298  ++Prog 298  --Erase 141  ++Prog 141
    --Erase 299  ++Prog 299  --Erase 243  ++Prog 243
    --Erase 300  ++Prog 300  --Erase 141  ++Prog 141
    --Erase 301  ++Prog 301  --Erase 243  ++Prog 243
    --Erase 302  ++Prog 302  --Erase 141  ++Prog 141
    --Erase 303  ++Prog 303  --Erase 243  ++Prog 243
    --Erase 304  ++Prog 304  --Erase 141  ++Prog 141
    --Erase 305  ++Prog 305  --Erase 243  ++Prog 243
    --Erase 306  ++Prog 306  --Erase 141  ++Prog 141
    --Erase 307  ++Prog 307  --Erase 243  ++Prog 243
    --Erase 308  ++Prog 308  --Erase 141  ++Prog 141
    --Erase 309  ++Prog 309  --Erase 243  ++Prog 243
    --Erase 310  ++Prog 310  --Erase 141  ++Prog 141
    --Erase 311  ++Prog 311  --Erase 243  ++Prog 243
    --Erase 312  ++Prog 312  --Erase 141  ++Prog 141
    --Erase 313  ++Prog 313  --Erase 243  ++Prog 243
    --Erase 314  ++Prog 314  --Erase 141  ++Prog 141
    --Erase 315  ++Prog 315  --Erase 243  ++Prog 243
    --Erase 316  ++Prog 316  --Erase 141  ++Prog 141
    --Erase 317  ++Prog 317  --Erase 243  ++Prog 243
    --Erase 318  ++Prog 318  --Erase 141  ++Prog 141
    --Erase 319  ++Prog 319  --Erase 243  ++Prog 243
    --Erase 320  ++Prog 320  --Erase 141  ++Prog 141
    --Erase 321  ++Prog 321  --Erase 243  ++Prog 243
    --Erase 322  ++Prog 322  --Erase 141  ++Prog 141
    --Erase 323  ++Prog 323  --Erase 243  ++Prog 243
    --Erase 324  ++Prog 324  --Erase 141  ++Prog 141
    --Erase 325  ++Prog 325  --Erase 243  ++Prog 243
    --Erase 326  ++Prog 326  --Erase 141  ++Prog 141
    --Erase 327  ++Prog 327  --Erase 243  ++Prog 243
    --Erase 328  ++Prog 328  --Erase 141  ++Prog 141
    --Erase 329  ++Prog 329  --Erase 243  ++Prog 243
    --Erase 330  ++Prog 330  --Erase 141  ++Prog 141
    --Erase 331  ++Prog 331  --Erase 243  ++Prog 243
    --Erase 332  ++Prog 332  --Erase 141  ++Prog 141
    --Erase 333  ++Prog 333  --Erase 243  ++Prog 243
    --Erase 334  ++Prog 334  --Erase 141  ++Prog 141
    --Erase 335  ++Prog 335  --Erase 243  ++Prog 243
    --Erase 336  ++Prog 336  --Erase 141  ++Prog 141
    --Erase 337  ++Prog 337  --Erase 243  ++Prog 243
    --Erase 338  ++Prog 338  --Erase 141  ++Prog 141
    --Erase 339  ++Prog 339  --Erase 243  ++Prog 243
    --Erase 340  ++Prog 340  --Erase 141  ++Prog 141
    --Erase 341  ++Prog 341  --Erase 243  ++Prog 243
    --Erase 342  ++Prog 342  --Erase 141  ++Prog 141
    --Erase 343  ++Prog 343  --Erase 243  ++Prog 243
    --Erase 344  ++Prog 344  --Erase 345  ++Prog 345  --Erase 0  ++Prog 0
    --Erase 346  ++Prog 346  --Erase 243  ++Prog 243
    --Erase 347  ++Prog 347  --Erase 345  ++Prog 345
    --Erase 348  ++Prog 348  --Erase 243  ++Prog 243
    
    


  • @robert-hh Hello again Robert.
    Hello again, Robert.
    Reading the code on lfs.c, where the block cycle is instanced, I was searching for a implementation of something akin to a circular buffer, that being, when the block cycle of the last superblock ends, the buffer pointer resetting to the first user superblock. I was hoping to see that implemented on the relocate jump, but I found no hint of that there, as well. I might be wrong in my assumption, but such a low block-cycle as you suggested, considering our requisites, would lead to a complete halt of flash writing in just a period of months.
    Could you have a look at that? There might be something that I've not seen properly.



  • @serafimsaudade I did some more testing. It is no problem to set the value of block_cycles to a moderate number like 1000. No additional space is consumed and the speed is not affected. The LFS document recommends a value of 100 - 1000. Micropython.org uses 100. I made my test with 100, to see changes in short test time.



  • @robert-hh

    Shifting the file system seems to make it.
    I got one wipy3 up and running. :)
    I will start testing the rest.

    Best Regards,



  • @Lourenço-Frade Hello. I just suggested the same, of shifting the file system 4 blocks up. As far as I understand, this is just the file system which will be moved, as it is in the upper area of the flash. With my suggested change, the size is also accordingly reduced. So it should not affect any other objects in flash.



  • @serafimsaudade said in External Flash lose files:

    Do you think with this change the wipy3 that have flash wearout will be reusable?

    If the problem was flash wearout, then this single change will most likely not bring the broken device to live again, because block 0 and 1 are defective. One possibility I see is to shift the file system a little bit up in memory. If that applies to bloc 0 and 1, four block should be sufficient. For that, you could to modify esp32/fatfs/src/drivers/sflash_diskio.h, lines 24 to 28 as follows:

    #define SFLASH_FS_SHIFT                 4
    #define SFLASH_BLOCK_COUNT_8MB          MICROPY_PORT_SFLASH_BLOCK_COUNT_8MB - SFLASH_FS_SHIFT
    #define SFLASH_FS_SECTOR_COUNT_8MB      ((SFLASH_BLOCK_SIZE * SFLASH_BLOCK_COUNT_8MB) / SFLASH_FS_SECTOR_SIZE)
    #define SFLASH_START_ADDR_8MB           (0x00400000 + SFLASH_BLOCK_SIZE * SFLASH_FS_SHIFT)
    #define SFLASH_START_BLOCK_8MB          (SFLASH_START_ADDR_8MB / SFLASH_BLOCK_SIZE)
    #define SFLASH_END_BLOCK_8MB            (SFLASH_START_BLOCK_8MB + (SFLASH_BLOCK_COUNT - 1)) - SFLASH_FS_SHIFT
    

    Edit: The symbol SFLASH_BLOCK_COUNT is not defined at all. But since SFLASH_END_BLOCK_8MB and SFLASH_END_BLOCK_4MB are not used at all, it's not a problem. I guess, the line should be:

    #define SFLASH_END_BLOCK_8MB            (SFLASH_START_BLOCK_8MB + (SFLASH_BLOCK_COUNT_8MB - 1))```


  • Greetings Robert. I'm working with @serafimsaudade in this issue, and we believe there may be a way to reuse the flash if we change the starting address of the starting address (sflash_diskio.h, line 26) by 128kbytes (essentially, avoiding the first two super block addresses, and initiating the block cycle from superblock 2). The problem is we are uncertain whether this would shift ALL the flash, including the flash RAM the firmware partition, or if the address defined is just relative to the volatile memory.



  • @robert-hh said in External Flash lose files:

    @serafimsaudade So it looks like the option of block level wearout protection works for V1 too. I tested it with a setting of 100. But I imageine that this setting eats up superblocks (and space) permanently. So a level of 10000 could be more appropriate.

    Edit: The file & line to be changed: littlefs/sflash_diskio_littlefs.c, line 48

    Edit2: Looking in to the code, the actual LFS version used by pycom is 2.0, not 1.x as I assumed earler. The other version tried is 2.3. So not much difference then. It was just the non-enabled block-wear protection.

    Tks @robert-hh
    I will compile an new fw with the change.
    Do you think with this change the wipy3 that have flash wearout will be reusable?

    Best Regards,



  • @tuftec NVRAM is also flash based, but is told to implement protection against flash wear.



  • @robert-hh power fail corruption is less of an issue for me since i have permanent solar/battery power. A short flash life is a major drama however.
    I might be able to reconfigure my code to use the nvram methods but I am not sure that will improve the situation.

    Thanks.



  • @tuftec said in External Flash lose files:

    If I change back to LFS, assuming my original crashing problem does not resurface, can I then get wear levelling to increase this to potentially 6 years?

    When chanhing back to LFS, and since you have to re-compile the code anyhow, you may consider updating LFS from the actual version 2.0 to the recent version. Maybe the problem will disappear then.
    P.S.: I am not overly happy with LFS. FAT is faster and seems more reliable under normal conditions. However, with FAT you will end up with a corrupted file system on a power fail during writes.



  • @tuftec said in External Flash lose files:

    I have current product in the field that uses a PIC micro at its heart.

    Even if flash vendors ensure at least 100000 write cycles, the actual numbers that can be achieved is several million. It depends a lot on the operating conditions. So 6 years of operation with an update every 2 minutes means ~ 1.6 Million cycles. The devices of @serafimsaudade broke after ~3 Million cycles.



  • @tuftec With respect to flash wear, FAT is bad. The FAT file system uses a file allocation table (FAT) at a fixed location, and the master directory also at a fixed location. The FAT is written whenever a file is created, or extended. The directory is written on every action that changes a file, at least on file close. So in your case, that FAT may not be changed on every file write, but the directory is. With FAT, the file data may be written at different places, but maybe not. With a block size of 4 K and a file size of 2k, it may as well be that the data is always written to the same block.
    LFS has at the moment at least wear leveling for the file data, but not for the superblock.
    The change to enable block level wear leveling requires re-compiling the code. But the file system may stay.



  • I have current product in the field that uses a PIC micro at its heart. This product writes data back to flash every 2 mins. I have a sizable number of units in the field, in remote applications that have been operating fault free for 6 years. Many of them have not been powered down or reset for over 2 years.
    I do not do anything special to preserve the flash memory on these units. They just work.
    I had expected to have a similar experience with the FiPy devices that I am planning to deploy into similar applications.


Log in to reply
 

Pycom on Twitter