SparkFun Forums 

Where electronics enthusiasts find answers.

Tips, tricks, & best best practices using Artemis with your board designs.
#209058
I am working on getting the Micro Voice demo working on the Artemis RedBoard. I have been taking the steps used to get it working on the Edge and Edge 2, and just running it. There is a general walk through here: https://codelabs.developers.google.com/ ... sorflow/#0

I am pretty sure I need to point to the BSP for the RedBoard instead. I have managed to at least get it to compile and have it spit out some info over Serial.

I am running this on OSX. You will have to use brew or MacPorts to get a newer version of make and then make sure the updated version is used as the default.

I am using the SparkFun fork of TensorFlow, which @liquid.soulder has been updating to work with the Edge 2 and the latest version of the Ambiq SDK.

Here are the steps I take:
Code: Select all
git clone https://github.com/sparkfun/tensorflow.git
cd tensorflow
gmake -f tensorflow/lite/experimental/micro/tools/make/Makefile TARGET=sparkfun_edge2 micro_speech_bin  
Oddly, I have to run this twice because I get a sed error. it works fine the second time.

I then use this command to flash the compiled bin. In order to flash, I need to pull the boot loader pin high. Follow the directions here: viewtopic.php?f=168&t=50825#p207893
Basically, connect a jump wire to 3.3v. Touch the other end to the right side of the resistor that is above LED 13. With this connection made, hit the reset button. Continue to keep the connection and then run the following command:
Code: Select all
python3 tensorflow/lite/experimental/micro/tools/make/downloads/AmbiqSuite-Rel2.2.0/boards_sfe/common/tools_sfe/ambiq/ambiq_bin2board.py --bin tensorflow/lite/experimental/micro/tools/make/gen/sparkfun_edge2_cortex-m4/bin/micro_speech.bin --load-address-blob 0x20000 --magic-num 0xCB -o main_nonsecure_ota --version 0x0 --load-address-wired 0xC000 -i 6 --options 0x1 -b 115200 -port /dev/cu.usbserial-1410 -r 2 -v

After doing all of that... all I get is the follow if I open up serial monitor:
Code: Select all
FPU Enabled.

PDM DMA Threshold = 16
I am going to go in and try modifying the Makefile to point to the correct BSP for the RedBoard. I will keep this thread updated as I make progress. If anyone has figured this out, please contribute!
#209068
OK! I got MicroVoice working on a RedBoard!

It is still a little wonky... and there is some debug code in there that appears to be structural. There is some sort of timing or interrupt issue and if you remove the debug statements I added, it breaks. Those debug messages are in command_reciever.cc on lines 52, 56 & 60. I will try to hunt down the root cause, but wanted to pass this progress along because it is fun to play with.

My fork of the SparkFun branch is here: https://github.com/robotastic/tensorflo ... 7eb0cfe9d7

This code should build the bin:
Code: Select all
gmake -f tensorflow/lite/experimental/micro/tools/make/Makefile TARGET=sparkfun_redboard_artemis micro_speech_bin  
Use the flashing technique described above and the following command to flash:
Code: Select all
python3 tensorflow/lite/experimental/micro/tools/make/downloads/AmbiqSuite-Rel2.2.0/boards_sfe/common/tools_sfe/ambiq/ambiq_bin2board.py --bin tensorflow/lite/experimental/micro/tools/make/gen/sparkfun_redboard_artemis_cortex-m4/bin/micro_speech.bin --load-address-blob 0x20000 --magic-num 0xCB -o main_nonsecure_ota --version 0x0 --load-address-wired 0xC000 -i 6 --options 0x1 -b 115200 -port /dev/cu.usbserial-1410 -r 2 -v
Now, open up Serial Monitor and say Yes or No. I have found making it a really long Noooooo seems to help with recognition.
#209385
I updated my code against the latest version of Tensorflow and things are working a lot more reliably. I have tested against the Redboard Artemis and Edge 2. Folks have also reported it work with the ATP. This is for the Micro-Voice example.

I also figured out that I was having trouble flashing the board and having to use a jumper wire because I didn't have a current version of the CH340 driver installed.

Checkout the sparkfun_artemis branch of this repo:
https://github.com/robotastic/tensorflo ... un_artemis