yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
MSPM0G3507 Development Board📖
1. Introduction to MSPM0
  • 1. Introduction to MSPM0
2. Development environment construction
  • 01.CCS Theia Development
  • 02.MDK Arm Development
  • 03.UniFlash Downloader
  • 04.DAP-LINK download program
  • 05.Program simulation and debugging
  • 06.Engineering transplantation
3. Keil basic case
  • 1. Turn on the LED light
  • 2. System delay
  • 3. Button control
  • 4. External interruption
  • 5. Serial communication
  • 6. Timer
  • 7. PWM breathing light
  • 8. ADC acquisition
  • 9. DMA transfer
  • 10. Get MPU6050 data (I2C)
  • 11. LCD Display (SPI)
4. CCS basic case
  • 1. Turn on the LED light
  • 2. System delay
  • 3. Button control
  • 4. External interruption
  • 5. Serial communication
  • 6. Timer
  • 7. PWM breathing light
  • 8. ADC acquisition
  • 9. DMA transfer
  • 10. Get MPU6050 data (I2C)
  • 11. LCD Display (SPI)
5. MSPM0 Robot Expansion Board
  • 1. MSPM0 Robot Expansion Board Introduction
  • 2. Custom Buttons
  • 3. Drive Buzzer
6.MSPM0-K230 Vision Application Module
  • 1.k230 color recognition
  • 2.k230 barcode recognition
  • 3.k230 QR code recognition
  • 4.k230Apriltag code recognition
  • 5.k230DM code recognition
  • 6.k230 face detection
  • 7.k230 gaze direction
  • 8.k230 face recognition
  • 9.k230 human body detection
  • 10.k230 fall detection
  • 11.k230 palm detection
  • 12.k230 gesture recognition
  • 13.k230OCR character recognition
  • 14.k230 object detection
  • 15.k230 target tracking
  • 16.k230 self-learning object recognition
  • 17.k230 license plate recognition
7. MSPM0-K210Vision module application
  • 0.Prerequisites for K210 as a coprocessor
  • 1.MSPM0_K210 color recognition
  • 2.MSPM0_K210 barcode recognition
  • 3.MSPM0_K210 QR code recognition
  • 4.MSPM0_K210 mechanical code recognition
  • 5.MSPM0_K210 face detection
  • 6.MSPM0_K210 facial feature detection
  • 7.MSPM0_K210 mask detection
  • 8.MSPM0_K210 face recognition
  • 9.MSPM0_K210 Object Detection
  • 10.MSPM0_K210 Self-study classification
  • 11.MSPM0_K210 handwritten digit recognition
8. Expansion casenew
  • 1.Autonomous driving car
  • 2.Vehicle-mounted balance ball motion control system
Download
  • Code
  • Hareware_Info
  • Software_Tools
  • Communication Protocol
Download ZIP

Welcome to MSPM0G3507 Development Board repository

6.k230 face detection

k230 face detection

k230 face detectionk230 and MSPM0 communication1. Experimental Prerequisites2. Experimental wiring3. Main code explanation4. Experimental Phenomenon

 

k230 and MSPM0 communication

1. Experimental Prerequisites

This tutorial uses the MSPMG3507 development board, and the corresponding routine path is [14.export\MSPM0-K230\06_k230_face_detect].

K230 needs to run the [14.export\CanmvIDE-K230\06.face_detection.py] program to start the experiment. It is recommended to download it as an offline program.

Things you need:

Windows computer MSPMG3507 development board K230 visual module (including TF card with image burned in) Two type-C data cables Connection cable

2. Experimental wiring

k230 vision moduleMSPM0 Development Board
5VVCC
GNDGND
TXD(IO9)A22
RXD(IO10)A21

image-20250430180020894

3. Main code explanation

void Pto_Data_Parse(uint8_t *data_buf, uint8_t num)
{
    uint8_t pto_head = data_buf[0];
    uint8_t pto_tail = data_buf[num-1];
    if (!(pto_head == PTO_HEAD && pto_tail == PTO_TAIL))
    {
        sprintf(print_buf, "pto error:pto_head=0x%02x , pto_tail=0x%02x\n", pto_head, pto_tail);
        uart0_send_string(print_buf);
        return;
    }
    uint8_t data_index = 1;
    uint8_t field_index[PTO_BUF_LEN_MAX] = {0};
    int i = 0;
    int values[PTO_BUF_LEN_MAX] = {0};
    for (i = 1; i < num-1; i++)
    {
        if (data_buf[i] == ',')
        {
            data_buf[i] = 0;
            field_index[data_index] = i;
            data_index++;
        }
    }
    
    for (i = 0; i < data_index; i++)
    {
        values[i] = Pto_Char_To_Int((char*)data_buf+field_index[i]+1);
    }
    
    uint8_t pto_len = values[0];
    
    if (pto_len != num)
    {
        sprintf(print_buf, "pto_len error:%d , data_len:%d\n", pto_len, num);
        uart0_send_string(print_buf);
        return;
    }
    uint8_t pto_id = values[1];
    if (pto_id != PTO_FUNC_ID)
    {
        sprintf(print_buf, "pto_id error:%d, func_id:%d\n", pto_id, PTO_FUNC_ID);
        uart0_send_string(print_buf);
        return;
    }
    int x = values[2];
    int y = values[3];
    int w = values[4];
    int h = values[5];
    sprintf(print_buf, "face:x:%d, y:%d, w:%d, h:%d\n", x, y, w, h);
    uart0_send_string(print_buf);
}

The above functions are for parsing K230 data. Only when they meet specific protocols can the corresponding data be parsed.

in

  • x: is the horizontal coordinate of the upper left corner of the recognized box
  • y: is the vertical coordinate of the upper left corner of the recognized box
  • w: is the width of the recognized frame
  • h: is the length of the recognized frame

4. Experimental Phenomenon

  1. After connecting the cables, the k230 visual module runs offline. After K230 is connected to Canmv IDE, open the corresponding program, click [Save open script to CanMV board (as main.py)] on the toolbar, and then restart K230.

image-20250429194108060

  1. The hex file generated by the MSPM0 burning routine.

image-20250430182131132

  1. The serial port assistant is set to the interface shown in the figure

image-2023060600004

  1. When the K230 camera recognizes a face, the serial port assistant will print out the information transmitted from K230 to MSPM0.

in

  • x: is the horizontal coordinate of the upper left corner of the recognized box

  • y: is the vertical coordinate of the upper left corner of the recognized box

  • w: is the width of the recognized frame

  • h: is the length of the recognized frame

    As shown in the figure below

image-20250430114459333

k230DM code recognition
k230 gaze direction

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文