I am so excited to have MbitV2 in my hand so could not resist to try and run existing tensorflow micro_speech model on microbit.
I started to look an existing Espruino approach from this post to generate espruino compatible tflite model. I encountered so many issues while convert existing model(hello world/sin wave), creating new model(speach), and even building espruino for mBitV2.
1 - Convert existing hello_world model
This code is no longer working with the new notebook.
To get more space on Microbit I tried to remove 'NEOPIXEL' module from the board file and build make clean && BOARD=MICROBIT2 make.
But I got errors right after elf file is created
here is the truncated log
......
...
...
/mnt/c/Users/ABHINAV.000/Documents/esp/Espruino/targetlibs/nrf5x_12/components/drivers_nrf/hal/nrf_gpio.h:648:22: warning: inlining failed in call to 'nrf_gpio_pin_write': call is unlikely and code size would grow [-Winline]
__STATIC_INLINE void nrf_gpio_pin_write(uint32_t pin_number, uint32_t value)
^
targets/nrf5x/jshardware.c:740:9: note: called from here
nrf_gpio_pin_write(MB_LED_COL2, i&1);
^
/mnt/c/Users/ABHINAV.000/Documents/esp/Espruino/targetlibs/nrf5x_12/components/drivers_nrf/hal/nrf_gpiote.h:322:22: warning: inlining failed in call to 'nrf_gpiote_event_clear': call is unlikely and code size would grow [-Winline]
__STATIC_INLINE void nrf_gpiote_event_clear(nrf_gpiote_events_t event)
^
targetlibs/nrf5x_12/components/drivers_nrf/gpiote/nrf_drv_gpiote.c:251:5: note: called from here
nrf_gpiote_event_clear(NRF_GPIOTE_EVENTS_PORT);
^
targets/nrf5x/jshardware.c: In function 'dly.isra.0':
/mnt/c/Users/ABHINAV.000/Documents/esp/Espruino/targetlibs/nrf5x_12/components/drivers_nrf/delay/nrf_delay.h:162:22: warning: inlining failed in call to 'nrf_delay_us': call is unlikely and code size would grow [-Winline]
__STATIC_INLINE void nrf_delay_us(uint32_t number_of_us)
^
targets/nrf5x/jshardware.c:961:3: note: called from here
nrf_delay_us((uint32_t)microsec);
^
src/jsutils.c: In function 'jsAssertFail':
/mnt/c/Users/ABHINAV.000/Documents/esp/Espruino/targetlibs/nrf5x_12/components/toolchain/cmsis/include/core_cm4.h:1790:22: warning: inlining failed in call to 'NVIC_SystemReset': call is unlikely and code size would grow [-Winline]
__STATIC_INLINE void NVIC_SystemReset(void)
^
src/jsutils.c:374:3: note: called from here
NVIC_SystemReset();
^
/mnt/c/Users/ABHINAV.000/Documents/esp/Espruino/targetlibs/nrf5x_12/components/toolchain/cmsis/include/core_cm4.h:1790:22: warning: inlining failed in call to 'NVIC_SystemReset': call is unlikely and code size would grow [-Winline]
__STATIC_INLINE void NVIC_SystemReset(void)
^
src/jsutils.c:374:3: note: called from here
NVIC_SystemReset();
^
python scripts/check_elf_size.py MICROBIT2 espruino_2v08.93_microbit2.elf
Testing espruino_2v08.93_microbit2.elf for MICROBIT2
STORAGE: 442368 -> 483328
FS DATA: 465824 -> 465840 (16 bytes)
CODE: 126976 -> 465840 (338612 bytes)
==========================
CODE AND STORAGE OVERLAP
by 23472 bytes
==========================
make/common/NRF5X.make:440: recipe for target 'espruino_2v08.93_microbit2.app_hex' failed
make: *** [espruino_2v08.93_microbit2.app_hex] Error 1
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
New Updates:
I am so excited to have MbitV2 in my hand so could not resist to try and run existing tensorflow micro_speech model on microbit.
I started to look an existing Espruino approach from this post to generate espruino compatible tflite model. I encountered so many issues while convert existing model(hello world/sin wave), creating new model(speach), and even building espruino for mBitV2.
1 - Convert existing hello_world model
This code is no longer working with the new notebook.
but this works
After fixing the base64 stuff, i tried to run the same example in emulator but it neither gives any error nor expected outcome.
Original example vs Updated example
2- "Prompt not detected - upload failed" error
I am getting upload error when trying to upload this code direct to RAM.
Is this related to Low RAM or Flash??? How can I fix this?
Microbit is flashed this hex
3- Build error.
To get more space on Microbit I tried to remove 'NEOPIXEL' module from the board file and build
make clean && BOARD=MICROBIT2 make
.But I got errors right after elf file is created
here is the truncated log