Compilare il firmware Pybricks

In linea di massima, a meno di non voler effettuare modifiche personali al firmware Pybricks, le istruzioni che seguono non sono necessarie per utilizzare Pybricks su uno dei vari dispositivi LEGO.

Però, se vi interessa conoscere più a fondo il funzionamento del firmware e magari tentare di apportare alcune modifiche per necessità specifiche (ad esempio, anche solo per cambiare il nome del dispositivo BLE che, ad oggi, è ‘hard-coded’) può tornarvi utile sapere come si può compilare in autonomia il file *.bin da caricare sullo Smart Hub.

Le operazioni sono state svolte su un PC con Ubuntu 18.04.4 LTS.

Prima di tutto, è necessario installare la GCC Toolchain per compilare codice per la piattaforma ARM. Dalla finestra del termina, digitare: sudo apt-get install gcc-arm-none-eabi

(nota: eventualmente, in caso di errore ‘unable to locate package‘, lanciare prima il comando sudo apt-get update per aggiornare la lista dei package)

gianluca1@UbuntuPC:~$ sudo apt-get install gcc-arm-none-eabi
[sudo] password di gianluca1: 
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze       
Lettura informazioni sullo stato... Fatto
I seguenti pacchetti sono stati installati automaticamente e non sono più richiesti:
  fonts-liberation2 fonts-opensymbol gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gir1.2-gudev-1.0 gir1.2-udisks-2.0 grilo-plugins-0.3-base gstreamer1.0-gtk3 libboost-date-time1.65.1
  libboost-filesystem1.65.1 libboost-iostreams1.65.1 libboost-locale1.65.1 libcdr-0.1-1 libclucene-contribs1v5 libclucene-core1v5 libcmis-0.5-5v5 libcolamd2 libdazzle-1.0-0 libe-book-0.1-1
  libedataserverui-1.2-2 libeot0 libepubgen-0.1-1 libetonyek-0.1-1 libevent-2.1-6 libexiv2-14 libfreerdp-client2-2 libfreerdp2-2 libgc1c2 libgee-0.8-2 libgexiv2-2 libgom-1.0-0 libgpgmepp6 libgpod-common
  libgpod4 liblangtag-common liblangtag1 liblirc-client0 liblua5.3-0 libmediaart-2.0-0 libmspub-0.1-1 libodfgen-0.1-1 libqqwing2v5 libraw16 librevenge-0.0-0 libsgutils2-2 libssh-4 libsuitesparseconfig5
  libvncclient1 libwinpr2-2 libxapian30 libxmlsec1 libxmlsec1-nss lp-solve media-player-info python3-mako python3-markupsafe syslinux syslinux-common syslinux-legacy usb-creator-common
Usare "sudo apt autoremove" per rimuoverli.
I seguenti pacchetti aggiuntivi saranno inoltre installati:
  binutils-arm-none-eabi libisl15 libnewlib-arm-none-eabi libnewlib-dev libstdc++-arm-none-eabi-newlib
Pacchetti suggeriti:
  libnewlib-doc
I seguenti pacchetti NUOVI saranno installati:
  binutils-arm-none-eabi gcc-arm-none-eabi libisl15 libnewlib-arm-none-eabi libnewlib-dev libstdc++-arm-none-eabi-newlib
0 aggiornati, 6 installati, 0 da rimuovere e 208 non aggiornati.
È necessario scaricare 121 MB di archivi.
Dopo quest'operazione, verranno occupati 1.133 MB di spazio su disco.
Continuare? [S/n] s
Scaricamento di:1 http://it.archive.ubuntu.com/ubuntu bionic/universe amd64 libisl15 amd64 0.18-4 [548 kB]
Scaricamento di:2 http://it.archive.ubuntu.com/ubuntu bionic/universe amd64 binutils-arm-none-eabi amd64 2.27-9ubuntu1+9 [2.346 kB]
Scaricamento di:3 http://it.archive.ubuntu.com/ubuntu bionic/universe amd64 gcc-arm-none-eabi amd64 15:6.3.1+svn253039-1build1 [24,3 MB]
Scaricamento di:4 http://it.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libnewlib-dev all 2.4.0.20160527-3ubuntu0.1 [108 kB]                                                                   
Scaricamento di:5 http://it.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libnewlib-arm-none-eabi all 2.4.0.20160527-3ubuntu0.1 [19,1 MB]                                                        
Scaricamento di:6 http://it.archive.ubuntu.com/ubuntu bionic/universe amd64 libstdc++-arm-none-eabi-newlib all 15:6.3.1+svn253039-1+10 [74,8 MB]                                                           
Recuperati 121 MB in 1min 37s (1.244 kB/s)                                                                                                                                                                 
Selezionato il pacchetto libisl15:amd64 non precedentemente selezionato.
(Lettura del database... 159394 file e directory attualmente installati.)
Preparativi per estrarre .../0-libisl15_0.18-4_amd64.deb...
Estrazione di libisl15:amd64 (0.18-4)...
Selezionato il pacchetto binutils-arm-none-eabi non precedentemente selezionato.
Preparativi per estrarre .../1-binutils-arm-none-eabi_2.27-9ubuntu1+9_amd64.deb...
Estrazione di binutils-arm-none-eabi (2.27-9ubuntu1+9)...
Selezionato il pacchetto gcc-arm-none-eabi non precedentemente selezionato.
Preparativi per estrarre .../2-gcc-arm-none-eabi_15%3a6.3.1+svn253039-1build1_amd64.deb...
Estrazione di gcc-arm-none-eabi (15:6.3.1+svn253039-1build1)...
Selezionato il pacchetto libnewlib-dev non precedentemente selezionato.
Preparativi per estrarre .../3-libnewlib-dev_2.4.0.20160527-3ubuntu0.1_all.deb...
Estrazione di libnewlib-dev (2.4.0.20160527-3ubuntu0.1)...
Selezionato il pacchetto libnewlib-arm-none-eabi non precedentemente selezionato.
Preparativi per estrarre .../4-libnewlib-arm-none-eabi_2.4.0.20160527-3ubuntu0.1_all.deb...
Estrazione di libnewlib-arm-none-eabi (2.4.0.20160527-3ubuntu0.1)...
Selezionato il pacchetto libstdc++-arm-none-eabi-newlib non precedentemente selezionato.
Preparativi per estrarre .../5-libstdc++-arm-none-eabi-newlib_15%3a6.3.1+svn253039-1+10_all.deb...
Estrazione di libstdc++-arm-none-eabi-newlib (15:6.3.1+svn253039-1+10)...
Configurazione di libisl15:amd64 (0.18-4)...
Configurazione di libnewlib-dev (2.4.0.20160527-3ubuntu0.1)...
Configurazione di binutils-arm-none-eabi (2.27-9ubuntu1+9)...
Configurazione di libnewlib-arm-none-eabi (2.4.0.20160527-3ubuntu0.1)...
Configurazione di libstdc++-arm-none-eabi-newlib (15:6.3.1+svn253039-1+10)...
Configurazione di gcc-arm-none-eabi (15:6.3.1+svn253039-1build1)...
Elaborazione dei trigger per man-db (2.8.3-2ubuntu0.1)...
Elaborazione dei trigger per libc-bin (2.27-3ubuntu1)...
gianluca1@UbuntuPC:~$

Successivamente, si procede a clonare il repository pybricks-micropython, digitando il comando git clone https://github.com/pybricks/pybricks-micropython.git nella finestra del terminale.

gianluca1@UbuntuPC:~$ git clone https://github.com/pybricks/pybricks-micropython.git
Cloning into 'pybricks-micropython'...
remote: Enumerating objects: 538, done.
remote: Counting objects: 100% (538/538), done.
remote: Compressing objects: 100% (353/353), done.
remote: Total 21419 (delta 265), reused 363 (delta 177), pack-reused 20881
Ricezione degli oggetti: 100% (21419/21419), 6.28 MiB | 1.17 MiB/s, done.
Risoluzione dei delta: 100% (15490/15490), done.
gianluca1@UbuntuPC:~$

Terminata la copia del repository ci si sposta nella directory locale del repository stesso, digitando cd pybricks-micropython

A questo punto, lanciamo una prima volta il comando make senza alcun parametro. Lo script effettuerà l’inizializzazione del submodule micropython:

gianluca1@UbuntuPC:~/pybricks-micropython$ make
GIT cloning micropython submodule
Submodule 'micropython' (https://github.com/pybricks/micropython) registered for path 'micropython'
Cloning into '/home/gianluca1/pybricks-micropython/micropython'...
Submodule path 'micropython': checked out '36d21a31598698201bfe8ed544cec6faf2dee056'
Use 'make ' to build a brick.

Ora siamo pronti per lanciare la compilazione vera e propria del firmware.
Nello specifico, ho avviato la compilazione del solo firmware per il Control+/Technic Hub, usando il comando make cplushub
(I vari Hub sono identificati come movehub, cityhub, cplushub, primehub, nxt, ev3dev-armel)
Nota: E’ anche possibile lanciare la compilazione per tutte le piattaforme con il comando make all

gianluca1@UbuntuPC:~/pybricks-micropython$ make cplushub
make[1]: ingresso nella directory "/home/gianluca1/pybricks-micropython/micropython/mpy-cross"
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
make[1]: uscita dalla directory "/home/gianluca1/pybricks-micropython/micropython/mpy-cross"
make[1]: ingresso nella directory "/home/gianluca1/pybricks-micropython/bricks/cplushub"
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
GEN build/genhdr/qstr.i.last
GEN build/genhdr/qstr.split
GEN build/genhdr/qstrdefs.collected.h
QSTR updated
GEN build/genhdr/qstrdefs.generated.h
mkdir -p build/bricks/stm32/
mkdir -p build/extmod/
mkdir -p build/lib/ble5stack/central/
mkdir -p build/lib/contiki-core/lib/
mkdir -p build/lib/contiki-core/sys/
mkdir -p build/lib/embed/
mkdir -p build/lib/libfixmath/libfixmath/
mkdir -p build/lib/lsm6ds3tr_c_STdC/driver/
mkdir -p build/lib/pbio/drv/adc/
mkdir -p build/lib/pbio/drv/battery/
mkdir -p build/lib/pbio/drv/button/
mkdir -p build/lib/pbio/drv/counter/
mkdir -p build/lib/pbio/drv/cplus_hub/
mkdir -p build/lib/pbio/drv/gpio/
mkdir -p build/lib/pbio/drv/ioport/
mkdir -p build/lib/pbio/drv/uart/
mkdir -p build/lib/pbio/drv/usb/
mkdir -p build/lib/pbio/platform/cplus_hub/
mkdir -p build/lib/pbio/src/
mkdir -p build/lib/utils/
mkdir -p build/micropython/lib/libc/
mkdir -p build/micropython/lib/libm/
mkdir -p build/micropython/lib/mp-readline/
mkdir -p build/micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/
mkdir -p build/micropython/lib/utils/
mkdir -p build/py/
CC ../../micropython/py/mpstate.c
CC ../../micropython/py/nlr.c
CC ../../micropython/py/nlrx86.c
CC ../../micropython/py/nlrx64.c
CC ../../micropython/py/nlrthumb.c
CC ../../micropython/py/nlrpowerpc.c
CC ../../micropython/py/nlrxtensa.c
CC ../../micropython/py/nlrsetjmp.c
CC ../../micropython/py/malloc.c
CC ../../micropython/py/gc.c
CC ../../micropython/py/pystack.c
CC ../../micropython/py/qstr.c
CC ../../micropython/py/vstr.c
CC ../../micropython/py/mpprint.c
CC ../../micropython/py/unicode.c
CC ../../micropython/py/mpz.c
CC ../../micropython/py/reader.c
CC ../../micropython/py/lexer.c
CC ../../micropython/py/parse.c
CC ../../micropython/py/scope.c
CC ../../micropython/py/compile.c
CC ../../micropython/py/emitcommon.c
CC ../../micropython/py/emitbc.c
CC ../../micropython/py/asmbase.c
CC ../../micropython/py/asmx64.c
CC ../../micropython/py/emitnx64.c
CC ../../micropython/py/asmx86.c
CC ../../micropython/py/emitnx86.c
CC ../../micropython/py/asmthumb.c
CC ../../micropython/py/emitnthumb.c
CC ../../micropython/py/emitinlinethumb.c
CC ../../micropython/py/asmarm.c
CC ../../micropython/py/emitnarm.c
CC ../../micropython/py/asmxtensa.c
CC ../../micropython/py/emitnxtensa.c
CC ../../micropython/py/emitinlinextensa.c
CC ../../micropython/py/emitnxtensawin.c
CC ../../micropython/py/formatfloat.c
CC ../../micropython/py/parsenumbase.c
CC ../../micropython/py/parsenum.c
CC ../../micropython/py/emitglue.c
CC ../../micropython/py/persistentcode.c
CC ../../micropython/py/runtime.c
CC ../../micropython/py/runtime_utils.c
CC ../../micropython/py/scheduler.c
CC ../../micropython/py/nativeglue.c
CC ../../micropython/py/pairheap.c
CC ../../micropython/py/ringbuf.c
CC ../../micropython/py/stackctrl.c
CC ../../micropython/py/argcheck.c
CC ../../micropython/py/warning.c
CC ../../micropython/py/profile.c
CC ../../micropython/py/map.c
CC ../../micropython/py/obj.c
CC ../../micropython/py/objarray.c
CC ../../micropython/py/objattrtuple.c
CC ../../micropython/py/objbool.c
CC ../../micropython/py/objboundmeth.c
CC ../../micropython/py/objcell.c
CC ../../micropython/py/objclosure.c
CC ../../micropython/py/objcomplex.c
CC ../../micropython/py/objdeque.c
CC ../../micropython/py/objdict.c
CC ../../micropython/py/objenumerate.c
CC ../../micropython/py/objexcept.c
CC ../../micropython/py/objfilter.c
CC ../../micropython/py/objfloat.c
CC ../../micropython/py/objfun.c
CC ../../micropython/py/objgenerator.c
CC ../../micropython/py/objgetitemiter.c
CC ../../micropython/py/objint.c
CC ../../micropython/py/objint_longlong.c
CC ../../micropython/py/objint_mpz.c
CC ../../micropython/py/objlist.c
CC ../../micropython/py/objmap.c
CC ../../micropython/py/objmodule.c
CC ../../micropython/py/objobject.c
CC ../../micropython/py/objpolyiter.c
CC ../../micropython/py/objproperty.c
CC ../../micropython/py/objnone.c
CC ../../micropython/py/objnamedtuple.c
CC ../../micropython/py/objrange.c
CC ../../micropython/py/objreversed.c
CC ../../micropython/py/objset.c
CC ../../micropython/py/objsingleton.c
CC ../../micropython/py/objslice.c
CC ../../micropython/py/objstr.c
CC ../../micropython/py/objstrunicode.c
CC ../../micropython/py/objstringio.c
CC ../../micropython/py/objtuple.c
CC ../../micropython/py/objtype.c
CC ../../micropython/py/objzip.c
CC ../../micropython/py/opmethods.c
CC ../../micropython/py/sequence.c
CC ../../micropython/py/stream.c
CC ../../micropython/py/binary.c
CC ../../micropython/py/builtinimport.c
CC ../../micropython/py/builtinevex.c
CC ../../micropython/py/builtinhelp.c
CC ../../micropython/py/modarray.c
CC ../../micropython/py/modbuiltins.c
CC ../../micropython/py/modcollections.c
CC ../../micropython/py/modgc.c
CC ../../micropython/py/modio.c
CC ../../micropython/py/modmath.c
CC ../../micropython/py/modcmath.c
CC ../../micropython/py/modmicropython.c
CC ../../micropython/py/modstruct.c
CC ../../micropython/py/modsys.c
CC ../../micropython/py/moduerrno.c
CC ../../micropython/py/modthread.c
CC ../../micropython/py/vm.c
CC ../../micropython/py/bc.c
CC ../../micropython/py/showbc.c
CC ../../micropython/py/repl.c
CC ../../micropython/py/smallint.c
CC ../../micropython/py/frozenmod.c
CC ../../micropython/extmod/moduasyncio.c
CC ../../micropython/extmod/moductypes.c
CC ../../micropython/extmod/modujson.c
CC ../../micropython/extmod/modure.c
CC ../../micropython/extmod/moduzlib.c
CC ../../micropython/extmod/moduheapq.c
CC ../../micropython/extmod/modutimeq.c
CC ../../micropython/extmod/moduhashlib.c
CC ../../micropython/extmod/moducryptolib.c
CC ../../micropython/extmod/modubinascii.c
CC ../../micropython/extmod/virtpin.c
CC ../../micropython/extmod/machine_mem.c
CC ../../micropython/extmod/machine_pinbase.c
CC ../../micropython/extmod/machine_signal.c
CC ../../micropython/extmod/machine_pulse.c
CC ../../micropython/extmod/machine_i2c.c
CC ../../micropython/extmod/machine_spi.c
CC ../../micropython/extmod/modbluetooth.c
CC ../../micropython/extmod/modussl_axtls.c
CC ../../micropython/extmod/modussl_mbedtls.c
CC ../../micropython/extmod/modurandom.c
CC ../../micropython/extmod/moduselect.c
CC ../../micropython/extmod/moduwebsocket.c
CC ../../micropython/extmod/modwebrepl.c
CC ../../micropython/extmod/modframebuf.c
CC ../../micropython/extmod/vfs.c
CC ../../micropython/extmod/vfs_blockdev.c
CC ../../micropython/extmod/vfs_reader.c
CC ../../micropython/extmod/vfs_posix.c
CC ../../micropython/extmod/vfs_posix_file.c
CC ../../micropython/extmod/vfs_fat.c
CC ../../micropython/extmod/vfs_fat_diskio.c
CC ../../micropython/extmod/vfs_fat_file.c
CC ../../micropython/extmod/vfs_lfs.c
CC ../../micropython/extmod/utime_mphal.c
CC ../../micropython/extmod/uos_dupterm.c
CC ../../micropython/lib/embed/abort_.c
CC ../../micropython/lib/utils/printf.c
CC ../../bricks/stm32/main.c
CC ../../bricks/stm32/pbdevice.c
CC ../../bricks/stm32/systick.c
CC ../../bricks/stm32/uart_core.c
CC ../../micropython/lib/libc/string0.c
CC ../../micropython/lib/mp-readline/readline.c
CC ../../micropython/lib/utils/interrupt_char.c
CC ../../micropython/lib/utils/pyexec.c
CC ../../micropython/lib/utils/stdout_helpers.c
AS ../../lib/pbio/platform/cplus_hub/startup.s
AS ../../micropython/lib/utils/gchelper_m0.s
CC ../../extmod/modbattery.c
CC ../../extmod/modbuiltins.c
CC ../../extmod/modbuttons.c
CC ../../extmod/moddebug.c
CC ../../extmod/modexperimental.c
CC ../../extmod/modhubs.c
CC ../../extmod/modiodevices.c
CC ../../extmod/modlogger.c
CC ../../extmod/modmotor.c
CC ../../extmod/modparameters.c
CC ../../extmod/modpupdevices.c
CC ../../extmod/modrobotics.c
CC ../../extmod/modtools.c
CC ../../extmod/moduos.c
CC ../../extmod/pbhsv.c
CC ../../py/pb_type_enum.c
CC ../../py/pberror.c
CC ../../py/pbobj.c
CC ../../lib/ble5stack/central/att.c
CC ../../lib/ble5stack/central/gap.c
CC ../../lib/ble5stack/central/gatt.c
CC ../../lib/ble5stack/central/hci_ext.c
CC ../../lib/ble5stack/central/hci.c
CC ../../lib/ble5stack/central/util.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_lpuart.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_rcc.c
CC ../../micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_usart.c
CC ../../lib/lsm6ds3tr_c_STdC/driver/lsm6ds3tr_c_reg.c
CC ../../lib/contiki-core/lib/ringbuf.c
CC ../../lib/contiki-core/sys/autostart.c
CC ../../lib/contiki-core/sys/etimer.c
CC ../../lib/contiki-core/sys/process.c
CC ../../lib/contiki-core/sys/timer.c
CC ../../lib/libfixmath/libfixmath/fix16_sqrt.c
CC ../../lib/libfixmath/libfixmath/fix16_str.c
CC ../../lib/libfixmath/libfixmath/fix16.c
CC ../../lib/libfixmath/libfixmath/uint32.c
CC ../../lib/pbio/drv/cplus_hub/bluetooth.c
CC ../../lib/pbio/drv/cplus_hub/light.c
CC ../../lib/pbio/drv/cplus_hub/motor.c
CC ../../lib/pbio/drv/adc/adc_stm32_hal.c
CC ../../lib/pbio/drv/adc/adc_stm32f0.c
CC ../../lib/pbio/drv/battery/battery_adc.c
CC ../../lib/pbio/drv/button/button_adc.c
CC ../../lib/pbio/drv/button/button_gpio.c
CC ../../lib/pbio/drv/counter/counter_core.c
CC ../../lib/pbio/drv/counter/counter_stm32f0_gpio_quad_enc.c
CC ../../lib/pbio/drv/gpio/gpio_stm32f0.c
CC ../../lib/pbio/drv/gpio/gpio_stm32f4.c
CC ../../lib/pbio/drv/gpio/gpio_stm32l4.c
CC ../../lib/pbio/drv/ioport/ioport_lpf2.c
CC ../../lib/pbio/drv/uart/uart_stm32_hal.c
CC ../../lib/pbio/drv/uart/uart_stm32f0.c
CC ../../lib/pbio/drv/uart/uart_stm32l4_ll.c
CC ../../lib/pbio/drv/usb/stm32_usb_serial.c
CC ../../lib/pbio/platform/cplus_hub/clock.c
CC ../../lib/pbio/platform/cplus_hub/platform.c
CC ../../lib/pbio/platform/cplus_hub/sys.c
CC ../../lib/pbio/src/control.c
CC ../../lib/pbio/src/dcmotor.c
CC ../../lib/pbio/src/drivebase.c
CC ../../lib/pbio/src/error.c
CC ../../lib/pbio/src/integrator.c
CC ../../lib/pbio/src/iodev.c
CC ../../lib/pbio/src/light.c
CC ../../lib/pbio/src/logger.c
CC ../../lib/pbio/src/main.c
CC ../../lib/pbio/src/math.c
CC ../../lib/pbio/src/motorpoll.c
CC ../../lib/pbio/src/servo.c
CC ../../lib/pbio/src/tacho.c
CC ../../lib/pbio/src/trajectory_ext.c
CC ../../lib/pbio/src/trajectory.c
CC ../../lib/pbio/src/uartdev.c
CC ../../micropython/lib/libm/acoshf.c
CC ../../micropython/lib/libm/asinfacosf.c
CC ../../micropython/lib/libm/asinhf.c
CC ../../micropython/lib/libm/atan2f.c
CC ../../micropython/lib/libm/atanf.c
CC ../../micropython/lib/libm/atanhf.c
CC ../../micropython/lib/libm/ef_rem_pio2.c
CC ../../micropython/lib/libm/ef_sqrt.c
CC ../../micropython/lib/libm/erf_lgamma.c
CC ../../micropython/lib/libm/fmodf.c
CC ../../micropython/lib/libm/kf_cos.c
CC ../../micropython/lib/libm/kf_rem_pio2.c
CC ../../micropython/lib/libm/kf_sin.c
CC ../../micropython/lib/libm/kf_tan.c
CC ../../micropython/lib/libm/log1pf.c
CC ../../micropython/lib/libm/math.c
CC ../../micropython/lib/libm/nearbyintf.c
CC ../../micropython/lib/libm/sf_cos.c
CC ../../micropython/lib/libm/sf_erf.c
CC ../../micropython/lib/libm/sf_frexp.c
CC ../../micropython/lib/libm/sf_ldexp.c
CC ../../micropython/lib/libm/sf_modf.c
CC ../../micropython/lib/libm/sf_sin.c
CC ../../micropython/lib/libm/sf_tan.c
CC ../../micropython/lib/libm/wf_lgamma.c
CC ../../micropython/lib/libm/wf_tgamma.c
MPY main.py
72 bytes
BIN creating firmware base file
156096 bytes
META creating firmware metadata
ZIP creating firmware package
  adding: firmware-base.bin (deflated 32%)
  adding: firmware.metadata.json (deflated 39%)
  adding: main.py (deflated 6%)
make[1]: uscita dalla directory "/home/gianluca1/pybricks-micropython/bricks/cplushub"
gianluca1@UbuntuPC:~/pybricks-micropython$

Al termine di questa procedura, nella directory /pybricks-micropython/bricks/cplushub/build avremo l’ouput dell’intera operazione.

In particolare, il file che ci interessa è firmware.zip, al cui interno sono presenti i file firmware-base.bin (il firmware vero e proprio), main.py (il nostro programma micropython predefinito) e, infine, firmware.metadata.json (un file testuale con alcuni informazioni sul firmware stesso).

A questo punto, si potrò caricare il firmware sull’Hub secondo la procedura illustrata nella documentazione di Pybrics.

Lascia una risposta

L'indirizzo email non verrà pubblicato.I campi obbligatori sono contrassegnati *