This repository has been archived on 2023-07-17. You can view files and clone it, but cannot push or open issues or pull requests.
bl_mcu_sdk/README.md

176 lines
7.0 KiB
Markdown
Raw Normal View History

2021-06-26 15:03:25 +08:00
[![License](https://img.shields.io/badge/License-Apache--2.0-brightgreen)](LICENSE)
[![Release](https://img.shields.io/github/v/tag/bouffalolab/bl_mcu_sdk?color=s&label=release)]()
2021-04-13 19:23:11 +08:00
2021-06-25 17:43:48 +08:00
[中文版](README_zh.md)
2021-04-13 19:23:11 +08:00
2021-06-25 17:43:48 +08:00
# Introduction
**bl mcu sdk** is an MCU software development kit provided by the Bouffalo Lab Team, supports all the series of Bouffalo chips.
# SDK Versions & Chip Support
Note1**drivers before v1.4.5 use v1.0hal + std, the later version will use v2.0 (lhal + soc)**。If you want to use **v1.4.5**, please checkout your branch to [release-v1.4.5](https://github.com/bouffalolab/bl_mcu_sdk/tree/release_v1.4.5).
Note2due to the non-generic peripherals, the code style and interface name in **soc** are still the previous version, but will be subsequently updated to the new code style。
| CHIP | v1.4.5 | latest |
|:-------------:|:--------:|:-------:|
|BL602/BL604 | ✔️ | ❌ |
|BL702/BL704/BL706 | ✔️ | ✔️ |
|BL616 | ❌ | ✔️ |
|BL808 | ❌ | ✔️ |
## LHAL Support
**LHAL** is a low level hal driver for common peripherals designed by Bouffalo Lab, in order to support all the Bouffalo chips with the same api . Also it is convenient for users to use and port to other platforms.
Note**✔️** means supported **❌** means not supported**❓** means supported but not tested **** means no such peripheral。
| Peripheral | BL602/BL604 | BL702/BL704/BL706 | BL616 | BL808 |
|:-------:|:---------------:|:--------------------:|:--------------:|:--------------:|
| ADC | ❓ | ✔️ | ✔️ | ❓ |
| CAM | | ❌ | ❌ | ❌ |
| DAC | ❓ | ✔️ | ✔️ | ❓ |
| DMA | ❓ | ✔️ | ✔️ | ✔️ |
| EFUSE | ❌ | ❌ | ❌ | ❌ |
| EMAC | | ✔️ | ✔️ | ✔️ |
| FLASH | ❌ | ❌ | ❌ | ❌ |
| GPIO | ❓ | ✔️ | ✔️ | ✔️ |
| I2C | ❓ | ✔️ | ✔️ | ❓ |
| IR | ❓ | ✔️ | ✔️ | ❓ |
| MJPEG | ❌ | ❌ | ❌ | ❌ |
| PWM_v1 | ❓ | ✔️ | | |
| PWM_v2 | | | ✔️ | ✔️ |
| RTC | ❓ | ✔️ | ✔️ | ✔️ |
| SEC_AES | ❓ | ✔️ | ✔️ | ✔️ |
| SEC_SHA | ❓ | ✔️ | ✔️ | ✔️ |
| SEC_TRNG | ❓ | ✔️ | ✔️ | ✔️ |
| SPI | ❓ | ✔️ | ✔️ | ❓ |
| TIMER | ❓ | ✔️ | ✔️ | ✔️ |
| UART | ❓ | ✔️ | ✔️ | ✔️ |
| USB_v1 | | ✔️ | | |
| USB_v2 | | | ✔️ | ✔️ |
2021-06-25 17:43:48 +08:00
## Code Framework
2021-04-13 19:23:11 +08:00
```
bl_mcu_sdk
├── bsp
2021-11-22 10:59:40 +08:00
│ ├── board
│ │ └── bl702
│ │ └── bl616
│ │ └── bl808
│ └── common
2021-04-13 19:23:11 +08:00
├── components
│ ├── bflog
│ ├── cherryusb
2021-11-22 10:59:40 +08:00
│ ├── fatfs
│ ├── freertos
│ ├── lua
2021-11-22 10:59:40 +08:00
│ ├── lvgl
│ ├── lwip
│ └── shell
2021-04-13 19:23:11 +08:00
├── docs
├── drivers
│ ├── lhal
│ └── soc
2021-04-13 19:23:11 +08:00
├── examples
│ ├── bflog
│ ├── fatfs
2021-11-22 10:59:40 +08:00
│ ├── freertos
│ ├── helloworld
│ ├── lua
2021-11-22 10:59:40 +08:00
│ ├── lvgl
│ ├── peripherals
│ └── shell
2021-04-13 19:23:11 +08:00
└── tools
└── cmake
└── kconfig
└── make
2021-06-25 17:43:48 +08:00
```
- **bsp/board** : including clock, pinmux, memoryheap and console init
- **bsp/common** : including bsp common driver
- **components** : including third-party components
- **docs** : including docs
- **drivers/lhal** : including bouffalo common peripherals drivers which support all the chips
- **drivers/soc** : including bouffalo non-generic peripherals drivers
- **examples** : including samples
- **tools** : including compiler tools
2021-04-13 19:23:11 +08:00
# Environment Setup
2021-04-13 19:23:11 +08:00
## Toolchain
- [riscv64-unknown-elf-gcc](https://gitee.com/bouffalolab/toolchain_gcc_t-head_windows) toolchain used in windows.
- [riscv64-unknown-elf-gcc](https://gitee.com/bouffalolab/toolchain_gcc_t-head_linux) toolchain used in linux.
- [linux-riscv64-linux-gcc](https://gitee.com/bouffalolab/linuxtoolchain_gcc_t-head) toolchain used for compiling linux code.
## Command Line Development
Before compiling with the command line, you need to select the corresponding toolchain according to your operating system, configure it to the system environment variables, and install the **make**, then you can do the following.
- Go to the demo directory where you want to compile and there are `main.c` and `Makefile` files in that directory
- Just execute the following command, take **BL616** as an example
- The first time you use it on Linux, you need to use `chmod` to configure the cmake permissions
```
cd bl_mcu_sdk
chmod +x tools/cmake/bin/cmake
cd examples/helloworld
make CHIP=bl616 BOARD=bl616dk
```
- If you use **BL808** or **BL606P**, you need to add **CPU_ID** with m0 or d0.
```
cd bl_mcu_sdk
chmod +x tools/cmake/bin/cmake
cd examples/helloworld
make CHIP=bl808 BOARD=bl808dk CPU_ID=m0
```
## CDK Development
2021-04-13 19:23:11 +08:00
TODO
2021-04-13 19:23:11 +08:00
# Resources
## Chip Manual
**Chip Reference Manual** and **Chip Data Manual** are listed on [document](https://dev.bouffalolab.com/document)
## Documentation Tutorial
To get more bl mcu sdk documentation tutorial, like api manual or peripheral demo and so on, please visit:
2021-04-13 19:23:11 +08:00
- [bl mcu sdk v1.4.5 documentation tutorial](https://dev.bouffalolab.com/media/doc/sdk/bl_mcu_sdk_en/index.html)
## Video Tutorial
- [BL706 MCU Development Series Video Tutorial](https://www.bilibili.com/video/BV1xK4y1P7ur)
2021-06-26 15:03:25 +08:00
### Flash Tool
2021-06-25 17:43:48 +08:00
In addition to using CK-link, J-link and command line programming, it also supports graphical programming tools.
2021-06-26 15:03:25 +08:00
Graphical programming tools provided by Bouffalolab:
2022-02-24 10:57:39 +08:00
- [Bouffalo Lab Dev Cube](https://dev.bouffalolab.com/download)
2021-04-13 19:23:11 +08:00
2021-06-25 17:43:48 +08:00
## Forum
2021-04-13 19:23:11 +08:00
2021-06-25 17:43:48 +08:00
Bouffalolab Developer Forum: [https://bbs.bouffalolab.com/](https://bbs.bouffalolab.com/)
2021-04-13 19:23:11 +08:00
2021-06-25 17:43:48 +08:00
# License
2021-04-13 19:23:11 +08:00
2021-06-25 17:43:48 +08:00
**bl mcu sdk** is completely open source and follows the Apache License 2.0 open source license agreement. It can be used in commercial products for free and does not require public private code.
2021-04-13 19:23:11 +08:00
```
/*
* Copyright (c) 2021 Bouffalolab team
*
* SPDX-License-Identifier: Apache-2.0
*/
2021-11-22 10:59:40 +08:00
```