Settings | Sign in | Sign up

There are currently 30 posts.

Telink IoT Studio打开TLSR8258 SDK的cproject工程

Floor 11 巨大八爪鱼 1/7/26 17:07
运行Debug_Demo,把电脑串口接到PA2引脚上,波特率设为115200,可以看到printf打印。


在drivers/printf.c的io_putchar函数里面加上
if (byte == '\n')
    io_putchar('\r');
即可解决Tera Term无法换行显示的问题。

巨大八爪鱼: 修改drivers/printf.h:
#define PRINT_BAUD_RATE                     1000000       //1M baud rate,should Not bigger than 1Mb/s
#define DEBUG_INFO_TX_PIN                   GPIO_PB1
可以改成和蓝牙程序一样的PB1引脚和100万波特率。
Floor 12 巨大八爪鱼 1/7/26 17:31

tc_ble_single_sdk_B85这个蓝牙程序,串口的输出引脚是PB1,波特率是1000000。

修改application/print/putchar.c的putchar函数,在return uart_putc((char)c);前加上

    if (c == '\n')
        uart_putc('\r');

可解决Tera Term的换行问题。

巨大八爪鱼: https://www.telink-semi.cn/products/bluetooth-le/tlsr825x
 SDK名称     支持芯片     SDK版本     下载SDK     SDK开发手册
Bluetooth® LE Single Connection     TLSR8258/8253/8251      V3.4.2.8_Patch_0001     Gitee     

下载蓝牙SDK:
https://gitee.com/telink-semi/tc_ble_single_sdk/releases/tag/V3.4.2.8_Patch_0001
https://gitee.com/telink-semi/tc_ble_single_sdk/archive/refs/tags/V3.4.2.8_Patch_0001.zip
SDK开发手册:
https://doc.telink-semi.cn/doc/zh/software/res/sdk/ble/b85m_ble_cn/b85m_ble_single_connection_cn/
Floor 13 巨大八爪鱼 1/7/26 17:38
[APP][EVT] remote terminate, reason 0x16

巨大八爪鱼: HCI_ERR_CONN_TERM_BY_LOCAL_HOST = 0x16
巨大八爪鱼: 出现这个说明蓝牙连接和手机断开了。
Floor 14 巨大八爪鱼 1/7/26 20:08
蓝牙设备名叫VHID,可以在手机上配对并连接。
巨大八爪鱼: 这个大写的VHID是因为我运行了ble_sample那个例程,里面的名字叫大写的VHID,所以名字被手机记住了。
巨大八爪鱼: ble_remote例程是小写的vhid。
Floor 15 巨大八爪鱼 1/7/26 20:08
Floor 16 巨大八爪鱼 1/7/26 20:13

蓝牙设备的名称是在这个地方定义的:


可以改名成uhid。

Floor 17 巨大八爪鱼 1/7/26 20:30

安卓手机上配对前显示的名称是vhid,配对后显示的名称是tRemote。

/**
 * @brief    Adv Packet data
 */
const u8    tbl_advData[] = {
     0x05, 0x09, 'u', 'h', 'i', 'd',
     0x02, 0x01, 0x05,                             // BLE limited discoverable mode and BR/EDR not supported
     0x03, 0x19, 0x80, 0x01,                     // 384, Generic Remote Control, Generic category
     0x05, 0x02, 0x12, 0x18, 0x0F, 0x18,        // incomplete list of service class UUIDs (0x1812, 0x180F)
};


static const u8 my_devName[] = {'t','R','e','m','o','t','e'};


苹果手机上配对前显示的名称是VRemote或tRemote,配对后显示的名称是tRemote。

/**
 * @brief    Scan Response Packet data
 */
const u8    tbl_scanRsp [] = {
         0x08, 0x09, 'V', 'R', 'e', 'm', 'o', 't', 'e',
    };

巨大八爪鱼: 安卓手机配对后的名称也有可能是vhid。
巨大八爪鱼: 太乱了 最好三个名称都一样吧。
因为手机有缓存
Floor 18 巨大八爪鱼 1/7/26 20:33
Floor 19 巨大八爪鱼 1/7/26 20:33

Content converter:

Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.