TinyML
for SparkFun Edge
May 15, 2020
• Sparkfun Edge board 介紹
• 準備好軟體開發環境
• 關於Ambiq Apollo3 SDK
• 編譯程式、產生韌體燒錄檔
• 將燒錄檔寫入至 Sparkfun Edge board
• 連接終端機
Outline
About Sparkfun Edge board
Sparkfun Edge board x1
Sparkfun USB-to-Serial Adapter x1 (CH340E chip)
microUSB wire x1
Himax CMOS Imaging Camera - HM01B0 x1
MCU (Apollo3 Blue)
• 32-bit ARM Cortex-M4F
• 48MHz CPU clock, 96MHz with TurboSPOT™
• 1MB Flash
• 384KB SRAM
• Extremely low-power usage: 6uA/MHz
Sensor
• two microphones
• 3-axis accelerometer
• camera connector
Connections
• Serial UART
• Qwiic connector (need Qwiic cables )
• Bluetooth Radio
• four LEDs and four GPIO connections
• JTAG Connector
Sparkfun Edge board
https://learn.sparkfun.com/tutorials/sparkfun-edge-hookup-
guide?_ga=2.52218401.900382962.1598838491-
96125856.1586318981#hardware-overview
Block Diagram of Apollo3 Blue MCU
Reset Button
UART connector
GPIO Button
MICx2
Qwiic connector
GPIO connections x4
Bluetooth Radio
LED x4
Camera connector
JTAG Connector
Accelerometer
MCU
Linux 系統
• 目的: Building the firmware for Sparkfun Edge Board
• OS: Ubuntu 18.04
**可參考本文章 ” Virtual Box建置Linux主機”
https://bit.ly/2RE0hK8
Windows 系統
• 目的: Training the Tensor flow model
• 所需軟體:
• Anaconda https://www.anaconda.com
• Python 3.7 and TensorFlow 2.0
• MobaXterm https://mobaxterm.mobatek.net/
• Serial to USB driver (CH340)
準備好軟體開發環境
Using SparkFun Edge Board with
Ambiq Apollo3 SDK
Layout of Ambiq Apollo3 SDK
BSP Layout of SparkFun_Edge
Setup Toolchain & build project
# Setup Toolchain
=====================
export
PATH=~/tinyML/tensorflow/lite/micro/tools/make/downloads/gcc_embedded/bin:$PATH
可以將此行加入到 ~/.bashrc內
#Build the Frist Example for test
==============
example1_edge_test/
├── gcc
│ ├── bin
│ ├── edge_test.ld
│ ├── Makefile
│ └── startup_gcc.c
├── Makefile
└── src
├── main.c
├── tf_accelerometer
└── tf_adc
>> cd SparkFun_Edge_SDK/AmbiqSuite-
Rel2.2.0/boards/SparkFun_Edge_BSP-
master/examples/example1_edge_test/gcc
>> make
==> it will output bin/example1_edge_test.bin
產生燒錄檔 & 寫入燒錄檔到板子
Genearte firmware 產生燒錄檔 xxx_wire.bin
====================
[on Linux]
cd apollo3_scripts
#copy xxx.bin to here
cp ../tensorflow/lite/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/
example1_edge_test.bin .
./build_fw.sh example1_edge_test.bin
==> example1_edge_test_wire.bin
Screenshot after ./build_fw.sh
將 binary 加上 header  signed binary
再將signed binary 加入燒錄資訊
1.) 先將Sparkfun 透過 USB 線連接 PC
2.) 再檢查所有USB-to-Serial裝置
• Linux : 在終端機輸入 ls /dev/ttyUSB0
• MacOS : 輸入 ls /dev/cu.usbserial*
• Windows : 在裝置管理員檢查COM (此處為COM14)
燒入前檢查
Windows 須先安裝CH340 Driver
遵循以下步驟
1. 確認 Sparkfun edge board已經連接到 PC (USB-to-Serial 轉板 )
2. 先持續按著Button 14, 再按 button RST (進入燒錄模式)
3. 接著在[Anaconda Prompt ],
要切換到 apollo3_scripts 目錄, 輸入下列指令
python uart_wired_update.py COM14 -f example1_edge_test_wire.bin
在windows上燒錄bin檔到edge board
*須先安裝pyserial 套件
pip install pyserial
COM14 不能被其他程式佔用!!
COM14 is your COM PORT NUMBER
ScreenShot
Done means Success
You can use TeraTerm or putty
Display the output message from Edge board
[Setup->Serial Port ]
baud rate: 115200 bps, 8 N 1
Code Architecture
• UART printing for info/debugging
• ADC operation to sample from a microphone
• I2C operation to control the accelerometer
• GPIO functions (an output that can drive up to 12 mA)
"hal/am_hal_adc.h"
"hal/am_hal_gpio.h"
"hal/am_hal_uart.h"
mcu/apollo3/am_mcu_apollo.h
……………
MCU
pin
Board (Sparkfun Edge)
./boards/SparkFun_Edge_BSP-
master/bsp/am_bsp_pins.h
Application
MCU register R/W
Hardware
Abstraction Layer
(HAL)
Code Study

More Related Content

PDF
TinyML - 4 speech recognition
PPTX
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
PDF
Arm device tree and linux device drivers
PDF
Embedded Linux BSP Training (Intro)
PPTX
Linux SD/MMC device driver
PPT
Linux SD/MMC Driver Stack
PPTX
PCI express
PDF
Ixgbe internals
TinyML - 4 speech recognition
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Arm device tree and linux device drivers
Embedded Linux BSP Training (Intro)
Linux SD/MMC device driver
Linux SD/MMC Driver Stack
PCI express
Ixgbe internals

What's hot (20)

PPTX
eMMC 5.0 Total IP Solution
PPTX
What is Bootloader???
PDF
Dpdk pmd
PPTX
Linux Initialization Process (1)
PDF
U-Boot - An universal bootloader
PPTX
Linux MMAP & Ioremap introduction
PDF
Q4.11: Introduction to eMMC
PPTX
Bootloaders (U-Boot)
PDF
/proc/irq/<irq>/smp_affinity
PDF
How to Speak Intel DPDK KNI for Web Services.
PPTX
Timeline of Processors
PPTX
伺服馬達控制
PPTX
Linux Network Stack
PPTX
Polyphony の行く末(2018/3/3)
PDF
Introduction to Linux
PDF
Kernel Recipes 2018 - Overview of SD/eMMC, their high speed modes and Linux s...
PPTX
Unified Extensible Firmware Interface (UEFI)
PPTX
Linux Kernel MMC Storage driver Overview
PDF
Tensorflow lite for microcontroller
PPTX
eMMC Embedded Multimedia Card overview
eMMC 5.0 Total IP Solution
What is Bootloader???
Dpdk pmd
Linux Initialization Process (1)
U-Boot - An universal bootloader
Linux MMAP & Ioremap introduction
Q4.11: Introduction to eMMC
Bootloaders (U-Boot)
/proc/irq/<irq>/smp_affinity
How to Speak Intel DPDK KNI for Web Services.
Timeline of Processors
伺服馬達控制
Linux Network Stack
Polyphony の行く末(2018/3/3)
Introduction to Linux
Kernel Recipes 2018 - Overview of SD/eMMC, their high speed modes and Linux s...
Unified Extensible Firmware Interface (UEFI)
Linux Kernel MMC Storage driver Overview
Tensorflow lite for microcontroller
eMMC Embedded Multimedia Card overview
Ad

More from 艾鍗科技 (20)

PPTX
AI 技術浪潮, 什麼是機器學習? 什麼是深度學習, 什麼是生成式AI, AI 能力認證
PPTX
Appendix 1 Goolge colab
PPTX
Project-IOT於餐館系統的應用
PPTX
02 IoT implementation
PDF
Openvino ncs2
PDF
Step motor
PDF
2. 機器學習簡介
PDF
5.MLP(Multi-Layer Perceptron)
PDF
3. data features
PPTX
心率血氧檢測與運動促進
PPTX
利用音樂&情境燈幫助放鬆
PPTX
IoT感測器驅動程式 在樹莓派上實作
PPTX
無線聲控遙控車
PPT
最佳光源的研究和實作
PPTX
無線監控網路攝影機與控制自走車
PPTX
Reinforcement Learning
PPTX
Linux Device Tree
PPTX
人臉辨識考勤系統
PPTX
智慧家庭Smart Home
PPT
智能健身
AI 技術浪潮, 什麼是機器學習? 什麼是深度學習, 什麼是生成式AI, AI 能力認證
Appendix 1 Goolge colab
Project-IOT於餐館系統的應用
02 IoT implementation
Openvino ncs2
Step motor
2. 機器學習簡介
5.MLP(Multi-Layer Perceptron)
3. data features
心率血氧檢測與運動促進
利用音樂&情境燈幫助放鬆
IoT感測器驅動程式 在樹莓派上實作
無線聲控遙控車
最佳光源的研究和實作
無線監控網路攝影機與控制自走車
Reinforcement Learning
Linux Device Tree
人臉辨識考勤系統
智慧家庭Smart Home
智能健身
Ad

Recently uploaded (20)

PDF
Water Industry Process Automation & Control Monthly - September 2025
PPTX
INTERNET OF THINGS - EMBEDDED SYSTEMS AND INTERNET OF THINGS
PPTX
22ME926Introduction to Business Intelligence and Analytics, Advanced Integrat...
PPTX
highway-150803160405-lva1-app6891 (1).pptx
PDF
PhD defense presentation in field of Computer Science
PPTX
1. Effective HSEW Induction Training - EMCO 2024, O&M.pptx
PDF
CB Công Nghiệp Slide .dh bách khoa đà nẵng
PDF
The Journal of Finance - July 1993 - JENSEN - The Modern Industrial Revolutio...
PPTX
sinteringn kjfnvkjdfvkdfnoeneornvoirjoinsonosjf).pptx
PPTX
MODULE 02 - CLOUD COMPUTING-Virtual Machines and Virtualization of Clusters a...
PPTX
ARCHITECTURE AND PROGRAMMING OF EMBEDDED SYSTEMS
PPTX
Unit I - Mechatronics.pptx presentation
PPT
Basics Of Pump types, Details, and working principles.
PDF
Traditional Programming vs Machine learning and Models in Machine Learning
PPTX
Unit IILATHEACCESSORSANDATTACHMENTS.pptx
PDF
August 2025 Top Read Articles in - Bioscience & Engineering Recent Research T...
PPTX
non conventional energy resorses material unit-1
PPTX
240409 Data Center Training Programs by Uptime Institute (Drafting).pptx
PPTX
Module 1 – Introduction to Computer Networks: Foundations of Data Communicati...
PPTX
IOP Unit 1.pptx for btech 1st year students
Water Industry Process Automation & Control Monthly - September 2025
INTERNET OF THINGS - EMBEDDED SYSTEMS AND INTERNET OF THINGS
22ME926Introduction to Business Intelligence and Analytics, Advanced Integrat...
highway-150803160405-lva1-app6891 (1).pptx
PhD defense presentation in field of Computer Science
1. Effective HSEW Induction Training - EMCO 2024, O&M.pptx
CB Công Nghiệp Slide .dh bách khoa đà nẵng
The Journal of Finance - July 1993 - JENSEN - The Modern Industrial Revolutio...
sinteringn kjfnvkjdfvkdfnoeneornvoirjoinsonosjf).pptx
MODULE 02 - CLOUD COMPUTING-Virtual Machines and Virtualization of Clusters a...
ARCHITECTURE AND PROGRAMMING OF EMBEDDED SYSTEMS
Unit I - Mechatronics.pptx presentation
Basics Of Pump types, Details, and working principles.
Traditional Programming vs Machine learning and Models in Machine Learning
Unit IILATHEACCESSORSANDATTACHMENTS.pptx
August 2025 Top Read Articles in - Bioscience & Engineering Recent Research T...
non conventional energy resorses material unit-1
240409 Data Center Training Programs by Uptime Institute (Drafting).pptx
Module 1 – Introduction to Computer Networks: Foundations of Data Communicati...
IOP Unit 1.pptx for btech 1st year students

Tiny ML for spark Fun Edge

  • 2. • Sparkfun Edge board 介紹 • 準備好軟體開發環境 • 關於Ambiq Apollo3 SDK • 編譯程式、產生韌體燒錄檔 • 將燒錄檔寫入至 Sparkfun Edge board • 連接終端機 Outline
  • 3. About Sparkfun Edge board Sparkfun Edge board x1 Sparkfun USB-to-Serial Adapter x1 (CH340E chip) microUSB wire x1 Himax CMOS Imaging Camera - HM01B0 x1
  • 4. MCU (Apollo3 Blue) • 32-bit ARM Cortex-M4F • 48MHz CPU clock, 96MHz with TurboSPOT™ • 1MB Flash • 384KB SRAM • Extremely low-power usage: 6uA/MHz Sensor • two microphones • 3-axis accelerometer • camera connector Connections • Serial UART • Qwiic connector (need Qwiic cables ) • Bluetooth Radio • four LEDs and four GPIO connections • JTAG Connector Sparkfun Edge board https://learn.sparkfun.com/tutorials/sparkfun-edge-hookup- guide?_ga=2.52218401.900382962.1598838491- 96125856.1586318981#hardware-overview
  • 5. Block Diagram of Apollo3 Blue MCU
  • 6. Reset Button UART connector GPIO Button MICx2 Qwiic connector GPIO connections x4 Bluetooth Radio LED x4 Camera connector JTAG Connector Accelerometer MCU
  • 7. Linux 系統 • 目的: Building the firmware for Sparkfun Edge Board • OS: Ubuntu 18.04 **可參考本文章 ” Virtual Box建置Linux主機” https://bit.ly/2RE0hK8 Windows 系統 • 目的: Training the Tensor flow model • 所需軟體: • Anaconda https://www.anaconda.com • Python 3.7 and TensorFlow 2.0 • MobaXterm https://mobaxterm.mobatek.net/ • Serial to USB driver (CH340) 準備好軟體開發環境
  • 8. Using SparkFun Edge Board with Ambiq Apollo3 SDK
  • 9. Layout of Ambiq Apollo3 SDK
  • 10. BSP Layout of SparkFun_Edge
  • 11. Setup Toolchain & build project # Setup Toolchain ===================== export PATH=~/tinyML/tensorflow/lite/micro/tools/make/downloads/gcc_embedded/bin:$PATH 可以將此行加入到 ~/.bashrc內 #Build the Frist Example for test ============== example1_edge_test/ ├── gcc │ ├── bin │ ├── edge_test.ld │ ├── Makefile │ └── startup_gcc.c ├── Makefile └── src ├── main.c ├── tf_accelerometer └── tf_adc >> cd SparkFun_Edge_SDK/AmbiqSuite- Rel2.2.0/boards/SparkFun_Edge_BSP- master/examples/example1_edge_test/gcc >> make ==> it will output bin/example1_edge_test.bin
  • 12. 產生燒錄檔 & 寫入燒錄檔到板子 Genearte firmware 產生燒錄檔 xxx_wire.bin ==================== [on Linux] cd apollo3_scripts #copy xxx.bin to here cp ../tensorflow/lite/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/ example1_edge_test.bin . ./build_fw.sh example1_edge_test.bin ==> example1_edge_test_wire.bin
  • 13. Screenshot after ./build_fw.sh 將 binary 加上 header  signed binary 再將signed binary 加入燒錄資訊
  • 14. 1.) 先將Sparkfun 透過 USB 線連接 PC 2.) 再檢查所有USB-to-Serial裝置 • Linux : 在終端機輸入 ls /dev/ttyUSB0 • MacOS : 輸入 ls /dev/cu.usbserial* • Windows : 在裝置管理員檢查COM (此處為COM14) 燒入前檢查 Windows 須先安裝CH340 Driver
  • 15. 遵循以下步驟 1. 確認 Sparkfun edge board已經連接到 PC (USB-to-Serial 轉板 ) 2. 先持續按著Button 14, 再按 button RST (進入燒錄模式) 3. 接著在[Anaconda Prompt ], 要切換到 apollo3_scripts 目錄, 輸入下列指令 python uart_wired_update.py COM14 -f example1_edge_test_wire.bin 在windows上燒錄bin檔到edge board *須先安裝pyserial 套件 pip install pyserial COM14 不能被其他程式佔用!! COM14 is your COM PORT NUMBER
  • 17. You can use TeraTerm or putty Display the output message from Edge board [Setup->Serial Port ] baud rate: 115200 bps, 8 N 1
  • 18. Code Architecture • UART printing for info/debugging • ADC operation to sample from a microphone • I2C operation to control the accelerometer • GPIO functions (an output that can drive up to 12 mA) "hal/am_hal_adc.h" "hal/am_hal_gpio.h" "hal/am_hal_uart.h" mcu/apollo3/am_mcu_apollo.h …………… MCU pin Board (Sparkfun Edge) ./boards/SparkFun_Edge_BSP- master/bsp/am_bsp_pins.h Application MCU register R/W Hardware Abstraction Layer (HAL)