TensorFlow lite for the MDBT42Q 2v04 #3339
Replies: 11 comments
-
|
Posted at 2019-12-12 by @gfwilliams No, I'm afraid not. It's something that you'd have to compile in yourself (just adding |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-12-12 by user106664 Thanks for the quick response Gordon. I’ll give it a try. To check for a custom build example cli is below. python MDBT42Q.py -k -p MySerialPort -evw espruino_for_your_device.bin. For the original Espruino is the build file ESPRUINOBOARD.py Finally is the entry point for the TensorFlow api var tf = require("tensorflow").create(2048, model). I had a look at the documentation on the website but couldn’t see anything for TensorFlow. Looking forward to getting the Bangle board, tensorflow addition is exciting. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-12-16 by @gfwilliams
That doesn't look right at all... Loads of info on building here: https://github.com/espruino/Espruino/blob/master/README_Building.md And Tensorflow usage here: If you just want to try it out, have a go with the emulator, which has Tensorflow built in: https://www.espruino.com/ide/emulator.html?gist=c0404a867b3531527428a1843c5fd5fc&upload |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-04-26 by user106664 Gordon, update on this removed networking most other libraries (FILESYSTEM, NFC, NEOPIXEL) and still having difficulty getting this to fit. The only way i'm able to get it to fit is if tensorflow is the only library. Error below. python scripts/check_elf_size.py MDBT42Q espruino_2v05.22_mdbt42q.elf |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-04-26 by AkosLukacs The MDBT42Q also uses 40k of internal flash to store saved JS code compared to the Bangle. You could try to reduce that in the MDBT42's board file, but if you remove too much, well, you won't be able to save JS code: The Bangle has external flash, so doesn't use internal flash to store saved code. But you can compare the two board files. Or solder an external flash on the MDBT42Q :) |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-04-26 by @fanoush Without external flash you can also save a bit by downgrading to SDK11 - gives you 0x1f000-0x1c000=12KB and also the bootloader can be moved by 8KB 0x78000 to 0x7a000 - giving you 20KB in total, not much and quite tricky to do. Also you can do build without bootloader if you use SWD debugger to upload the firmware. This gives you 32KB more compared to current state. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-04-27 by @gfwilliams Are you definitely building with |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-04-27 by user106664 Thanks for the info. > You could try to reduce that in the MDBT42's board file With number of pages reduced to 6 from 10 I was to include the bluetooth and graphics. Not sure as yet of consequence tho as aware that importing modules such sensor drivers are stored in flash. Using external flash likely a better solution just not sure of the workflow. Is there a way through the IDE to save js application directly to external flash (assuming storage/flash object only work with internal flash). Or will I have to save it to external flash manually, for example convert a module / function to templated string then use SPI flash(https://www.espruino.com/W25), and potentially split to store into pages sectors. I will likely need to leave some room on internal flash to manage this. > Without external flash you can also save a bit by downgrading to SDK11 - gives you 0x1f000-0x1c000=12KB and also the bootloader can be moved by 8KB 0x78000 to 0x7a000 > Are you definitely building with RELEASE=1 on the command-line? Without that, the assertions are left in and it really pushes the size up this is the command i'm running. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-04-27 by @gfwilliams
That definitely should be fine. I guess you're just limited by the size of Tensorflow then. You could definitely use external flash. Actually as you're building your own firmware you could look at what Bangle.js does with |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-04-27 by @fanoush
Was thinking about actually move only some storage to external memory. How easy is to have code in Storage in internal flash and then have second instance of Storage object/module for data in external SPI memory? Or maybe have one Storage but multiple drives or paths like ".boot0" in internal as before and "ext:data.bin" or "ext/data.bin" in external? But two instances like e.g. SPI objects could be easier - just a flag which one it is. I guess modules cannot have parameters like require.("Storage","internal") or require("Storage")("internal") like described here? Idea is that code is relatively small and can run in-place in internal flash but data can be large. Also running code in internal flash may draw less power when javascript source is not continuously interpreted by reading over SPI. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-04-27 by @fanoush
If uploading over SWD then basically yes, look how banglejs is done. With only using DFU package it is more complicated to install such moved bootloader. You first need custom build of espruino with one more line added to as per comment here then you need to erase UICR area in NRF.onRestart method, write bootloader via espruino Flash module and then write new bootloader location to UICR. I have done it few days ago, several times, have scripts for this. Not hard and not even that much dangerous unless the bootloader binary you flash is not working. This was all only about moving bootloader, downgrading SDK is more complex if you need bootloader as there is no bootloader for SDK11 in espruino source so you need to get another one, e.g. from nordic examples. Without bootloader, with SWD flashing it is quite easy as the source builds as is with this extracted and you get 12+32KB |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2019-12-12 by user106664
Does the latest firmware 2v04 include TensorFlow lite for the MDBT42Q?
Beta Was this translation helpful? Give feedback.
All reactions