1# device_board_telink 2 3## Overview 4 5The TLSR951x Series is the latest addition to Telink’s high-performance, ultra-low-power, 6cost-optimized wireless connectivity SoC family. The TLSR951x is a Bluetooth® Dual-mode IC, 7having both Bluetooth Classic and Bluetooth LE radios on a single chip. It integrates a powerful 832-bit RISC-V MCU with a variety of powerful core features and peripheral blocks to provide a 9foundation for advanced hearable and wearable devices. The TLSR951x includes multi-stage power 10management design allowing ultra-low power operation and making it the ideal candidate for 11power-sensitive applications. The TLSR951x’s superior level of integration enables customers 12to optimise total system cost. 13 14 15 16 17## Specifications 18 19| Item | Description | 20| ---------- | -------------------------------- | 21| CPU | TLSR9518A, RISC-V (Max: 96MHz) | 22| RAM | 256KB SRAM | 23| Flash | 2MB SPI Flash | 24| GPIO | 40 | 25| I2C | 1 | 26| UART | 2 | 27| SPI | Memory SPI, HSPI, PSPI | 28| USB | 1 | 29| PWM | 6 | 30| LED | 4 | 31| Debug | JTAG Swire | 32| ADC | 10-channel 14bit auxilary ADC | 33| Button | 4 | 34 35## Environment setup 36 371. Install Ubuntu dependencies: 38 ```bash 39 sudo apt-get install build-essential gcc g++ make zlib* libffi-dev e2fsprogs pkg-config flex bison perl bc openssl libssl-dev libelf-dev libc6-dev-amd64 binutils binutils-dev libdwarf-dev u-boot-tools mtd-utils gcc-arm-linux-gnueabi cpio device-tree-compiler 40 ``` 412. Download and unzip toolchine: http://wiki.telink-semi.cn/tools_and_sdk/Tools/IDE/telink_riscv_linux_toolchain.zip 423. Install toolchain dependencies: 43 ```bash 44 sudo dpkg --add-architecture i386 45 sudo apt-get update 46 sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 47 ``` 484. Set the environment variable TELINK_RISCV_TOOLCHAIN to the path to GCC toolchain: 49 ```bash 50 export TELINK_RISCV_TOOLCHAIN=~/progs/telink_riscv_linux_toolchain/nds32le-elf-mculib-v5f/bin 51 ``` 525. Download and unzip archive: https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/latest 536. Copy file `gn` to any folder in PATH. For example: `sudo cp gn /usr/local/bin/` 547. Install ninja 55 ```bash 56 sudo apt-get install ninja-build 57 ``` 588. Check if the package `pip` is installed 59 ```bash 60 python3 -m pip --version 61 ``` 62 If not instaled: 63 ```bash 64 sudo apt-get install python3-pip 65 ``` 669. Install hb: 67 ```bash 68 python3 -m pip install --user ohos-build==0.4.6 69 ``` 7010. Check if soft link exists `python->python3` 71 72## Build 73 741. Run in openharmony repo root 753. Run `hb set` and then select project from table: 76 77 | Project name | Description | 78 | :--- | :--- | 79 | led_demo | simple led example for b91 devkit | 80 | ble_demo | simple ble example for b91 devkit | 81 | xts_demo | unit tests for b91 devkit | 82 83 or set project name as an argument of hb set, like: `hb set -p <project_name>` 84 854. Run `hb build` 86 You can also run with options in the table: 87 88 | Option name | Option description | Option type | 89 | :--- | :--- | :---: | 90 | disasm_unstripped_version | Use unstripped ELF file version to disassemble and symbols export | binary | 91 | telink_gpio_irq_sample_enable | Switch on GPIO IRQ sample | binary | 92 93For example: `hb build --gn-args='disasm_unstripped_version=true'` 94The compiled binary file should be `out/b91_devkit/<project_name>/bin/<project_name>.bin` 95 96## Clean 97For do full project clenup (shall be done from openharmony repo root): 98```bash 99rm -rf out ohos_config.json 100``` 101 102## Change notes 103* In many gn files added include pathes: `//utils/native/lite/include` and `//utils/native/base/include` 104