0

members

Medium Basics: Project 083e Sipeed Maixduino board - Uploading MaixPy

of Acoptex.com in Sipeed Maixduino

Basics: Project 083e

Project name: Sipeed Maixduino board - Uploading MaixPy

Tags: Sipeed Maixduino Kit for RISC-V AI and IoT, seeedstudio, Artificial intelligence, AI, IOT, Internet of things, MaixPy

Attachments: helloworld_1.py

In this project, you need these parts :

1. Sipeed Maixduino Kit for RISC-V AI + IoT 1 pc or Sipeed Maixduino for RISC-V AI + IoT 1 pc

2. USB Type C cable 1 pc

3. Micro SD card and SD card adapter (4GB size, format FAT) 1 pc

General

We will learn how to upload MaixPy to Sipeed Maixduino board. 

About Seeed Studio
Seeed is the IoT hardware enabler providing services over 10 years that empower makers to realize their projects and products. Seeed offers a wide array of hardware platforms and sensor modules ready to be integrated with existing IoT platforms and one-stop PCB manufacturing and Prototype PCB Assembly. Seeed Studio provides a wide selection of electronic parts including Arduino, Raspberry Pi and many different development board platforms. Especially the Grove Sytsem help engineers and makers to avoid jumper wires problems. Seeed Studio has developed more than 280 Grove modules covering a wide range of applications that can fulfill a variety of needs. 

About Seeed Studio

Seeed is the IoT hardware enabler providing services over 10 years that empower makers to realize their projects and products. Seeed offers a wide array of hardware platforms and sensor modules ready to be integrated with existing IoT platforms and one-stop PCB manufacturing and Prototype PCB Assembly. Seeed Studio provides a wide selection of electronic parts including Arduino, Raspberry Pi and many different development board platforms. Especially the Grove System help engineers and makers to avoid jumper wires problems. Seeed Studio has developed more than 280 Grove modules covering a wide range of applications that can fulfill a variety of needs. 

Understanding the MaixPy

MaixPy ported MicroPython to K210 (a 64-bit dual-core RISC-V CPU with hardware FPU and convolution accelerator). A project that supports MCU routine operations and integrates machine vision and microphone arrays to quickly develop intelligent applications in the AIOT field that are extremely cost effective and practical.

MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments.

K210 created for AIOT(AI+IOT) use, It's powerful performance and low cost are very competitive.

MicroPython makes programming on K210 hardware easier, the code is open source and can be found here.

Maixpy is a scripting language that is completely usable without the need for an IDE. This IDE is for make it easier to view images, pick colors, send files, etc on a computer. The Maixpy IDE is derived from the OpenMV IDE. Because the K210 does not support USB, it uses serial communication instead, so using Maixpy IDE will reduce the frame rate, or if you encounter other problems, please try to use the serial terminal instead.

MaixPy devices have an internal file system which can access both internal and external memories. During boot, the device will mount any external memory cards formatted with either SPIFFS or FAT file systems, and add them to the internal file system as the /flash or /sd directories respectively. SPIFFS cards are by default assigned to 3MB SPIFFS (starting at flash address 0xD00000). When detected at boot, SPIFFS devices automatically appear as the /flash directory within the device's internal file system. Currently the SPIFFS implementation in MaixPy does not support the creation of directories. FAT formatted SD (TF) cards are supported, but FAT32 or exFAT formatted cards are not currently supported. When detected at boot, FAT formatted cards will be automatically mounted and appear as the /sd directory in the device's internal file system. It should be noted that the root directory is only used to mount the SD card or SPIFFS flash card. All other file operations happen in the /flash or /sd directories, as determined by the format of the memory card discovered at boot time.

If a memory card formatted with either a SPIFFS or FAT file system is detected at boot, MaixPy will look for a boot.py file in the root directory of that memory card. If /boot.py is found, the system will immediately execute it. If the /boot.py file is not found, the device will automatically create one on the memory card that offers a basic REPL command line interface. Edit the contents of the /boot.py file on the memory card to determine what the device does when it is reset or rebooted. FAT memory cards will have a mount point of /sd, while SPIFFS cards will appear as /flash.

Understanding the Sipeed Maixduino board

You can read more about it here.

Signals and connections of the Sipeed Maixduino board


Maxduino pinout



Sipeed M1 pinout. See detailed description about pins here.

ADC - Analog to Digital Converter or Analog pins.This devepment board has 5.

GND - Ground pin.

RST - Reset pin.

Vin - External power supply pin 6V

I2C - It has dedicated pins available for two-wire I2C communication. One pin is used for data transfer (SDA) and another pin is used for clock synchronization (SCL). 

Pin 0, Pin 1 - hardware serial communication pins.

5V, 3V3 - power supply pins.

ESP32-WROOM-32 - ESP32-WROOM-32 module soldered to the development board. Optionally ESP32-WROOM-32D, ESP32-WROOM-32U or ESP32-SOLO-1 module may be soldered instead of the ESP32-WROOM-32.

Reset button - to reset the development board

BOOT button - to upload the firmware/sketch

USB type C port - USB interface. It functions as the power supply for the board and the communication interface between PC and the ESP module.

Wiring

Step by step istruction

We are using the Sipeed Maixduino board and have Windows 7 64 bit OS installed on our PC.

1. Preparations

  1. Connect camera and LCD to Sipeed Maixduino board.
  2. Insert the Micro SD card to TF card slot.
  3. Plug the Sipeed Maixduino board to your PC and wait for the drivers to install (or install manually any that might be required). We had the drivers installed automatically. There are two serial ports for this board one is for the K210 (we have COM17) and one for the ESP32 (we have COM18).
  4. If the drivers did not install automatically you will need to install FT2232 drivers for USB serial port manually. You can read how to install them below before summary section. For the  to get the USB serial port, FT2232 drivers need to be installed. In new Maixduino and Maix Bit versions that come with a microphone (using a CH552 chip) the JTAG function is not available.
  5. You need to download the kflash_gui here. It is cross-platform, which works on multiple systems (including Windows, Linux, MacOS or even Raspberry Pi). We downloaded kflash_gui_v1.5_windows.7z. There is the folder named kflash_gui with files  inside - you need to unzip it. Use the free program 7zip.
  6. You will need to download a MaixPy firmware. Go to webpage here or here. We have choosen MaixPy firmware version 0.3.2 - maixpy_v0.3.2_full.bin. You can see other files on this page too. Let's have a look. maixpy_v0.3.2_no_lvgl.bin - MaixPy firmware, without LVGL version (LVGL is an embedded GUI framework, you need to use when writing the interface); maixpy_v0.3.2_full.bin - Full version of MaixPy firmware (MicroPython + OpenMV API + lvgl); maixpy_v0.3.2_minimum.bin - MaixPy firmware minimum set, not supported by MaixPy IDE, does not contain OpenMVrelated algorithms; face_model_at_0x300000.kfpkg - Face model, placed in address 0x300000, can be downloaded multiple times without conflict; elf.7z - elf file, ordinary users do not care, used for crash debugging.

2. Uploading the MaixPy to Sipeed Maixduino board

  1. Go to kflash_gui folder and double-click on  kflash_gui.exe to run the app.
  2. The app will start.
  3. Select file. Click on Open file button and select the MaixPy firmware file downloaded above. 
  4. Select board - Sipeed Maixduino and burn to - Flash.
  5. Select k210 serial port (We have COM17) and the other settings: baudrate - 1500000 and speed mode - Slow speed.
  6. Click on Download button. You start to flash MaixPy firmware to your Sipeed Maixduino board.
  7. Congrats. You have successfully flashed MaixPy firmware.

3. Checking the MaixPy firmware on Sipeed Maixduino board

  1. Go to putty.org, download and install PUTTY for Windows. You can also use XShell which you can download here. We are going to use PuTTY app in this project.
  2. Open PUTTY app. Select connection type - Serial, Serial line - COM17 (k210 serial port), speed - 115200.
  3. Click on Open button.
  4. Press the Sipeed Maixduino board on-board Reset button to reboot it. You will see the welcome screen. You can type the help() command for more information.

4. How to install the FT2232 drivers

  1. Go to FTDI page.
  2. Download and extract the archive and connect Sipeed Maixduino to the USB port with USB type C cable.
  3. After connecting the Sipeed Maixduino to the USB port, a new device is detected and installation wizard appears. Select the second option, i.e. the installation from own location
  4. In the next dialog select the folder where you extracted the downloaded driver

Summary

We have learnt how to upload MaixPy to Sipeed Maixduino board. 

More projects with Sipeed Maixduino board

Project 083f Sipeed Maixduino board - Using MycroPython

Project 083x Sipeed Maixduino board - Uploading script with uPyLoader

Project 083y Sipeed Maixduino board - Using MaixPy REPL interface and Micropython Editor

Project 083w Sipeed Maixduino board - Using PlatformIO IDE

Project 083d Sipeed Maixduino Kit for RISC-V AI and IoT

Libraries

  • No libraries required for this project

Script

  • See the begining of this project description


Other projects of Acoptex.com
Medium Basics: Project 083w Sipeed Maixduino board - Using PlatformIO IDE of Acoptex.com in Sipeed Maixduino 08-08-2019
Medium Basics: Project 083f Sipeed Maixduino board - Using MycroPython of Acoptex.com in Sipeed Maixduino 04-08-2019

Published at 04-08-2019
Viewed: 7374 times