• Stars
    star
    140
  • Rank 261,473 (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

NanoKVM

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

MaixPy-v1

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

TinyMaix

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

MaixPy-v1_scripts

micropython scripts for MaixPy
Python
622
star
5

Maix-Speech

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

Maixduino

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

TangNano-9K-example

TangNano-9K-example project
GLSL
211
star
8

platform-gd32v

GD32V: development platform for PlatformIO
Python
182
star
9

MaixPy3

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

kflash_gui

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

MaixPy

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

TangPrimer-20K-example

TangPrimer-20K-example project
GLSL
129
star
13

sipeed_wiki

sipeed wiki๏ผšhttps://wiki.sipeed.com
JavaScript
94
star
14

TangNano-4K-example

TangNano-4K-example project
GLSL
87
star
15

Longan_GD32VF_examples

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

Maix_Toolbox

Maix Toolbox: Collections of model scripts
Python
82
star
17

maix_train

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

platform-kendryte210

Kendryte K210: development platform for PlatformIO
Python
78
star
19

MaixUI

This is the MicroPython UI framework.
Python
76
star
20

bl602-hal

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

LicheeRV-Nano-Build

LicheeRV-Nano-Build
C
75
star
22

Longduino

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

libmaix

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

Maix-EMC

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

sipeed_keyboard

sipeed opensource mechanical keyboard make with BL706
C
64
star
26

TangNano-20K-example

TangNano-20K-example
GLSL
64
star
27

Tang-Nano-examples

Tang-Nano-examples
GLSL
62
star
28

M1s_BL808_example

M1s_BL808_example
C
61
star
29

M1s_BL808_SDK

M1s(BL808)SDK
C
56
star
30

Tang-Nano-Doc

Document for Tang Nano FPGA board
CSS
56
star
31

TangMega-138KPro-example

Tang Mega 138K Pro examples
F#
52
star
32

sipeed2022_autumn_competition

sipeed2022_autumn_competition
47
star
33

MF1-User-Manual

MF1 Face Recognition Module User Manual
Python
46
star
34

Longan-DOC

Longan RV32 Boards Document
CSS
46
star
35

MaixCDK

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

axpi_bsp_sdk

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

bl602-rust-guide

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

LicheePi4A

LicheePi4A info&sdk
32
star
39

TangPrimer-25K-example

TangPrimer-25K-example project
Verilog
31
star
40

TangMega-138K-example

TangMega-138K-example project
Verilog
28
star
41

Sipeed_HardWare

Sipeed_HardWare wiki
27
star
42

M0S_BL616_example

M0S BL616 example (M0S dock)
C
25
star
43

MF1_SDK

C
22
star
44

bl602-pac

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

R329-Tina-jishu

Roff
18
star
46

M0sense_BL702_example

M0sense_BL702_example
C
16
star
47

Maixduino_DOC

Docs of Maixduino
CSS
14
star
48

MaixPy_Doc_Us_En_Backup

Python
14
star
49

Tang-Hex-BSP

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

sipeed2022_spring_competition

sipeed2022_spring_competition
Python
11
star
51

Maix-Keras-workspace

Keras workspace for Sipeed MAIX boards
Python
11
star
52

Maix-TF-workspace

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

rpyc_ikernel

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

Maix-Face-Uart-Lib

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

TangNano-1K-examples

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

Tang-Hex-Doc

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

LonganPi-3H-SDK

LonganPi 3H SDK
Shell
7
star
58

MetaSense-ComTool

MetaSense A010's ComTool
Python
6
star
59

r329-linux-4.9

C
5
star
60

MaixSense_ROS

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

M0P_BL618_examples

M0P_BL618_examples
C
5
star
62

LicheePi4A-Build

LicheePi4A-Build
C
5
star
63

libomv

Transplantation of openMV core algorithm imlib
C
5
star
64

Nano-Doc-Backup

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

r329-target

Roff
3
star
66

ullama2.c

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

r329-package

C
2
star
68

platform-riscv-e203

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

BL702_Si2c_uart_translation

BL702 Slave i2c uart translation.
C
2
star
70

MaixPy_Doc_Zh_Cn_Backup

Python
2
star
71

TangMega-60K-example

TangMega 60K example
Verilog
1
star