• Stars
    star
    140
  • Rank 259,933 (Top 6 %)
  • Language
    C
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

RV-Debugger-BL702 Project, an opensource debugger implement

Description

RV-Debugger-BL702 is an opensource project that implement a JTAG+UART debugger with BL702C-A0.

BL702 is highly integrated BLE and Zigbee combo chipset for IoT applications, contains 32-bit RISC-V CPU with FPU, frequency up to 144MHz, with 132KB RAM and 192 KB ROM, 1Kb eFuse, 512KB embedded Flash, USB2.0 FS device interface, and many other features.

The firmware implement is inspired by open-ec, implement by Sipeed teams and community developers.

The firmware emulate an FT2232D device, defaultly implement an JTAG+UART debugger, and can be implement as a Dual-Serial Port debugger, a bluetooth debugger, etc.

Community Forum: bbs.sipeed.com

Hardware

Offical Board

Sipeed RV-Debugger-Plus (BL702C-A0)

Purchase link: taobao.com/xxx

Schematic: BL702_USB2JTAG_3610_sch.pdf

Assembly: BL702_USB2JTAG_3610_asm.pdf

(LED0 is the led close to edge, indicate for RX)


Third-party Hardware

TODO

Firmware

Flash Tutorial

Press "boot" button then plug usb cable, and you will see "CDC Virtual ComPort" in device manager , remember the com number.

The flash tool is in tools/bflb_flash_tool directory, and input the command (replace port number and firmware name):

Windows:
.\bflb_mcu_tool.exe --chipname=bl702 --port=COM9 --xtal=32M --firmware="main.bin"
Linux:
./bflb_mcu_tool --chipname=bl702 --port=/dev/ttyACM0 --xtal=32M --firmware="main.bin"
tools\bflb_flash_tool> .\bflb_mcu_tool.exe --chipname=bl702 --port=COM9 --xtal=32M --firmware="main.bin"
[22:07:28.296] - ==================================================
[22:07:28.296] - Chip name is bl702
[22:07:28.297] - Serial port is COM9
[22:07:28.299] - Baudrate is 115200
[22:07:28.299] - Firmware is main.bin
[22:07:28.300] - Default flash clock is 72M
[22:07:28.300] - Default pll clock is 144M
[22:07:28.311] - ==================================================
[22:07:28.483] - Update flash cfg finished
[22:07:28.500] - EFUSE_CFG
[22:07:28.500] - BOOTHEADER_CFG
......
[22:07:31.274] - Load 53856/53856 {"progress":100}
[22:07:31.274] - Write check
[22:07:31.274] - Flash load time cost(ms): 267.942626953125
[22:07:31.275] - Finished
[22:07:31.276] - Sha caled by host: 825d198270c2cf509acda8f8e0830751c532da802060c324a4479e1fe599ae1f
[22:07:31.276] - xip mode Verify
[22:07:31.288] - Read Sha256/53856
[22:07:31.288] - Flash xip readsha time cost(ms): 12.508056640625
[22:07:31.288] - Finished
[22:07:31.288] - Sha caled by dev: 825d198270c2cf509acda8f8e0830751c532da802060c324a4479e1fe599ae1f
[22:07:31.288] - Verify success
[22:07:31.289] - Program Finished
[22:07:31.289] - All time cost(ms): 2220.2548828125
[22:07:31.390] - [All Success]

Another GUI flash tool is BouffaloLabDevCube:

usb2uartjtag (default)

Support JTAG+UART function

UART support baudrate below 2Mbps, and 3Mbps, and some experimental baudrate (stability is not guaranteed):

12M, 9.6M, 8M, 6.4M, 6M, 4.8M, 4M, 3.2M
we remap baudrate in 10000~12000 to (baud-10000)*10000
for example, 11200bps -> 12Mbps

LED0 for RX indication, LED1 for TX indication.

JTAG function is verified for :

  • RV32 Xuantie E906/E907
  • RV64 Xuantie C906
  • Gowin FPGA GW1N-1, GW1NS-4C. (need enable GOWIN_INT_FLASH_QUIRK)

usb2dualuart

TODO.

Project Structure

RV-Debugger-BL702
β”œβ”€β”€ bsp
β”‚   β”œβ”€β”€ board
β”‚   β”‚   └── bl702_debugger
β”‚   └── bsp_common
β”‚       └── platform
β”œβ”€β”€ common
β”‚   β”œβ”€β”€ device
β”‚   β”œβ”€β”€ libc
β”‚   β”œβ”€β”€ list
β”‚   β”œβ”€β”€ memheap
β”‚   β”œβ”€β”€ misc
β”‚   β”œβ”€β”€ partition
β”‚   β”œβ”€β”€ ring_buffer
β”‚   └── soft_crc
β”œβ”€β”€ components
β”‚   β”œβ”€β”€ shell
β”‚   └── usb_stack
β”œβ”€β”€ drivers
β”‚   └── bl702_driver
β”œβ”€β”€ examples
β”‚   └── usb
β”‚       β”œβ”€β”€ usb2uartjtag
β”‚       └── usb2dualuart
β”œβ”€β”€ out
β”œβ”€β”€ tools
β”‚   β”œβ”€β”€ bflb_flash_tool
β”‚   β”œβ”€β”€ cdk_flashloader
β”‚   β”œβ”€β”€ cmake
β”‚   └── openocd
└── hardware
    

BL SDK usage tutorial refer to http://bouffalolab.gitee.io/bl_mcu_sdk/

Develop Guide

Build

just "make"

Code Explanation

the main file is:

examples/usb/usb2uartjtag:
β”œβ”€β”€ main.c
β”œβ”€β”€ uart_interface.c
β”œβ”€β”€ jtag_process.c
└── io_cfg.h         //main io cfg, another file is pinmux_config.h in bsp/board/bl702_debugger
components/usb_stack/class/vendor:
└── usbd_ftdi.c      //all FTDI vendor request process, like baudrate set, dtr/rts set, Latency_Timer

TODO

More Repositories

1

MaixPy-v1

MicroPython for K210 RISC-V, let's play with edge AI easier
Python
1,681
star
2

TinyMaix

TinyMaix is a tiny inference library for microcontrollers (TinyML).
C
877
star
3

MaixPy-v1_scripts

micropython scripts for MaixPy
Python
622
star
4

Maix-Speech

Maix Speech AI lib, a fast and small speech lib running on embedded devices, including ASR, chat, TTS etc.
Python
312
star
5

Maixduino

Arduino port on Maix board ( k210 )
C++
213
star
6

TangNano-9K-example

TangNano-9K-example project
GLSL
211
star
7

platform-gd32v

GD32V: development platform for PlatformIO
Python
182
star
8

MaixPy3

Python sdk for Sipeed Maix-II-Dock(v831). Other board please use https://github.com/sipeed/MaixPy
Python
173
star
9

kflash_gui

Cross platform GUI wrapper for kflash.py (download(/burn) tool for k210)
Python
150
star
10

MaixPy

Easily create AI projects with Python on edge device
Python
142
star
11

TangPrimer-20K-example

TangPrimer-20K-example project
GLSL
129
star
12

sipeed_wiki

sipeed wiki:https://wiki.sipeed.com
JavaScript
91
star
13

TangNano-4K-example

TangNano-4K-example project
GLSL
87
star
14

Longan_GD32VF_examples

example project for Longan Nano (GD32VF)
C
85
star
15

Maix_Toolbox

Maix Toolbox: Collections of model scripts
Python
82
star
16

maix_train

k210(MaixPy)/V831 model example train code, include mobilenet classifier and YOLO V2 detector
Python
81
star
17

platform-kendryte210

Kendryte K210: development platform for PlatformIO
Python
78
star
18

MaixUI

This is the MicroPython UI framework.
Python
76
star
19

LicheeRV-Nano-Build

LicheeRV-Nano-Build
C
75
star
20

bl602-hal

Hardware Abstract Layer for BL602 RISC-V WiFi + BLE SoC in embedded Rust
Rust
74
star
21

Longduino

Longduino is an Arduino port for gd32v mcu.
C
69
star
22

libmaix

New MaixCDK will replace this repo: https://github.com/sipeed/MaixCDK
C++
68
star
23

Maix-EMC

Maix-EMC: Embedded Model Convertor, convert NN model for embedded systems
Python
66
star
24

sipeed_keyboard

sipeed opensource mechanical keyboard make with BL706
C
64
star
25

TangNano-20K-example

TangNano-20K-example
GLSL
64
star
26

Tang-Nano-examples

Tang-Nano-examples
GLSL
62
star
27

M1s_BL808_example

M1s_BL808_example
C
61
star
28

Tang-Nano-Doc

Document for Tang Nano FPGA board
CSS
56
star
29

M1s_BL808_SDK

M1s(BL808)SDK
C
55
star
30

sipeed2022_autumn_competition

sipeed2022_autumn_competition
47
star
31

MF1-User-Manual

MF1 Face Recognition Module User Manual
Python
46
star
32

Longan-DOC

Longan RV32 Boards Document
CSS
46
star
33

MaixCDK

C/C++ development kit for Sipeed Maix ecosystem boards
C
42
star
34

TangMega-138KPro-example

Tang Mega 138K Pro examples
GLSL
39
star
35

axpi_bsp_sdk

linux bsp app & sample for axpi (ax620a)
C
34
star
36

LicheePi4A

LicheePi4A info&sdk
32
star
37

bl602-rust-guide

Instructions and examples for BL602 Rust support libraries
Rust
31
star
38

Sipeed_HardWare

Sipeed_HardWare wiki
27
star
39

M0S_BL616_example

M0S BL616 example (M0S dock)
C
25
star
40

TangPrimer-25K-example

TangPrimer-25K-example project
GLSL
25
star
41

MF1_SDK

C
22
star
42

bl602-pac

Embedded Rust's Peripheral Access Crate for BL602 microcontrollers
Rust
19
star
43

R329-Tina-jishu

Roff
18
star
44

M0sense_BL702_example

M0sense_BL702_example
C
16
star
45

TangMega-138K-example

TangMega-138K-example project
GLSL
16
star
46

Maixduino_DOC

Docs of Maixduino
CSS
14
star
47

MaixPy_Doc_Us_En_Backup

Python
14
star
48

Tang-Hex-BSP

Tang-Hex-BSP: BSP for ZYNQ 7020 based FPGA Board Tang-Hex
13
star
49

sipeed2022_spring_competition

sipeed2022_spring_competition
Python
11
star
50

Maix-Keras-workspace

Keras workspace for Sipeed MAIX boards
Python
11
star
51

Maix-TF-workspace

Maix-TF-workspace: collections of tensorflow works
Python
11
star
52

rpyc_ikernel

more lightweight remote calling Python on jupyter.
Jupyter Notebook
11
star
53

Maix-Face-Uart-Lib

Sipeed Maix Uart Face Recognition Module/Firmware's Protocol Parse Library
C
10
star
54

TangNano-1K-examples

TangNano-1K-examples (GW1NZ-LV1)
GLSL
10
star
55

Tang-Hex-Doc

Tang-Hex-Doc: Documents for ZYNQ 7020 Based FPGA Board Tang-Hex
HTML
10
star
56

LonganPi-3H-SDK

LonganPi 3H SDK
Shell
7
star
57

MetaSense-ComTool

MetaSense A010's ComTool
Python
6
star
58

r329-linux-4.9

C
5
star
59

MaixSense_ROS

ROS package for MaixSense RGBD/ToF Sensor
C
5
star
60

M0P_BL618_examples

M0P_BL618_examples
C
5
star
61

LicheePi4A-Build

LicheePi4A-Build
C
5
star
62

libomv

Transplantation of openMV core algorithm imlib
C
5
star
63

Nano-Doc-Backup

The backup of Lichee Nano Doc,building with sphnix. http://nano.lichee.pro
Python
4
star
64

r329-target

Roff
3
star
65

ullama2.c

ullama2.c: run llama2 on MCUs (minimum 480KB SRAM)
3
star
66

r329-package

C
2
star
67

platform-riscv-e203

platform IDE for E203 RISC-V core, based on Lichee Tang board
2
star
68

BL702_Si2c_uart_translation

BL702 Slave i2c uart translation.
C
2
star
69

MaixPy_Doc_Zh_Cn_Backup

Python
2
star
70

TangMega-60K-example

TangMega 60K example
1
star
71

NanoKVM

NanoKVM: Affordable, Multifunctional, Nano RISC-V IP-KVM
1
star