Post
by federico » Sun Apr 12, 2020 10:44 pm
In my opinion uPyCraft , at the moment, is the only IDE that can be easily used with the new W600-PICO board and I am using it( not only). You can load and check script on the Editor area, load(*) script from the board in the Editor area and download script from the Editor to the board.
Anyway, with the Windows yPyCraft version V1.1, also without the capability of loading the board code from the GUI device tree, a workaround is to load in the uPyCraft REPL shell the onboard upython code using
>>>print(open('<filename.py>','rU).read()) and the cut and paste it in the Editor area.
To download a new firmware we need to use the Volodymyr Shymanskyy w600tool ( Python or Windows version) that can be downloaded from github.
As in the board specs the available flash is 1MB but what's more important to know is the available free flash size that we can use to store our micropython scripts.
To be short ( if I am right) I have found that we have a total of 63 blocks of 512 bytes of available flash size(about 32k) with 58 of them free (29k) for our scripts storage ( 5 are used by the default storage including. 3 dir - lib-sys-cert- and the boot and w600easy files).
Clearly a lot af flash is used to store the firmware wm_w600.fls of 528 kBytes).
Until now the reason of the flash deficit is unknown to me.
I have tested the same script with an ESP8266 board. having 4MB flash founding an available free flash around 3.5MB that is a reasonable value.
# free flash size micropython script
import uos, w600
def run():
files_space = 0
for i in range(len(uos.listdir())):
if len(uos.listdir().split('.')) < 2:
a= uos.listdir()
print("Dir:{} bytes:{}".format(a,uos.stat(a)[6]))
files_space = files_space + uos.stat(a)[6]
else:
a = uos.listdir()
files_space = files_space + uos.stat(a)[6]
b = uos.listdir().split('.')[0]
print(" File:{} bytes:{}".format(b,uos.stat(a)[6]))
s = uos.statvfs(uos.getcwd())
print('Root Dir : '+ uos.getcwd())
print(s)
print('ESP flash size : '+ str( w600.flash_size()))
print('Flash avl size : '+'{0} bytes'.format((s[0]*s[2])))
print('Free flash size : '+'{0} bytes'.format((s[0]*s[3])))
print('Used flash size : '+'{0} bytes'.format((s[0]*(s[2] - s[3]))))
print('Stored files size : '+ str(files_space))
==================================
(*) with the python version - because the WM600-PICO root is '/flash' - to be able to load/run script from the uPyCraft device tree some changes to the python code in uPyCraft.py are required.
............
def treeRightMenuOpenFile(self):
if sys.platform=="linux" and str(se....
.........
.........
if self.currentBoard=="w600":
print(' row 2266 - w600 debug filename : ' + self.fileName)
a = str(self.fileName)
print(a)
b = '.'+(a.lstrip("/flash")).lstrip("'")
print(b)
self.uitoctrlQueue.put("loadfile:::" + b)
else:
self.uitoctrlQueue.put("loadfile:::%s"%self.fileName)