two questions about deploying..

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
_jg_
Posts: 12
Joined: Sat Mar 19, 2016 3:47 am

two questions about deploying..

Post by _jg_ » Mon Dec 04, 2017 10:47 pm

hi everyone.

i finally could build firmware and deploy it to my pyboard 8-) .
anyway, a pair or questions are still unanswered for me:

1) how can i define the max size of the contents of the "modules" directory? i suppose there is some limit. what is it, where can i find or how can i calculate it? (pyboard 1.1)
2) i tried changing the shebang of "../tools/pydfu.py" so it would run with my personal python3 enviroment, but everytime i ran "make deploy" it used the python2. why didn't it obbey the change in shebang? (.. yes, i saved the changes before deploying).

regards.

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: two questions about deploying..

Post by SpotlightKid » Mon Dec 04, 2017 10:56 pm

re 2) You have to set the "PYTHON" make variable:

Code: Select all

make PYTHON=/path/to/my/python USE_PYDFU=1 deploy

_jg_
Posts: 12
Joined: Sat Mar 19, 2016 3:47 am

Re: two questions about deploying..

Post by _jg_ » Mon Dec 04, 2017 11:40 pm

neat.
thank you very much. i missed that in the documentation.
maybe it would be more useful to have that comment instead of the shebang, dont you think

any clue about question 1? how do i know how big can i make my firmware-embedded modules?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: two questions about deploying..

Post by pythoncoder » Tue Dec 05, 2017 9:15 am

At risk of stating the obvious, the contents of modules comprises Python source which might include comments, docstrings etc. When built a file frozen_mpy.c is created, containing user data structures, qstrs and bytecode. This is then compiled. So there is no simple mapping between the size of modules and the size of the eventual firmware image.

For what it's worth one of my modules directories for the Pyboard contains nearly 400K of source.
Peter Hinch
Index to my micropython libraries.

_jg_
Posts: 12
Joined: Sat Mar 19, 2016 3:47 am

Re: two questions about deploying..

Post by _jg_ » Tue Dec 05, 2017 8:46 pm

Thanks.
please just help me clarify which file(s?) size must i watch, and versus which limit.

i mean:
i see the directory build-PYBV11 is 4.7MB. Here i have several files (firmware.dfu, firmware.elf, etc..) which of these are written to the board at firmware update?

according to the feature table pyboard has 1024kB in flash memory. is this the size limit for the group of files being written or is there a portion of it being used during such operation, lowering the limit?


ps: not english-language native. hope i made my point clear.

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: two questions about deploying..

Post by SpotlightKid » Tue Dec 05, 2017 10:18 pm

_jg_ wrote:
Tue Dec 05, 2017 8:46 pm
according to the feature table pyboard has 1024kB in flash memory. is this the size limit for the group of files being written or is there a portion of it being used during such operation, lowering the limit?
I would advise you to spend some time reading:

https://store.micropython.org/#/features
http://docs.micropython.org/en/latest/p ... nd-sd-card
http://docs.micropython.org/en/latest/p ... ained.html
https://github.com/micropython/micropyt ... structions
https://github.com/micropython/micropyt ... efile#L370

_jg_
Posts: 12
Joined: Sat Mar 19, 2016 3:47 am

Re: two questions about deploying..

Post by _jg_ » Fri Dec 08, 2017 5:44 pm

ok.
thanks.. i guess :| .

chrismas9
Posts: 152
Joined: Wed Jun 25, 2014 10:07 am

Re: two questions about deploying..

Post by chrismas9 » Fri Dec 08, 2017 10:52 pm

Have a look at the linker script for your MCU. In the case of the pyboard it's:

https://github.com/micropython/micropyt ... m32f405.ld

Code: Select all

/* Specify the memory areas */
MEMORY
{
    FLASH (rx)      : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */
    FLASH_ISR (rx)  : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
    FLASH_FS (rx)   : ORIGIN = 0x08004000, LENGTH = 112K /* sectors 1,2,3,4 are for filesystem */
    FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 896K /* sectors 5,6,7,8,9,10,11 */
    CCMRAM (xrw)    : ORIGIN = 0x10000000, LENGTH = 64K
    RAM (xrw)       : ORIGIN = 0x20000000, LENGTH = 128K
}
When you build MicroPython it tells you the size which must fit into FLASH_ISR and FLASH_TEXT.

_jg_
Posts: 12
Joined: Sat Mar 19, 2016 3:47 am

Re: two questions about deploying..

Post by _jg_ » Thu Dec 14, 2017 11:01 pm

thanks. i think that's it.

Post Reply