ST意法半导体
直播中

好名字

9年用户 866经验值
擅长:可编程逻辑
私信 关注
[问答]

BLE_CableReplacement不起作用的原因?

您好,我正在尝试在两个 P-Nucleo_wb55 板之间建立通信
一旦我使用 cubeIDE 示例刷新固件
(STM32CubeRepositorySTM32Cube_FW_WB_V1.12.1ProjectsP-NUCLEO-WB55.NucleoApplicationsBLEBLE_CableReplacement)
  • #define GATT_CLIENT                                                           0//1//chaning this for client/server roles
我在我的 PC 上打开串行终端(putty 或 realterm),COM 端口可见但它们没有响应....

回帖(1)

夏焕丽

2022-12-26 14:25:14
来自 STM32CubeRepositorySTM32Cube_FW_WB_V1.12.1ProjectsP-NUCLEO-WB55.NucleoApplicationsBLEBLE_CableReplacementreadme.txt


  • @par How to use it ?




  • This application requires having the stm32wb5x_BLE_Stack_full_fw.bin binary flashed on the Wireless Coprocessor.

  • If it is not the case, you need to use STM32CubeProgrammer to load the appropriate binary.

  • All available binaries are located under /Projects/STM32_Copro_Wireless_Binaries directory.

  • Refer to UM2237 to learn how to use/install STM32CubeProgrammer.

  • Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the detailed procedure to change the

  • Wireless Coprocessor binary.

  做到了



  • In order to make the program work, you must do the following:

  • - Open your preferred toolchain

  • - Rebuild all files and load your image into target memory

我使用 STM32CubeIDE v1.7.0 并成功构建和闪烁



  • Two STM32WB55xx boards are used one acting as GATT client, the other as GATT server.

  • Both boards need to be compiled with different code by changing the #definitions in app_conf.h

  • #define GATT_CLIENT        0/1   /* 1 = Device is GATT Client, 0 = Device is GATT Server */

  • If device is GATT client, it is also central (defined in ble_conf.h)

  • If device is GATT server, it is also peripheral (defined in ble_conf.h)

这样做并闪现了两个不同的图像,每个 wb55 一个


  • Open VT100 Terminals on Client and Server side. Connected to ST Link COM port @115200.

不知道 VT100 终端是什么,我正在尝试使用 putty 和 realTerm,可以吗?它不是


  • Once the code is downloaded on the two STM32WB55xx boards and executed,

  • the modules are initialized.

  • The Peripheral device (Cable Replacement Server) starts advertising,

  • The Central device (Cable Replacement Client) scans and automatically connects to the Cable Replacement Server.

  • Once connected, the Cable Replacement Client (GATT Client) starts to search the Cable Replacement Services & Characteristics.

  • The above phase takes about 5 seconds, after that period Reception and Transmission parts will appear in the Client and Server VT100 Terminals.

  • On each VT100 Terminal windows you can type the text you want to send and receive the text sent by the connected device.




  • To summarise:

  • *1* User write text on GATT Server VT100 Terminal

  • *2* Server ----------- Notification packet ------>  Client

  • or

  • *1* User write text on GATT Client VT100 Terminal

  • *2* Client ----------- Wtite Command packet ------>  Server

它实际发生的是这个
我输入 ascii“u”,然后 stlink 回答了一个奇怪的字符串(在另一个模块中没有任何反应)
好的,我意识到 VT100 不仅仅是串行终端程序的名称,这是一个完全不同的古老 uart 协议 yeey(它以八进制定义)

所以更多的逆向工程,我开始相信这不会是一个非常有用的例子

所以如果我发送字符“t”
我会得到回复“e[32;23Ht”,这看起来像
https://vt100.net/docs/vt100-ug/chapter3.html

“e[”等同于“ESC[”(CSI)

最后一个 H 是
最终字符
   其位组合终止转义或控制序列的字符。
参数字符串有两个参数,它们在这个函数中构建


  • void PosCur(uint8_t iX, uint8_t iY)
  • {
  •   char szCtrl[30] = "33[01;01H";

  •   szCtrl[3] = (int8_t) ((iY % 10) + '0');
  •   szCtrl[2] = (int8_t) ((iY / 10) + '0');
  •   szCtrl[6] = (int8_t) ((iX % 10) + '0');
  •   szCtrl[5] = (int8_t) ((iX / 10) + '0');

  •   UartTransmitStr(szCtrl);
  • }

举报

更多回帖

发帖
×
20
完善资料,
赚取积分