1# HPMicro HPM6E00EVK BSP(Board Support Package) Introduction 2 3[中文页](README_zh.md) | 4 5## Introduction 6 7This document provides brief introduction of the BSP (board support package) for the HPM6E00EVK development board. 8 9The document consists of the following parts: 10 11- HPM6E00EVK Board Resources Introduction 12- Quickly Getting Started 13- Refreences 14 15By reading the Quickly Get Started section developers can quickly get their hands on this BSP and run RT-Thread on the board. More advanced features will be introduced in the Advanced Features section to help developers take advantage of RT-Thread to drive more on-board resources. 16 17## Board Resources Introduction 18 19HPM6E00EVK is a development board based on the RISC-V core launched by HPMicro, with rich on-board resources and on-chip resources for Connectivity, Audio, motor control,etc. 20 21 22 23## Peripheral Condition 24 25Each peripheral supporting condition for this BSP is as follows: 26 27 28| **On-board Peripherals** | **Support** | **Note** | 29| ------------------------ | ----------- | ------------------------------------- | 30| USB | √ | | 31| QSPI Flash | √ | | 32| Ethernet | √ | | 33| GPIO | √ | | 34| SPI | √ | | 35| I2C | √ | | 36| RTC | √ | | 37| PWM | √ | | 38| On-Board Debugger | √ | ft2232 | 39 40 41## Execution Instruction 42 43### Quickly Getting Started 44 45The BSP support being build via the 'scons' command, below is the steps of compiling the example via the 'scons' command 46 47#### Parpare Environment 48- Step 1: Prepare [RT-Thread ENV](https://www.rt-thread.org/download.html#download-rt-thread-env-tool) 49- Step 2: Prepare [toolcahin](https://github.com/helloeagleyang/riscv32-gnu-toolchain-win/archive/2022.04.12.zip) 50 - Download the package and extract it into a specified directory, for example: `C:\DevTools\riscv32-gnu-toolchain` 51- Step 3: Set environment variable `RTT_RISCV_TOOLCHAIN` to `<TOOLCHAIN_DIR>\bin` 52 - For example: `C:\DevTools\riscv32-gnu-toolchain\bin` 53- Step 4: Prepare [OpenOCD](https://github.com/hpmicro/rtt-debugger-support-package/archive/v0.4.0.zip) 54 - Download and extract it to specified directory, for example: `C:\DevTools\openocd-hpmicro` 55 - Add `OpenOCD` environment variable `OPENOCD_HPMICRO` to `<OPENOCD_HPMICRO_DIR>\bin` 56 - For example: `C:\DevTools\openocd-hpmicro\bin` 57 58#### Configure and Build project 59 60Open RT-Thread ENV command-line, and change directory to this BSP directory, then users can: 61 62- Configure the project via `menuconfig` in `RT-Thread ENV` 63- Build the project using `scons -jN`, `N` equals to the number of CPU cores 64- Clean the project using `scons -c` 65 66#### Hardware Connection 67 68- Switch BOOT pin to 2'b00 69- Connect the `PWR_DEBUG` port to PC via TYPE-C cable 70 71 72#### Dowload / Debug 73 74- Users can download the project via the below command: 75 ```console 76 %OPENOCD_HPMICRO%\openocd.exe -f boards\debug_scripts\probes\ft2232.cfg -f boards\debug_scripts\soc\hpm6e80-single-core.cfg -f boards\debug_scripts\boards\hpm6e00evk.cfg -c "init; halt; flash write_image erase rtthread.elf; reset; shutdown" 77 ``` 78 79- Users can debug the project via the below command: 80 81 - Connect debugger via `OpenOCD`: 82 83```console 84%OPENOCD_HPMICRO%\openocd.exe -f boards\debug_scripts\probes\ft2232.cfg -f boards\debug_scripts\soc\hpm6e80-single-core.cfg -f boards\debug_scripts\boards\hpm6e00evk.cfg 85``` 86 - Start Debugger via `GDB`: 87 88```console 89%RTT_EXEC_PATH%\riscv32-unknown-elf-gdb.exe rtthread.elf 90``` 91 - In the `gdb shell`, type the following commands: 92 93```console 94load 95c 96``` 97 98### **Running Results** 99 100Once the project is successfully downloaded, the system runs automatically. The LED on the board will flash periodically. 101 102Connect the serial port of the board to the PC, communicate with it via a serial terminal tool(115200-8-1-N). Reset the board and the startup information of RT-Thread will be observed: 103 104``` 105 \ | / 106- RT - Thread Operating System 107 / | \ 5.0.1 build Aug 16 2023 18:18:18 108 2006 - 2023 Copyright by RT-Thread team 109``` 110 111## **References** 112 113- [RT-Thread Documnent Center](https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/README) 114- [RT-Thread Env](https://github.com/RT-Thread/rtthread-manual-doc/blob/master/env/env.md) 115- [HPM6800EVK RT-Thread BSP Package](https://github.com/hpmicro/rtt-bsp-hpm6e00evk)