[Microbit-Python] Maximum Size of Microbit Python Program?‏

Nevil Hunt nevil.hunt at hotmail.co.uk
Thu Apr 21 08:03:10 EDT 2016


Hi Coryan,
 
Thanks for the info.
 
I'm programming using the Web interface rather than the stand alone Mu - whether that makes any difference to the size of the Hex file I don't know.
The Hex files from my Block programs seem to be 500 -573k
The Hex files from my Python programs seem to be 573 -595k where all programs up to 590k run OK. It's just the 595k one that doesn't
I don't know how the Hex file maps to the 256k, 65k & 8k you mention.
 
My concerns are two fold
1) Exceeding the size is silent - there is no error/warning when compiling or downloading
2) My program isn't that big! Only ~150 lines of code
 
I suspect it just need some s/w switch changing but that level of detail is beyond me!
 
Regards,
 
Nevil

 
Date: Wed, 20 Apr 2016 10:25:49 +0100
From: coryanws at gmail.com
To: microbit at python.org
Subject: Re: [Microbit-Python] Microbit Digest, Vol 11, Issue 10

Hello Nevil,

I may be wrong about some of these, but I believe the following are true:

 - The maximum size of the flash memory on an nRF51822 is 256 kilobytes
 - The width of the "Size" field in a MicroPython program header is 16 bits, which limits its size to 65 kilobytes.
 - The Mu IDE will refuse to flash scripts that are larger than 8192 bytes

The smallest of these is Mu's limit of 8kb, so that'd be the limit you'd hit first. Note that the actual size of the hex files you are generating will be larger than this, as they're in Intel Hex, not pure binary.

Hope that helps!
 - Coryan




On Tue, Apr 19, 2016 at 5:00 PM,  <microbit-request at python.org> wrote:
Send Microbit mailing list submissions to

        microbit at python.org



To subscribe or unsubscribe via the World Wide Web, visit

        https://mail.python.org/mailman/listinfo/microbit

or, via email, send a message with subject or body 'help' to

        microbit-request at python.org



You can reach the person managing the list at

        microbit-owner at python.org



When replying, please edit your Subject line so it is more specific

than "Re: Contents of Microbit digest..."





Today's Topics:



   1. Maximum Size of Microbit Python Program? (Nevil Hunt)





----------------------------------------------------------------------



Message: 1

Date: Mon, 18 Apr 2016 18:17:05 +0100

From: Nevil Hunt <nevil.hunt at hotmail.co.uk>

To: "microbit at python.org" <microbit at python.org>

Subject: [Microbit-Python] Maximum Size of Microbit Python Program?

Message-ID: <DUB131-W66074EA0FFD3E703617583C36B0 at phx.gbl>

Content-Type: text/plain; charset="iso-8859-1"



Hi,



I think I may have exceeded the maximum size a microbit Python Program can be!

My program compiles OK. Appears to download OK. But then doesn't run. There is no error message during the download and no error message on the microbit.

I'm fairly sure it's the program's size that's the problem as I've experimented gradually reducing the size of the program until it started to work again.



Does anyone know what is the maximum size a microbit Python Program can be?

And what is it limited by? Is it the size available in the micro:bit's Flash?

And how do I know how big my program is? Is it simply down to the size of the Hex file?

(I have a working program which is 590k and one that doesn't run which is 595k)



Thanks,



Nevil





-------------- next part --------------

An HTML attachment was scrubbed...

URL: <http://mail.python.org/pipermail/microbit/attachments/20160418/5b64fb20/attachment-0001.html>



------------------------------



Subject: Digest Footer



_______________________________________________

Microbit mailing list

Microbit at python.org

https://mail.python.org/mailman/listinfo/microbit





------------------------------



End of Microbit Digest, Vol 11, Issue 10

****************************************




_______________________________________________
Microbit mailing list
Microbit at python.org
https://mail.python.org/mailman/listinfo/microbit 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/microbit/attachments/20160421/f8173eb1/attachment-0001.html>


More information about the Microbit mailing list