tensorflow / tflite-micro

Infrastructure to enable deployment of ML models to low-power resource-constrained embedded targets (including microcontrollers and digital signal processors).
Apache License 2.0
1.96k stars 833 forks source link

failed to flash the micro_speech example to SparkFun Edge #1873

Closed chtfrank closed 1 year ago

chtfrank commented 1 year ago

Hi all, I have issued the problem on https://github.com/advaitjain/tflite-micro-sparkfun-edge-examples/issues/63, where is the repo specified for SparkFun Edge. But I think here seems to be more activated. Actually I have successfully compiled the micro_speech example with a result bin file ~5.2Mb, and I always failed to flash it into the board with no respond error. I copy the details here for more help. Thanks in advance.

I use the Apple Os, and have installed all the tools required, such as python, make, git and so on. Here are my steps:

  1. clone this repo: git clone https://github.com/advaitjain/tflite-micro-sparkfun-edge-examples.git
  2. cd into the directory, and type: make TARGET=sparkfun_edge micro_speech
  3. during the make process, the arm compiler was downloaded success into the downloads directory.
  4. the process finished without any error and the result file was saved at gen/bin/micro_speech, also the libtflm.a.
  5. I prepared the OTA bin and Wired bin files according to the steps of the tutorial: https://codelabs.developers.google.com/codelabs/sparkfun-tensorflow#3, but with the offical AmbiqSuite SDK: https://github.com/sparkfun/AmbiqSuiteSDK. Because I found we dont have some tools, such as AmbiqSuite-Rel2.2.0/tools/*. Then I got some size warnings like: python tools/apollo3_scripts/create_cust_wireupdate_blob.py --load-address 0x20000 --bin micro_speech_ota.bin -i 6 -o micro_speech_wire --options 0x1 Header Size = 0x60 app_size 0x4f69a4 ( 5204388 ) Image size bigger than max - Creating Split image Writing to file micro_speech_wire.bin Image from 0x0 to 0x48000 will be loaded at 0x20000 Writing to file micro_speech_wire.bin Image from 0x48000 to 0x90000 will be loaded at 0x68000 Writing to file micro_speech_wire.bin Image from 0x90000 to 0xd8000 will be loaded at 0xb0000 Writing to file micro_speech_wire.bin Image from 0xd8000 to 0x120000 will be loaded at 0xf8000 Writing to file micro_speech_wire.bin Image from 0x120000 to 0x168000 will be loaded at 0x140000 Writing to file micro_speech_wire.bin Image from 0x168000 to 0x1b0000 will be loaded at 0x188000 Writing to file micro_speech_wire.bin Image from 0x1b0000 to 0x1f8000 will be loaded at 0x1d0000 Writing to file micro_speech_wire.bin Image from 0x1f8000 to 0x240000 will be loaded at 0x218000 Writing to file micro_speech_wire.bin Image from 0x240000 to 0x288000 will be loaded at 0x260000 Writing to file micro_speech_wire.bin Image from 0x288000 to 0x2d0000 will be loaded at 0x2a8000 Writing to file micro_speech_wire.bin Image from 0x2d0000 to 0x318000 will be loaded at 0x2f0000 Writing to file micro_speech_wire.bin Image from 0x318000 to 0x360000 will be loaded at 0x338000 Writing to file micro_speech_wire.bin Image from 0x360000 to 0x3a8000 will be loaded at 0x380000 Writing to file micro_speech_wire.bin Image from 0x3a8000 to 0x3f0000 will be loaded at 0x3c8000 Writing to file micro_speech_wire.bin Image from 0x3f0000 to 0x438000 will be loaded at 0x410000 Writing to file micro_speech_wire.bin Image from 0x438000 to 0x480000 will be loaded at 0x458000 Writing to file micro_speech_wire.bin Image from 0x480000 to 0x4c8000 will be loaded at 0x4a0000 Writing to file micro_speech_wire.bin Image from 0x4c8000 to 0x4f69a4 will be loaded at 0x4e8000
  6. Anyway, the wired bin is generated successfully, then I used the python script to flash the Wired bin file to my SparkFun Edge Board, according to the tutorial: https://codelabs.developers.google.com/codelabs/sparkfun-tensorflow#5, but I was failed with no Response error.
  7. I think I operated correctly when pressing and releasing the buttons, since I successfully flash the example bin file from the offical AmbiqSuite SDK BSP repo: https://github.com/sparkfun/SparkFun_Apollo3_AmbiqSuite_BSPs/tree/6398086a1a87ddea78274521683ba3ad817bee82/edge/examples/tensorflow_micro_speech , accordind to the SparkFun tutorial: https://learn.sparkfun.com/tutorials/using-sparkfun-edge-board-with-ambiq-apollo3-sdk/example-applications
  8. I was surprised to find that the size of the generated bin file gen/bin/micro_speech here (~5.2Mb) is larger than the pre-compiled one in SparkFun_Apollo3_AmbiqSuite_BSPs repo (98Kb), which may result in the warning in step 6 and finally lead to the failure of flashing.
  9. I changed to the Ubuntu and Windows, but still cannot flash successfully.

图片

I donnt know how to search the solution, it has taken many days for me to find the answer.

github-actions[bot] commented 1 year ago

"This issue is being marked as stale due to inactivity. Remove label or comment to prevent closure in 5 days."

github-actions[bot] commented 1 year ago

"This issue is being closed because it has been marked as stale for 5 days with no further activity."