Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Clone a BSP repository:

    Code Block
    git clone https://github.com/voxelbotics/riscv-ble-bsp.git
    cd riscv-ble-bsp
    
  2. Create a build directory and run CMake to generate Makefiles:

    Code Block
    mkdir build
    cd build
    cmake -DCMAKE_TOOLCHAIN_FILE="../riscv-cross-linux.cmake" -DCMAKE_BUILD_TYPE=Debug ..
    
  3. Run make to build the BSP:

Code Block
make

Building Specific Libraries and Demos

...

Code Block
$ ls -l build/ml_ble_platform/CMakeProjects/sensor_base
...
-rw-rw-r-- 1 user user 1884649 Jan  4 00:28 objdump.txt
-rw-rw-r-- 1 user user   76851 Jan  4 00:28 readelf.txt
-rwxrwxr-x 1 user user  156860 Jan  4 00:28 sensor_base_mission-evb-002.001.000.bin
-rwxrwxr-x 1 user user  774792 Jan  4 00:28 sensor_base_mission-evb-002.001.000.elf
-rw-rw-r-- 1 user user  102772 Jan  4 00:28 symbol.txt

where

ml_ble_platform is the <project name>;
sensor_base is the <target name>;
sensor_base_mission-evb-002.001.000.elf and sensor_base_mission-evb-002.001.000.bin are the resulting binaries;
objdump.txt, readelf.txt, and symbol.txt are the output files for objdump, readelf, and nm.

Programming the Target

  1. Connect the target board to the Telink "Burning EVK" via Swire as shown in the following picture:
    TBD
    - Connect EVK SWM pin to the target's SWS pin;
    - Connect the EVK 3V3 (5V) and GND pins to the target's 3V3 (5V) and GND pins, respectively.

  2. If the target is in the "sleep" mode, run the activate command:

    Code Block
    tcdb 9518 activate

    Note that the target may also be completely inaccessible via Single Wire interface and will require resetting via an external source.

  3. Sync the Telink "Burning EVK" with the target:

    Code Block
    sudo tcdb 9518 sws
  4. Write a required firmware to the target:

    Code Block
    sudo tcdb 9518 wf <addr> -i <firmware file name> -b

    where
    -b specifies the binary file format;
    <addr> specifies is an offset in the SoC's internal Flash. This value is hexadecimal, but it should be used without the "0x" prefix (eg 1000, ff000).

  5. Reset the target using external reset or by power cycling the target.

...

  • Simple single part demos (the core_drivers project) that should be written to the target with the 0 offset value;

  • BLE demos (ml_ble_platform) that consist of two parts: a "bootloader" that allows OTA firmware updates and a working firmware. The "bootloader" should be written with the 0 offset value. The default offset value for the working firmware is 1000.

...

  1. Use the rf command to read from the target’s target memory:

    Code Block
    tcdb 9518 rf <addr> -s <size> -o <output file>

    where <addr> is an internal Flash offset (refer to the wf command);
    -s is the byte count to be read from the target. ;
    <size> is a decimal value that specifies the k/m suffixes for kilo- and megabytes.

  2. Use the wf command to erase the target internal Flash:

    Code Block
    tcdb 9518 wf <addr> -s 1 -e

...