two questions about deploying..
two questions about deploying..
hi everyone.
i finally could build firmware and deploy it to my pyboard .
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.
i finally could build firmware and deploy it to my pyboard .
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.
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: two questions about deploying..
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..
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?
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?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: two questions about deploying..
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.
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.
Index to my micropython libraries.
Re: two questions about deploying..
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.
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.
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: two questions about deploying..
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..
ok.
thanks.. i guess .
thanks.. i guess .
Re: two questions about deploying..
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
When you build MicroPython it tells you the size which must fit into FLASH_ISR and FLASH_TEXT.
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
}
Re: two questions about deploying..
thanks. i think that's it.