It could be a lot of things…
- Verify Model Compatibility
Ensure that your model is compatible with the SparkFun Edge board. The board uses TensorFlow Lite for Microcontrollers, so the model must be converted appropriately using the TensorFlow Lite converter for microcontrollers.
- Model Conversion
Double-check that you have correctly converted your model to a .bin file using the TensorFlow Lite converter. Make sure the conversion process includes optimization steps suitable for microcontrollers.
- Check Makefile Modifications
Ensure that you have correctly modified the Makefile to point to your custom model’s .bin file. Verify that the path and file name are correct and that there are no typos.
- Flashing Process
Retry Flashing: Sometimes, simply retrying the flashing process can resolve intermittent communication issues.
Reduce File Size: If your model’s .bin file is significantly larger than the example provided, it might cause issues. Try using a smaller model to see if the flashing process succeeds.
- Debugging the Error
The specific error messages you received (Received NACK, error = 0x7, Upload failed: No ack to command) indicate an acknowledgment issue during the flashing process. This could be due to several reasons:
Buffer Overflow: The data being sent might be too large for the buffer on the board. Try reducing the size of your model and see if the problem persists.
Communication Timeout: There might be a timeout issue during the data transfer. Ensure that your VM and host machine are not causing delays in communication.
- Virtual Machine Considerations
Running on a virtual machine adds another layer of complexity. Ensure that the VM has sufficient resources allocated and that USB pass-through is correctly set up to communicate with the SparkFun Edge board…if you have another PC/board that runs linux you can use it to test as well
You could also verify your work process by renaming the default bin file(s) and confirming that an otherwise default bin (renamed) uploads and works correctly
Finally, GPT4 thinks this will work:
Example Makefile Section
Ensure your Makefile section for flashing your model looks something like this:
MODEL_BIN := tensorflow_person_detection.bin
# Change to your custom model file name
MODEL_BIN := your_custom_model.bin
flash: $(MODEL_BIN)
@echo "Flashing $(MODEL_BIN) to the board"
python3 flash.py --bin $(MODEL_BIN)
Replace your_custom_model.bin with the exact name of your converted .bin file.