PythonEditor icon indicating copy to clipboard operation
PythonEditor copied to clipboard

No indication of file size limits for uploading programs to the micro:bit

Open AlasdairAtKitronik opened this issue 7 years ago • 1 comments

A problem I've often come across is creating a python program which is too large for the micro:bit, however, I usually only find this out when I've flashed it across and had the Memory allocation failure message scroll across. At that point it tells you how many bytes too large the file is. Using the online micro:bit python editor I discovered the useful 'Oops! Your script is to long given the limited memory on the device.' error message feature. What would make this even more useful though is if it actually told you by how much a program had exceeded the size limit. Could this be added? Is the actual max file size information accessible anywhere?

AlasdairAtKitronik avatar Oct 10 '18 12:10 AlasdairAtKitronik

At that point it tells you how many bytes too large the file is.

Unfortunately that's not a precise number: it's just how many bytes it ran over in the current allocation. There could be many more allocations to come after that one, if only it succeeded. So there's no real way to tell how much the script is over the limit.

Using the online micro:bit python editor I discovered the useful 'Oops! Your script is to long given the limited memory on the device.' error message feature.

I think that's just a message that the 8192 byte limit for storing appended scripts was reached. That doesn't really tell much about whether the script can be loaded and executed by the device (it might be that a longer script would still run, or a shorter one wouldn't run).

dpgeorge avatar Oct 12 '18 07:10 dpgeorge