Page 1 of 1

two questions about deploying..

Posted: Mon Dec 04, 2017 10:47 pm
by _jg_
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.

Re: two questions about deploying..

Posted: Mon Dec 04, 2017 10:56 pm
by SpotlightKid
re 2) You have to set the "PYTHON" make variable:

Code: Select all

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

Re: two questions about deploying..

Posted: Mon Dec 04, 2017 11:40 pm
by _jg_
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?

Re: two questions about deploying..

Posted: Tue Dec 05, 2017 9:15 am
by pythoncoder
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.

Re: two questions about deploying..

Posted: Tue Dec 05, 2017 8:46 pm
by _jg_
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.

Re: two questions about deploying..

Posted: Tue Dec 05, 2017 10:18 pm
by SpotlightKid
_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

Re: two questions about deploying..

Posted: Fri Dec 08, 2017 5:44 pm
by _jg_
ok.
thanks.. i guess :| .

Re: two questions about deploying..

Posted: Fri Dec 08, 2017 10:52 pm
by chrismas9
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.

Re: two questions about deploying..

Posted: Thu Dec 14, 2017 11:01 pm
by _jg_
thanks. i think that's it.