Duo S
Milk-V Duo S is an upgraded model of Duo, featuring an upgraded SG2000 main controller with a larger 512MB memory and expanded IO capabilities. It integrates wireless capabilities with WI-FI 6/BT 5, and comes equipped with a USB 2.0 HOST interface and a 100Mbps Ethernet port for user convenience. Supporting dual cameras (2x MIPI CSI 2-lane) and MIPI video output (MIPI DSI 4-lane), it allows for versatile applications. The device also supports switching between RISC-V and ARM boot through a switch. With enhanced functionality, Duo S is better suited for a variety of scenarios with more complex project development requirements.
Introduction of SG2000
SG2000 is a high-performance, low-power chip designed for various product fields such as edge intelligent surveillance IP cameras, local facial recognition attendance machines, and smart home devices. It integrates H.264/H.265 video compression and decoding and ISP capabilities. It supports various image enhancement and correction algorithms like HDR wide dynamic range, 3D noise reduction, defogging, and lens distortion correction, providing customers with professional-grade video image quality.
The chip also integrates an in-house TPU, delivering approximately 0.5TOPS of computing power under INT8 operations. The specially designed TPU scheduling engine efficiently provides high-bandwidth data flow for tensor processing unit cores. It also offers users a powerful deep learning model compiler and software SDK development kit. Mainstream deep learning frameworks such as Caffe, Pytorch, ONNX, MXNet, and TensorFlow (Lite) can be easily ported to this platform.
SG2000 Public Preliminary Datasheet
We have open sourced the Public Preliminary Datasheet and TRM of SG2000 to GitHub. please check it out.
Buy the SG2000 Chips
Milk-V is the Authorised Global Distributor of the SG2002 chips. You can buy samples of the SG2002 chip from our distributor online store directly. For volume order, please contact Milk-V Sales Team for the qoutation.
DuoS GPIO Pinout
GPIO pin mapping
GROUP | ADDR | PORT | CHIP | NUM | NAME | START |
---|---|---|---|---|---|---|
gpio0 | gpio@03020000 | porta | gpiochip0 | 480-511 | XGPIOA | 480 - XGPIOA[0] |
gpio1 | gpio@03021000 | portb | gpiochip1 | 448-479 | XGPIOB | 448 - XGPIOB[0] |
gpio2 | gpio@03022000 | portc | gpiochip2 | 416-447 | XGPIOC | 416 - XGPIOC[0] |
gpio3 | gpio@03023000 | portd | gpiochip3 | 384-415 | ||
gpio4 | gpio@05021000 | porte | gpiochip4 | 352-383 | PWR_GPIO | 352 - PWR_GPIO[0] |
Header J3
SPI | PWM | I2C | UART | NUM | SG2000 | NAME | PIN | PIN | NAME | SG2000 | NUM | UART | PWM | SPI | JTAG |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3V3 | 1 | 2 | VSYS(5V) | ||||||||||||
PWM3 | I2C3_SDA/I2C4_SCL | 468 | XGPIOB[20] | B20 | 3 | 4 | VSYS(5V) | ||||||||
I2C3_SCL/I2C4_SDA | 469 | XGPIOB[21] | B21 | 5 | 6 | GND | |||||||||
I2C1_SCL | 466 | XGPIOB[18] | B18 | 7 | 8 | A16 | XGPIOA[16] | 496 | UART0_TX/UART1_TX | PWM4 | |||||
GND* | 9 | 10 | A17 | XGPIOA[17] | 497 | UART0_RX/UART1_RX | PWM5 | ||||||||
PWM1 | I2C1_SDA | UART2_TX | 459 | XGPIOB[11] | B11 | 11 | 12 | B19 | XGPIOB[19] | 467 | UART2_TX | PWM2 | |||
PWM2 | I2C1_SCL | UART2_RX | 460 | XGPIOB[12] | B12 | 13 | 14 | GND | |||||||
UART2_RX | 470 | XGPIOB[22] | B22 | 15 | 16 | A20 | XGPIOA[20] | 500 | JTAG_TRST | ||||||
3V3 | 17 | 18 | A19 | XGPIOA[19] | 499 | UART1_TX/UART1_RTS | PWM7 | JTAG_TMS | |||||||
SPI3_SDO | PWM3 | I2C2_SCL | 461 | XGPIOB[13] | B13 | 19 | 20 | GND | |||||||
SPI3_SDI | I2C2_SDA | 462 | XGPIOB[14] | B14 | 21 | 22 | A18 | XGPIOA[18] | 498 | UART1_RX/UART1_CTS | PWM6 | JTAG_TCK | |||
SPI3_SCK | UART2_TX | 463 | XGPIOB[15] | B15 | 23 | 24 | B16 | XGPIOB[16] | 464 | UART2_RX | SPI3_CS | ||||
GND | 25 | 26 | A28 | XGPIOA[28] | 508 | UART2_TX/UART1_TX |
GPIO on Header J3
use 3.3V logic levels.
GND*: Pin 9 is a low-level GPIO in the V1.1 version of the hardware, and is GND in the V1.2 version and later.
Header J4
PWM | I2C | UART | MIPI DSI | NUM | SG2000 | NAME | PIN | PIN | NAME | SG2000 | NUM | MIPI DSI | I2C | PWM | SD | SPI |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
VSYS(5V) | 52 | 51 | AUDIO_OUT_R | |||||||||||||
PWM12 | I2C4_SCL | UART3_TX | 499 | XGPIOB[1] | B1 | 50 | 49 | AUDIO_OUT_L | ||||||||
PWM13 | I2C4_SDA | UART3_RX | 450 | XGPIOB[2] | B2 | 48 | 47 | AUDIO_IN_R | ||||||||
451 | XGPIOB[3] | B3 | 46 | 45 | AUDIO_IN_L | |||||||||||
PWM10 | I2C2_SDA | LCD_RST | 354 | PWR_GPIO[2] | E2 | 44 | 43 | 3V3 | ||||||||
PWM9 | I2C2_SCL | UART2_RX | LCD_PWR_CT | 353 | PWR_GPIO[1] | E1 | 42 | 41 | C18 | XGPIOC[18] | 434 | MIPI_TX_3N | I2C1_SDA | PWM12 | SD1_CLK | |
PWM8 | UART2_TX | LCD_PWM | 352 | PWR_GPIO[0] | E0 | 40 | 39 | C19 | XGPIOC[19] | 435 | MIPI_TX_3P | I2C1_SCL | PWM13 | SD1_CMD | ||
GND | 38 | 37 | GND | |||||||||||||
PWM14 | I2C1_SDA/I2C2_SDA | MIPI_TX_2N | 436 | XGPIOC[20] | C20 | 36 | 35 | C16 | XGPIOC[16] | 432 | MIPI_TX_CN | I2C1_SDA | PWM8 | SD1_D2 | SPI0_SCK | |
PWM15 | I2C1_SCL/I2C2_SCL | MIPI_TX_2P | 437 | XGPIOC[21] | C21 | 34 | 33 | C17 | XGPIOC[17] | 433 | MIPI_TX_CP | I2C1_SCL | PWM9 | SD1_D3 | SPI0_CS_X | |
GND | 32 | 31 | GND | |||||||||||||
PWM10 | I2C2_SDA | MIPI_TX_1N | 430 | XGPIOC[14] | C14 | 30 | 29 | C12 | XGPIOC[12] | 428 | MIPI_TX_0N | PWM14 | ||||
PWM11 | I2C2_SCL | MIPI_TX_1P | 431 | XGPIOC[15] | C15 | 28 | 27 | C13 | XGPIOC[13] | 429 | MIPI_TX_0P | PWM15 |
GPIO on Header J4
use 1.8V logic levels.
LED PIN
NAME | SG2000 | NUM |
---|---|---|
LED | XGPIOA[29] | 509 |
DuoS User Guide
RISC-V and ARM switching
The large core of DuoS can choose to use RISC-V or ARM processor, which can be set through the switch on the board. If you find that DuoS cannot start normally during use, please first check whether the switch is consistent with the firmware used.
If the debug serial port is connected, you can see in the first line of the boot log that starting with C
means starting from the RISC-V core, and starting with B
means starting from the ARM core.
- RISC-V:
C.SCS/0/0.C.SCS/0/0.WD.URPL.USBI.USBW
- ARM:
B.SCS/0/0.WD.URPL.B.SCS/0/0.WD.URPL.USBI.USBW
Usage of USB Type A interface
The USB functions of the DuoS USB Type A interface and Type C interface are optional and cannot be used at the same time. The default firmware is configured with the USB network port (RNDIS) function of the Type C port. If you need to switch to the USB 2.0 HOST port of the Type A port for use with USB flash drives and other devices, you need to execute the following command:
ln -sf /mnt/system/usb-host.sh /mnt/system/usb.sh
sync
Then execute the reboot
command or power on again to make it take effect.
For example, after connecting a USB flash drive to the USB A port, you can use ls /dev/sd*
to check whether the device is detected.
Mount it to the system to view the contents of the USB flash drive (take /dev/sda1 as an example):
mkdir /mnt/udisk
mount /dev/sda1 /mnt/udisk
Check whether the contents of the /mnt/udisk
directory are as expected:
ls /mnt/udisk
Command to uninstall USB flash drive:
umount /mnt/udisk
When you want to restore the USB network (RNDIS) function of the Type C port, execute:
rm /mnt/system/usb.sh
ln -sf /mnt/system/usb-rndis.sh /mnt/system/usb.sh
sync
Then execute the reboot
command or power on again to make it take effect.
DuoS has an onboard Ethernet interface, so the USB network port (RNDIS) of the Type C port can be used without switching to the USB 2.0 Host function of the A port.
UART Serial Console
Connect USB to TTL serial cable as shown below. Do not connect the red wire.
Milk-V DouS | <---> | USB to TTL |
---|---|---|
GND (pin 6) | <---> | Black wire |
TX (pin 8) | <---> | White wire |
RX (pin 10) | <---> | Green wire |
The default serial setting for Duo u-boot and kernel console is:
baudrate: 115200
data bit: 8
stop bit: 1
parity : none
flow control: none
WIFI configuration
Method 1
Edit the following file and replace ssid
and psk
with the WIFI account and password to be connected:
ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
update_config=1
network={
ssid="wifi_test"
psk="12345678"
key_mgmt=WPA-PSK
}
Then execute the following command:
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
You can connect to WIFI. After connecting, you can view the assigned IP address through the ifconfig
or ip a
command.
If you need to automatically connect to the network at boot, you can put this command in the /mnt/system/auto.sh
file.
eMMC version firmware burning
The DuoS eMMC version does not have firmware burned and needs to be burned using a PC through the USB interface.
Use the USB burning tool under Windows to support eMMC. The firmware version is V1.1.0 or latest version.
Burning in Windows
-
Install driver
Download the USB driver installation tool: CviUsbDownloadInstallDriver.zip. After downloading, unzip and install.
-
Download burning tool
Download the command line burning tool under Windows CviBurn_v2.0_cli_windows.zip, unzip it after downloading.
-
Download firmware
Download the latest version of DuoS eMMC firmware, currently milkv-duos-emmc-v1.1.0-2024-0410.zip, you can create a new rom folder in the burning tool
CviBurn_v2.0_cli_windows
directory, and extract the downloaded eMMC firmware compressed package to rom directory, the directory structure of the burning tool is as follows:└───CviBurn_v2.0_cli_windows
│ cv_dl_magic.bin
│ usb_dl.exe
└───rom
│ boot.emmc
│ fip.bin
│ partition_emmc.xml
│ rootfs_ext4.emmc
| ...In the Windows terminal, execute the burning command in the
CviBurn_v2.0_cli_windows
directory:usb_dl.exe -s linux -c cv181x -i .\rom
*You can also put the firmware in other directories and specify the corresponding directory through the -i parameter in the command. *
Displays message waiting for USB connection:
Use Type-C data cable to connect DuoS and PC (note, if DuoS currently has an SD card inserted, please remove the SD card first), DuoS will automatically power on and enter the burning mode, and the PC will display the burning status in real time. Recording progress:
[INFO] Waiting for USB device connection: ---
[INFO] found usb device vid=0x3346 pid=0x1000
[INFO] downloading file: .\rom\boot.emmc
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 3384664/213100824(1%)
[INFO] downloading file: .\rom\rootfs_ext4.emmc
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 20161944/213100824(9%)
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 36939224/213100824(17%)
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 53716504/213100824(25%)
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 70493784/213100824(33%)
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 87271064/213100824(40%)
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 104048344/213100824(48%)
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 120825624/213100824(56%)
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 137602904/213100824(64%)
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 154380184/213100824(72%)
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 171157464/213100824(80%)
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 187934744/213100824(88%)
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 204712024/213100824(96%)
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 213100696/213100824(99%)
[INFO] USB download completeAfter the burning is completed, the DuoS will automatically restart. After booting, you will see the blue LED on the DuoS flashing, indicating that the system has started normally and the burning is successful.