Skip to content

Files

Latest commit

 

History

History
215 lines (143 loc) · 9.08 KB

SLE_Device_Configure_Tutorial_Hi2821.md

File metadata and controls

215 lines (143 loc) · 9.08 KB

该教程演示如何通过两块开发板实现SLE数据传输测试,A开发板通过串口接收数据,然后通过SLE传输给B开发板,B开发板通过串口将接收到的数据打印出来;同样,B开发板通过串口接收数据,然后通过SLE传输给A开发板,A开发板通过串口将接收到的数据打印出来。在测试中需要一块开发板做为Server端,另外一块开发板做为Client端,两块开发板配对后就可以互发消息了。

图片

图片

  • 准备2块BearPi-Pico H2821开发板
  • 准备2根USB Type-C双头数据线,方便开发板连入手机等设备
  • 准备好硬件侧端项目,因为需要编译,点我前往硬件侧端

在Windows下编译操作

  1. 点击左侧的“KConfig”,打开配置界面.

    Alt text

  2. 选择Enable SLE UART Server sample

    Application  --->
        [*] Enable Sample.
        [ ]     Enable the Sample of peripheral.
        [*]     Enable the Sample of products.
        [ ]         Enable all the sample of product, it's just for build.
        [ ]         Support BLE UART sample.
        [*]         Support SLE UART sample.
                        SLE UART Sample Configuration  --->
                            Select sle uart type (Enable SLE UART Server sample.)  --->
                                    (X) Enable SLE UART Server sample.
                                    ( ) Enable SLE UART Client sample.
    

    Alt textAlt text

  3. 选择协议

    Protocol  --->
        Select sle ble support  --->
            ( ) Select sle ble central default.
            (X) Select sle ble peripheral.
            ( ) Select sle peripheral.
            ( ) Select sle central.
            ( ) Select ble peripheral.
    
    
    

    Alt text

  4. 按下"Save"键保存配置。

    Alt text

  5. 编译烧录固件

    参考环境搭建教程编译烧录代码

在Ubuntu下编译操作

  1. 在MobaXterm中输入:

  2. 选择Enable SLE UART Server sample

    Application  --->
        [*] Enable Sample.
        [ ]     Enable the Sample of peripheral.
        [*]     Enable the Sample of products.
        [ ]         Enable all the sample of product, it's just for build.
        [ ]         Support BLE UART sample.
        [*]         Support SLE UART sample.
                        SLE UART Sample Configuration  --->
                            Select sle uart type (Enable SLE UART Server sample.)  --->
                                    (X) Enable SLE UART Server sample.
                                    ( ) Enable SLE UART Client sample.
    

    Alt textAlt text

  3. 选择协议

    Protocol  --->
        Select sle ble support  --->
            ( ) Select sle ble central default.
            (X) Select sle ble peripheral.
            ( ) Select sle peripheral.
            ( ) Select sle central.
            ( ) Select ble peripheral.
    
    
    

    Alt text

  4. 按下"ESC"键退出并保存配置。

  5. 编译烧录固件

    参考环境搭建教程编译烧录代码

在Windows下编译操作

  1. 点击左侧的“KConfig”,打开配置界面.

    Alt text

  2. 选择Enable SLE UART Client sample

    Application  --->
        [*] Enable Sample.
        [ ]     Enable the Sample of peripheral.
        [*]     Enable the Sample of products.
        [ ]         Enable all the sample of product, it's just for build.
        [ ]         Support BLE UART sample.
        [*]         Support SLE UART sample.
                        SLE UART Sample Configuration  --->
                            Select sle uart type (Enable SLE UART Server sample.)  --->
                                    ( ) Enable SLE UART Server sample.
                                    (X) Enable SLE UART Client sample.
    

    Alt textAlt text

  3. 选择协议

    Protocol  --->
        Select sle ble support  --->
            (X) Select sle ble central default.
            ( ) Select sle ble peripheral.
            ( ) Select sle peripheral.
            ( ) Select sle central.
            ( ) Select ble peripheral.
    
    
    

    Alt text

  4. 按下"Save"键保存配置。

    Alt text

  5. 编译烧录固件

    参考环境搭建教程编译烧录代码

在Ubuntu下编译操作

  1. 在MobaXterm中输入:

  2. 选择Enable SLE UART Client sample

    Application  --->
        [*] Enable Sample.
        [ ]     Enable the Sample of peripheral.
        [*]     Enable the Sample of products.
        [ ]         Enable all the sample of product, it's just for build.
        [ ]         Support BLE UART sample.
        [*]         Support SLE UART sample.
                        SLE UART Sample Configuration  --->
                            Select sle uart type (Enable SLE UART Server sample.)  --->
                                    ( ) Enable SLE UART Server sample.
                                    (X) Enable SLE UART Client sample.
    

    Alt textAlt text

  3. 选择协议

    Protocol  --->
        Select sle ble support  --->
            (X) Select sle ble central default.
            ( ) Select sle ble peripheral.
            ( ) Select sle peripheral.
            ( ) Select sle central.
            ( ) Select ble peripheral.
    
    
    

    Alt text

  4. 按下"ESC"键退出并保存配置。

  5. 编译烧录固件

    参考环境搭建教程编译烧录代码

烧录固件后先启动server设备,再启动client设备,在串口工具的输入框中输入数据并发送,测试server和client设备之间的数据收发,如下图所示。

Alt text

Alt text

Alt text