Alastakelay/Low-Level_BL602
GitHub: Alastakelay/Low-Level_BL602
通过纯汇编语言的裸机代码示例,为 BL602 RISC-V 微控制器提供比厂商更清晰的底层硬件文档和 MMIO 交互参考。
Stars: 2 | Forks: 0
   
# 我并没有全职在这个项目上工作,因为这对我来说只是个爱好
# 尽管如此,我对它依然充满热情
# 在此期间,请尽情享用我为您提供的这一点点代码,查阅 General E24 [核心文档](https://www.sifive.com/document-file/e24-core-complex-manual),并为当前或未来的项目提交问题或想法
# BareMetal_BL602
本项目旨在通过 __使用汇编语言编写__ 的实用示例,记录并阐明 [**BouffaloLab602**](https://en.bouffalolab.com/product/?type=detail&id=1)
单核微控制器的部分内部机制
创建此仓库是出于无奈,因为对于这款本来非常出色的 [**RISC-V**](https://riscv.org/) 嵌入式芯片,普遍缺乏良好的文档和实用的裸机代码示例,同时也出于对 RISC-V ISA 和汇编语言的普遍好奇
此外还有其他很酷的 RISC-V 微控制器,比如 RP2350/4A/B(带有 bitmanip)、ESP32-C/H/P 系列芯片或 bao1x,我鼓励你去了解一下
我的目标是通过提供简洁的汇编代码,一点一滴地改善文档,
读者可以通过这些代码确切了解他们 *到底应该如何* 通过 [**MMIO**](https://en.wikipedia.org/wiki/Memory-mapped_I%2FO_and_port-mapped_I%2FO) 与内部组件和外围设备进行交互,而无需任何令人困惑的 ***HAL*** 或 ***SDK***
## 在线资源:
- PineCone [原理图](https://github.com/pine64/bl602-docs/blob/main/mirrored/Pine64%20BL602%20EVB%20Schematic%20ver%201.1.pdf)
- SDK 中的控制 MMIO 的 [C 函数](https://github.com/pine64/bl_iot_sdk/tree/master/components/bl602/bl602_std/bl602_std/StdDriver/Src)
### **BL602** 中使用的中断控制器(SiFive 的 CLIC):
- General E24 [核心文档](https://www.sifive.com/document-file/e24-core-complex-manual)
- SiFive CLIC [规范](https://github.com/marceg/clic-spec/tree/master?tab=readme-ov-file)
- CLIC/CLINT [地址映射](https://github.com/openshwprojects/OpenBL602/blob/master/components/platform/soc/bl602/bl602_std/bl602_std/RISCV/Core/Include/clic.h)
### 直接控制 [GPIO](https://gtker.com/running-assembly-on-the-bl602-risc-v-microcontroller-and-directly-controlling-gpio/)
### Bouffalo Lab 文档:
- [参考手册](https://github.com/bouffalolab/bl_docs/blob/main/BL602_RM/en/BL602_BL604_RM_1.2_en.pdf)
- [数据手册](https://github.com/bouffalolab/bl_docs/blob/main/BL602_DS/en/BL602_BL604_DS_1.6_en.pdf)
- [ISP 协议](https://github.com/bouffalolab/bl_docs/blob/main/BL602_ISP/en/BL602_ISP_protocol.pdf)
### MMIO 映射与[硬件说明](https://github.com/tchebb/bl602-docs/tree/main/hardware_notes)
### RISC-V 文档:
- RISC-V 指令[编码器/解码器](https://luplab.gitlab.io/rvcodecjs/)
- RISC-V ISA [手册](https://riscv-software-src.github.io/riscv-unified-db/manual/html/isa/isa_20240411/index.html)
- RISC-V International 的官方 ISA [规范](https://riscv.org/specifications/ratified/)
### 使用 [Ghidra](https://github.com/NationalSecurityAgency/ghidra) 进行反汇编
### 工作流:
- [VSCodium](https://github.com/VSCodium/vscodium) 代码编辑器
- GCC (riscv64-linux-gnu-gcc & riscv64-linux-gnu-objcopy)
- 烧录工具:Ubuntu 上的 [Blflash](https://github.com/spacemeowx2/blflash),Arch Linux 上的 Blisp
# 请我喝杯咖啡:
## Monero:
84mP7cpjx8LGC9psMhD2RsGKmc7TfxJdcVXsjVES2dT2YmJkGuSHjr4NUGYpdWoKLrSmkQeXGypU32RU1HwRqvgMGkpCREf
标签:Assembly, Bare Metal, BL602, BouffaloLab, GPL-3.0, IoT, MCU, MMIO, Pine64, PineCone, RISC-V, 内存映射IO, 单片机, 固件开发, 安全报告生成, 寄存器操作, 嵌入式开发, 底层开发, 开源硬件, 微控制器, 快速连接, 技术文档, 汇编语言, 物联网, 硬件接口, 硬件调试, 硬核编程, 芯片手册, 裸机编程