Drivers and Firmware

This article provides detailed instructions on installing drivers for MangoPi-R3 on Windows, including FEL and DFU modes, and outlines the process for burning firmware using SPI NAND Flash tools. It covers the necessary steps for both Windows and Linux users, including driver installations, firmware downloads, and remote control configurations with PyCharm and MobaXTerm.

1. Driver Installtion on Windows

If you are a Windows user, you will need to install a driver when using this MangoPi-R3.

1.1 Download the zadig driver installation helper

Click to download: zadig-2.5.exe

Original Link: https://github.com/aodzip/buildroot-tiny200/blob/master/flashutils/windows/README.md

1.2 Install FEL mode Driver

Select Device -> Create New Device

1

The input box turns available for input.

2

Input the driver and USB ID as the image below ( USB ID must be corresponding ), click Install Driver.

3

Wait for the driver to be installed.

4

1.3 Install DFU mode Driver

Select Device -> Create New Device

5

The input box turns available for input.

6

Input the driver and USB ID as the image below ( USB ID must be corresponding ), click Install Driver.

7

Wait for the driver to be installed

8

Firmware Burning

Since the interface is multiplexed, the camera and SPI cannot be used at the same time. So, the firmware is divided into "camera firmware" and "spi firmware". Users can burn them according to their needs.

The current firmware version is version 0.2, click on the link below to download the firmware.

2.1 Burning on Windows

SPI NAND Flash Burning Tool

The software is a burning soft tool developed specifically for F1C100S/F1C200S chips and operates in Windows.

Software Download

Click to download SPI NAND Flash Tool

Software interface. The software will automatically get the port number and the main control IC model after it runs.

9

How to use the software

  1. After running the software, it will automatically get ports as the following picture shows.
  2. Connect the computer to the TTL and OTG of the MangoPi-R3 (both interfaces need to be connected to the computer) and wait for the software to acquire the board serial port and SOC.

If "COM port found:" is displayed, and the SOC recognizes and displays it, indicating that the next step can be made.

10

  1. Click Erase Flash, coming “Please press BOOT and RST buttons, and release to enter FEL mode”, then go on as the steps below:
    1. Press the BOOT button on the board
    2. Press the RST button
    3. Release the BOOT button
    4. Release the RST button

11

  1. The erase will be completed until it shows “Erase completed”

warning_yellow.png NOTE: This step is very necessary, which is also set in the software that if not to erase Flash, it cannot write in the firmware.

12

    • Click boot ... button to browse the folder, select the corresponding burn file in the downloaded SPI NAND Flash tool kit.
      Camera firmware package file path: Camera_firmwareV0.2\output\images\u-boot-sunxi-with-nand-spl.bin
      SPI firmware package file path: SPI_firmwareV0.2\output\images\u-boot-sunxi-with-nand-spl.bin
    • Click dtb ... button to browse the folder, select the corresponding burn file in the downloaded firmware package.
      Camera firmware package file path: Camera_firmwareV0.2\output\images\devicetree.dtb
      SPI firmware package file path: SPI_firmwareV0.2\output\images\devicetree_i2c_spi.dtb
    • Click kernel ... Button to browse the folder, select the corresponding burn file in the downloaded firmware package.
      Camera firmware package file path: Camera_firmwareV0.2\output\images\zlmage
      SPI firmware package file path: SPI_firmwareV0.2\output\images\zlmage
    • Click rootfs ... Button to browse the folder, select the corresponding burn file in the downloaded firmware package.
      Camera firmware package file path: Camera_firmwareV0.2\output\images\rootfs.ubi
      SPI firmware package file path: SPI_firmwareV0.2\output\images\rootfs.ubi

13
14

  1. Click the Write button in turn to start burning. When "Please press BOOT and RST buttons, and release to start burning" appears, follow the order of operations:
    1. Press the BOOT button on the board
    2. Press the RST button
    3. Release the BOOT button
    4. Release the RST button

Wait for the burn. The successful burning will be indicated by the appearing “Burning completed successfully”, then click the next Write button.

15

  1. After completing all the burning steps, "Please press RST button to restart system..." will appear, indicating that the burning is done!

16

Press the RST button on the board and the new system starts working!

2.2 Burning on Linux (Use Command Line)

Install Burning Tool

What is sunxi-tools?

sunxi-tools is a command line tools collection for ARM devices with Allwinner SoC (Intelligent Application Processor Soc developed by Allwinner Technology).

Set up and install sunxi-tools
Install dependency packages

sudo apt install pkg-config zlib1g-dev libusb-dev libusb-1.0-0-dev

17

Download codes

git clone https://github.com/Icenowy/sunxi-tools.git -b f1c100s-spiflash

18

Compile and install

cd sunxi-tools
make 
sudo make install

19

What is dfu?
Device Firmware Upgrade (DFU) is a mechanism independent of distributor and equipment, which is used to upgrade the firmware of a USB device through improved versions provided by its manufacturer, thereby offering (for example) a method of deploying firmware error repairing. During the firmware upgrade operation, the USB device will effectively change its operating mode, thus becoming a PROM programmer. Following the official DFU specification, any type of USB device can implement this function. DFU also allows users to freely use backup firmware to refresh USB devices. One of the results is that the refreshed USB device may act as a variety of device types.

What is dfu-util?
dfu-util is a host (PC) program that implements the USB DFU (Universal Serial Bus Device Firmware Upgrade) protocol. DFU will download the firmware to the device that connected by USB, or download the firmware from the device. Its application ranges from small devices such as micro-controller boards to mobile phones devices. Using dfu-util, you can download/upload firmware to/from DFU-enabled devices.

Install dfu-util through apt-get

sudo apt install dfu-util

20

Burn firmware

Download firmware

21

Decompress the firmware

Create a folder (mkdir ll) → move the compressed package (mv Camera_firmwareV0.2.zip ll) → decompress the compressed package (unzip Camera_firmwareV0.2.zip)

22

What is putty?
putty is a Telnet, SSH, and serial interface connection software.

Install the serial port tool putty

sudo apt-get install putty

23

Open the serial port debugging software putty
In the case of default installation, putty is added to the /usr/bin directory, so you can directly use the putty command in the terminal to open it.

24

Get the serial port address
Connect the board to the computer, use the command dmesg | grep tty, view serial device information.

25

From this, we can get that the serial port of the board is ttyUSB0

Generally, the name of the serial port is under dev, which if you don't have an external serial port card, the default is dev.

Use the command ls /dev/ttyUSB0 to see if it exists

26

If the result exists, then the serial port address is /dev/ttyUSB0

Fill the serial port in putty, and then open the serial port to format

  • serial line: fill in the corresponding serial number
  • speed: fill in 115200

27

Enter the firmware folder (the location where the firmware is stored)

28

Press the boot button and rst button of tiny200 at the same time, then release

Run the .\fel-uboot.sh script at this time

29

Then wait for the completion of the operation, and then enter mtd erase spi-nand0, format it.

30

Add file permissions

Use the ll command to view file permissions.

If the file does not have execute permissions, you need to add permissions, adding permissions through the following command.

chmod +x fel-uboot.sh
chmod +x dfu-nand-ubifs.sh

31

If adding permissions fails, you can try to add sudo (ie sudo chmod +x fel-uboot.sh) in front of the command, or you can switch to the administrator account (su), and then add permissions.

Start burning

Enter the firmware folder ().

Press the boot button and rst button of tiny200, then release the rst button and run the following command.

sudo ./fel-uboot.sh && ./dfu-nand-ubifs.sh

32
33

Verify whether Mango-Pi is successfully burned

Press the RST button of Mango-Pi, enter the operational mode.

Need to wait for more than 10s if you use it for the first time.

Testing through ifconfig

34

A network card adapter with the address of 192.168.9.6 appears, which proves that the programming is successfully burned.

The Python environment has been built in, the version is Python 3.8.5

3. Connect the mainboard

  • Mainboard RNDIS network card IP address: 192.168.9.1
  • Username: root
  • Password: dfrobot
  • Install RNDIS driver

3.1 RNDIS

RNDIS refers to Remote NDIS. The implementation of RNDIS based on USB is actually TCP/IP over USB, which is to run TCP/IP on the USB device, it make the USB device act like a network card. We can access the motherboard through the network protocol.

RNDIS driver installation

Use a usb data cable to connect the OTG socket on the Mango-Pi board, connect the board to the computer.

Windows driver download address

Step 1. Open "Device Manager"

Open the menu with Win+X, select "Device Manager"

35

Step 2. Right-click and select the port which represent the Mango-Pi board

Mango-Pi in my case is a USB serial device (COM43)

Step 3. Install Driver

Select "Update Driver" >>> Select "Browse my computer for finding driver

Click "Browse" to locate the folder where the RNDIS driver is.
Click "Next", wait for a while, it will show that the driver is installed successfully.

Step 4. Check that if the driver is installed successfully

After the driver is installed, "USB Ethernet/RNDIS Gadget" will appear in the device manager.

ps: "#3" behind USB Ethernet/RNDIS Gadget is meaningless.

图片 英文

About the functions of the two USB ports on Mango-Pi.
They are TTL and OTG interfaces

TTL interface
The TTL interface is leads out from the CP2104 chip, it converts the UART0 of the F1C200S chip into a USB serial port, we can use it as a serial port terminal on the motherboard.

OTG interface
The OTG interface is a interface that leads out the USB port of the F1C200S chip, we simulate the USB port of the F1C200S chip as an RNDIS device, which becomes a USB network card that connected to the board under the action of RNDIS driver.

3.2 Recommended software

We use the SSH protocol to remotely control the motherboard, use the sftp protocol to remotely transfer files. We recommend two commonly used software, one is PyCharm (commercial version), the other is MobaXterm.

PyCharm

PyCharm is a Python IDE, it has a set of tools that can help users become more efficiency when they are using Python language development, and also provides SSH remote control, sftp remote transmission functions.

Use PyCharm to connect to the mainboard

Connect the board, notice: the access point is the OTG interface of Mango-Pi.

  1. Click Tools->Deployment->Configuration on the Pycharm tab

36

  1. On the pop-up window, click the "+" sign, select "SFTP", create a remote server configuration

37

  1. Then enter the remote server name on the pop-up window, click "ok"

38

  1. Modify the SSH configuration, determine whether it can be connected through Test Connection, the Root path can be determined through Autodetect button.
    • host: 192.168.9.1
    • Username: root
    • Password: dfrobot

39

  1. Click Tools->Deployment->Browse Remote Host on the Pycharm tab

40

Then the following screen will appear.

41

At this point, the connection to the motherboard is completed.

Compile and run the hello dfrobot program

  1. Right-click on the blank space of the Remote Host window, select File under New, create a py file, and name it hello.py

42
43

  1. Write the script, and click the upload button (the red box), upload the content to Mango-Pi

44

  1. Run hello.py
    Click Tools->Start SSH Session on the Pycharm tab

45

In the pop-up window, select the previously configured SSH configuration information.

46

Then enter "python hello.py" in the pop-up window, and press Enter.

47

MobaXTerm

Mobaxterm is a fully functional and free to use terminal tool, it supports multiple remote terminal access methods such as SSH, Serial, VNC, X11, etc.

After installing it, we can remotely control all linux remote hosts.

Install MobaXTerm

  • Connect the board, note: the access point is the OTG interface of Mango-Pi.
  • Run the program, start the first step

Step 1 Create a session

Select "Session"

48

Select the session type "SSH"

In the "Remote host" box, fill in "192.168.9.1", select "Specify username", and then write "root"

49

Click "OK", enter the session interface.

Step 2 Enter the session interface

Enter the password: dfrobot ------> The password entered here will not be displayed

Then press enter.

50

After pressed "enter", it will enter the session interface.

51

The sftp window on the left side can be used for file editing, the ssh window on the right side is used for command interaction.

Install pinpong Library

To be completed....

Was this article helpful?

TOP