0

members

Medium Basics: Project 083f Sipeed Maixduino board - Using MycroPython

of Acoptex.com in Sipeed Maixduino

Basics: Project 083f

Project name: Sipeed Maixduino board - Using MycroPython

Tags: Sipeed Maixduino Kit for RISC-V AI and IoT, seeedstudio, Artificial intelligence, AI, IOT, Internet of things, MaixPy, MicroPython, upload micropython script to sipeed maixduino board, how to format Micro SD more than 4GB card to FAT format

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, size 4GB (FAT formatted) 1 pc (optional)

4. MaixPy IDE (you can download it here)

General

We will learn how to upload the micropython script to the Sipeed Maixduino board. 

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.



Espressif ESP32-WROOM-32 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

Please check in our Basics: Project 083e Sipeed Maixduino board - Uploading MaixPy

2. Uploading the MaixPy to Sipeed Maixduino board

Please check in our Basics: Project 083e Sipeed Maixduino board - Uploading MaixPy

3. Checking the MaixPy firmware on Sipeed Maixduino board

Please check in our Basics: Project 083e Sipeed Maixduino board - Uploading MaixPy

4. How to install the FT2232 drivers

Please check in our Basics: Project 083e Sipeed Maixduino board - Uploading MaixPy

5. Installing MaixPy IDE

  1. Go here and download the version of MaixPy IDE for your OS (Windows, Linux, Mac).
  2. We have selected v 0.2.3 and downloaded setup file for windows - maixpy-ide-windows-0.2.3.exe
  3. Double-click on maixpy-ide-windows-0.2.3.exe file after downloading and do setup the MaixPy IDE app. The setup is very simple.
  4. After the installation start the MaixPy IDE.

6. Uploading MycroPython script to Sipeed Maixduino board

  1. When you start MaixPy IDE first time you will see the helloworld_1.py script automatically loaded.
  2. Go to Tools->Select board and select the Sipeed Maixduino board.
  3. Click on Connect button to connect to the Sipeed Maixduino board. You will need to choose the USB serial port for k210 (we have COM17) and click on OK button.
  4. You will see the message in small pop-up window - Connecting...Please wait..
  5. Click on OK button.
  6. When you connected the green run arrow button will be available and you will see Serial port: COM17 in information field.
  7. Click on green run arrow button to start (run) the script helloworld_1.py. If you are getting this error:
  8. It can be that the camera attached in wrong way. Check your camera interface. It should be like that:
  9. If you done everything properly you can see the image from your camera.
  10. You can transfer files to board. Go to Tools and select transfer file to board. Select the file and click on OK button. A file will be saved to the development board with the same name. This is to upload small files only.
  11. You can save open script to your Sipeed Maixduino board. Make sure that you have Micro SD card (size 4GB) inserted in TF card slot. Go to Tools and select Save open script to board (boot.py).
  12. Click on Yes button.
  13. Click on OK button. Your open script saved as boot.py on Micro SD card now.  The next time the board is powered on, it will be automatically executed.
  14. If you are getting the error like that:
  15. It means that Micro SD card has wrong format (exFAT, FAT32). You need to format it as FAT (FAT16).

7. How to format Micro SD card with more than 4GB side to FAT format

  1. Insert your Micro SD card with SD card adapter in your PC. We are using Windows 7 64 bit OS version.
  2. Press Windows and R buttons on your keyboard to open Run command window.
  3. Type DISKPART and click on OK button.
  4. Type list disk command and press Enter button. You will see all disks. Check which disk is for Micro SD card (we have disk 1).
  5. Type select disk 1 command and press Enter button.  You will select Micro SD card.
  6. Type clean command and press Enter button. You will clean it.
  7. Type create part primary size=4000 command and press Enter button. 
  8. Type active command and press Enter button. 
  9. Close this window and take out your SD card adapter from your PC. Insert it again to your PC.
  10. Go to Computer. Right-click with your mouse on SD card drive (SDHC (X)). Select Format..

  11. You will be able to select FAT in File system now. Select FAT , quick format and click on Start button.
  12. When formatting completed you will see that you have the Micro SD card formatted to 4GB.

Summary

We have learnt how to upload the MicroPython script to Sipeed Maixduino board. 

More projects with Sipeed Maixduino board

Project 083e Sipeed Maixduino board - Uploading MaixPy

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

« Go back to category
Is this project fake? Report it!   
Recommend to a friend
Published at 04-08-2019
Viewed: 425 times