0
  • 聊天消息
  • 系统消息
  • 评论与回复
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
会员中心
创作中心

完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>

3天内不再提示

【跃昉科技BF2开发板试用体验】四:继续学习+阶段小结

开发板试用精选 来源:开发板试用 作者:电子发烧友论坛 2022-11-09 15:37 次阅读
加入交流群
微信小助手二维码

扫码添加小助手

加入工程师交流群

本文来源电子发烧友社区,作者:FrankSmith, 帖子地址:https://bbs.elecfans.com/jishu_2296120_1_1.html

想进行tc
pip通讯,首先得连接网络。当然了,这个板子没有以太网接口,得利用板子的WiFi接口了。这个项目提供了一些WiFi的功能,予以一一尝试。
第一个指令是(wifi_scan)。
以下指令的输入以及信息的输出均在串口助手sscom中进行


  1. wifi_scan
  2. ------>>>>>> Scan CMD
  3. # [WIFI] [IND] SCAN Done
  4. wifi_mgmr_scan_complete_callback: scan complete
  5. [APP] [EVT] SCAN Done 69207
  6. cached scan list
  7. ****************************************************************************************************
  8. index[00]: empty
  9. index[01]: empty
  10. index[02]: empty
  11. index[03]: empty
  12. index[04]: empty
  13. index[05]: empty
  14. index[06]: empty
  15. index[07]: empty
  16. index[08]: empty
  17. index[09]: empty
  18. index[10]: empty
  19. index[11]: empty
  20. index[12]: empty
  21. index[13]: empty
  22. index[14]: empty
  23. index[15]: empty
  24. index[16]: empty
  25. index[17]: empty
  26. index[18]: empty
  27. index[19]: empty
  28. index[20]: empty
  29. index[21]: empty
  30. index[22]: empty
  31. index[23]: empty
  32. index[24]: empty
  33. index[25]: empty
  34. index[26]: empty
  35. index[27]: empty
  36. index[28]: empty
  37. index[29]: empty
  38. index[30]: empty
  39. index[31]: channel 13, bssid 16:E9:B2:91:AD:E7, rssi -98, ppm abs:rel 0 : 0, auth WPA2-PSK/WPA-PSK, cipher: AES, SSID CMCC-uWN6-2
  40. index[32]: channel 13, bssid 14:E9:B2:91:AD:E7, rssi -87, ppm abs:rel 0 : 0, auth WPA2-PSK/WPA-PSK, cipher: AES, SSID CMCC-uWN6
  41. index[33]: channel 11, bssid 64:6E:97:C9:5A:D7, rssi -98, ppm abs:rel 0 : 0, auth WPA2-PSK/WPA-PSK, cipher: AES, SSID 3205
  42. index[34]: channel 11, bssid EC:17:2F:68:27:D4, rssi -84, ppm abs:rel 5 : 5, auth WPA2-PSK/WPA-PSK, cipher: AES, SSID TP-LINK_6827D4
  43. index[35]: channel 11, bssid 70:85:40:2B:AB:B7, rssi -79, ppm abs:rel 2 : 2, auth WPA2-PSK/WPA-PSK, cipher: TKIP/AES, SSID 468
  44. index[36]: channel 10, bssid 74:7D:24:48:97:62, rssi -98, ppm abs:rel 0 : 0, auth WPA2-PSK/WPA-PSK, cipher: TKIP/AES, SSID @PHICOMM_60
  45. index[37]: channel 10, bssid 92:3F:7B:61:27:AF, rssi -85, ppm abs:rel 2 : 2, auth WPA2-PSK/WPA-PSK, cipher: TKIP/AES, SSID iTV-iaLX
  46. index[38]: channel 11, bssid D0:76:E7:EF:03:71, rssi -98, ppm abs:rel10 :10, auth WPA2-PSK/WPA-PSK, cipher: AES, SSID ChinaNet-sefN
  47. index[39]: channel 10, bssid 68:DB:54:DF:35:E2, rssi -98, ppm abs:rel 0 : 0, auth WPA2-PSK/WPA-PSK, cipher: TKIP/AES, SSID 钂嬪
  48. index[40]: channel 10, bssid 30:3F:7B:61:27:AE, rssi -98, ppm abs:rel 4 : 4, auth WPA2-PSK/WPA-PSK, cipher: TKIP/AES, SSID ChinaNet-iaLX
  49. index[41]: channel 10, bssid 30:5F:77:80:93:DE, rssi -85, ppm abs:rel 0 : 0, auth WPA2-PSK, cipher: AES, SSID 鍖椾含鐑ら腑
  50. index[42]: channel 08, bssid 38:21:87:41:89:1D, rssi -98, ppm abs:rel35 :35, auth WPA2-PSK, cipher: AES, SSID midea_ac_0404
  51. index[43]: channel 08, bssid 24:8B:E0:5C:E0:D9, rssi -96, ppm abs:rel 7 : 7, auth WPA2-PSK/WPA-PSK, cipher: TKIP/AES, SSID liao150829
  52. index[44]: channel 10, bssid 50:D2:F5:74:BA:C2, rssi -61, ppm abs:rel 0 : 0, auth WPA2-PSK/WPA-PSK, cipher: TKIP/AES, SSID CYMY
  53. index[45]: channel 05, bssid 70:85:40:2B:AB:48, rssi -79, ppm abs:rel 0 : 0, auth WPA2-PSK/WPA-PSK, cipher: TKIP/AES, SSID 168
  54. index[46]: channel 05, bssid 70:85:40:2B:AB:FC, rssi -73, ppm abs:rel 2 : 2, auth WPA2-PSK/WPA-PSK, cipher: TKIP/AES, SSID 288
  55. index[47]: channel 03, bssid 2C:B2:1A:D0:3B:82, rssi -97, ppm abs:rel 0 : 0, auth WPA2-PSK/WPA-PSK, cipher: TKIP/AES, SSID fei
  56. index[48]: channel 03, bssid 70:85:40:2B:AB:45, rssi -52, ppm abs:rel 5 : 5, auth WPA2-PSK/WPA-PSK, cipher: TKIP/AES, SSID 368
  57. index[49]: channel 03, bssid 70:85:40:2B:AB:EF, rssi -43, ppm abs:rel13 :13, auth WPA2-PSK/WPA-PSK, cipher: TKIP/AES, SSID 268
  58. ----------------------------------------------------------------------------------------------------
  59. proc_hellow_entry: RISC-V rv32imafc.gj_lf686_demo_wifi
复制代码
找到一个可以连接的无线路由器,ssid=268
使用这个项目提供的命令:(wifi_sta_connect)


  1. wifi_sta_connect 268 07342596999
  2. wifi_sta_connect 268 07342596999
  3. ----- BUG FIXME? NOT do STA enable again
  4. [WF] MM_ADD_IF_REQ Sending: STA
  5. 歵d_start idx=0
  6. [WF] MM_ADD_IF_REQ Done
  7. [WF] vif_index from LAMC is 0
  8. [WF][SM] Entering idle state
  9. [WF][SM] Action Connect
  10. ssid 268
  11. ssid len 3
  12. psk 07342596999
  13. psk len 11
  14. pmk
  15. pmk len 0
  16. channel band 0
  17. channel freq 0
  18. mac 00:00:00:00:00:00
  19. dhcp status: true
  20. [WF][SM] State Action ###idle### --->>> ###connecting###
  21. connecting using vif_idx 0
  22. ===start sm_get_bss_params===
  23. bssid[0] = 0xffff
  24. bssid[1] = 0xffff
  25. bssid[2] = 0xffff
  26. search ssid = 268
  27. result ssid index = -1
  28. ===end sm_get_bss_params===
  29. [WF][SM] Entering connecting state
  30. # [APP] [EVT] Connecting 707891
  31. Probe Response
  32. timestamp = 0x30ef47b10
  33. Probe Response
  34. timestamp = 0x30ef84cbd
  35. Probe Response
  36. timestamp = 0x30efc2998
  37. Probe Response
  38. timestamp = 0x30f03c5d3
  39. [ 710128][[32mINFO[0m: lf_adc.c: 260] offset = 2108
  40. proc_hellow_entry: RISC-V rv32imafc.gj_lf686_demo_wifi
  41. ===start sm_get_bss_params===
  42. bssid[0] = 0xffff
  43. bssid[1] = 0xffff
  44. bssid[2] = 0xffff
  45. search ssid = 268
  46. result ssid index = 0
  47. ===end sm_get_bss_params===
  48. wpa2/wpa3 pairwise ccmp:1,tkip:0,wep104:0,wep:40:0
  49. wpa2/wpa3 group ccmp:0,tkip:1,wep104:0,wep:40:0
  50. wpa2/wpa3 is_pmf_required:0
  51. AP Security mode: wep:0,wpa:1,wpa2:1,wpa3:0
  52. Probe Response
  53. timestamp = 0x30f26308d
  54. wpa2/wpa3 pairwise ccmp:1,tkip:0,wep104:0,wep:40:0
  55. wpa2/wpa3 group ccmp:0,tkip:1,wep104:0,wep:40:0
  56. wpa2/wpa3 is_pmf_required:0
  57. AP Security mode: wep:0,wpa:1,wpa2:1,wpa3:0
  58. wpa2/wpa3 pairwise ccmp:1,tkip:0,wep104:0,wep:40:0
  59. wpa2/wpa3 group ccmp:0,tkip:1,wep104:0,wep:40:0
  60. wpa2/wpa3 is_pmf_required:0
  61. AP Security mode: wep:0,wpa:1,wpa2:1,wpa3:0
  62. ------ 247 set default key 0x42018c08, key ptr 0x00000000
  63. [APP] [EVT] SCAN On Join 711659
  64. set key:sta_idx:0, inst_nbr:0, key_idx:0,cipher_suite:2,key_len:16
  65. set key:sta_idx:255, inst_nbr:0, key_idx:1,cipher_suite:1,key_len:32
  66. ind ix 0x4201eddc, chan_ctxt is 0x420183f4
  67. [RX] Connection Status
  68. [RX] status_code 0
  69. [RX] connect result: sm connect ind ok
  70. [RX] MAC 70:85:40:2B:AB:EF
  71. [RX] vif_idx 0
  72. [RX] ap_idx 0
  73. [RX] ch_idx 0
  74. [RX] qos 1
  75. [RX] acm 0
  76. [RX] assoc_req_ie_len 80
  77. [RX] assoc_rsp_ie_len 172
  78. [RX] aid 0
  79. [RX] band 0
  80. [RX] center_freq 2422
  81. [RX] width 0
  82. [RX] center_freq1 2422
  83. [RX] center_freq2 0
  84. [WF][SM] Exiting connecting state
  85. [WF][SM] State Action ###connecting### --->>> ###wifiConnected_ipObtaining###
  86. [WF][SM] Entering wifiConnected_ipObtaining state
  87. [WF][SM] DHCP Starting...0x42019e24
  88. [APP] [EVT] connected 711685
  89. -----------------> AABA Request:
  90. A-MSDU: Not Permitted
  91. Block Ack Policy: Immediate Block Ack
  92. TID: 0
  93. Number of Buffers: 64
  94. -----------------> AABA Response:
  95. A-MSDU: Not Permitted
  96. Block Ack Policy: Immediate Block Ack
  97. TID: 0
  98. Number of Buffers: 8
  99. [lwip] netif status callback
  100. IP: 192.168.88.7
  101. MK: 255.255.255.0
  102. GW: 192.168.88.254
  103. [WF][SM] Exiting wifiConnected_ipObtaining state
  104. [WF][SM] IP GOT IP:192.168.88.7, MASK: 255.255.255.0, Gateway: 192.168.88.254, dns1: 192.168.88.254, dns2: 0.0.0.0
  105. [WF][SM] State Action ###wifiConnected_ipObtaining### --->>> ###wifiConnected_IPOK###
  106. [WF][SM] Entering wifiConnected_IPOK state
  107. [APP] [EVT] GOT IP 715004
  108. [SYS] Memory left is 150312 Bytes
  109. proc_hellow_entry: RISC-V rv32imafc.gj_lf686_demo_wifi
复制代码

在这些信息中,可以看见一条信息:


  1. [WF][SM] Exiting wifiConnected_ipObtaining state
  2. [WF][SM] IP GOT IP:192.168.88.7, MASK: 255.255.255.0, Gateway: 192.168.88.254, dns1: 192.168.88.254, dns2: 0.0.0.0
复制代码
这标识已经连上路由器,并通过dhcp分配了IP地址为192.168.88.7。

电脑中打开一个cmd窗口,查看本机的ip地址。


  1. 无线局域网适配器 WLAN:
  2. 连接特定的 DNS 后缀 . . . . . . . : Realtek
  3. IPv4 地址 . . . . . . . . . . . . : 192.168.88.6
  4. 子网掩码. . . . . . . . . . . . : 255.255.255.0
  5. 默认网关. . . . . . . . . . . . . : 192.168.88.254
  6. 以太网适配器 蓝牙网络连接:
  7. 媒体状态. . . . . . . . . . . . : 媒体已断开连接
  8. 连接特定的 DNS 后缀 . . . . . . . :
复制代码


使用ping指令,看是否能连通开发板


  1. C:Usersjohn>ping 192.168.88.7
  2. 正在 Ping 192.168.88.7 具有 32 字节的数据:
  3. 来自 192.168.88.7 的回复: 字节=32 时间=5ms TTL=255
  4. 来自 192.168.88.7 的回复: 字节=32 时间=2ms TTL=255
  5. 来自 192.168.88.7 的回复: 字节=32 时间=4ms TTL=255
  6. 来自 192.168.88.7 的回复: 字节=32 时间=9ms TTL=255
  7. 192.168.88.7 的 Ping 统计信息:
  8. 数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
  9. 往返行程的估计时间(以毫秒为单位):
  10. 最短 = 2ms,最长 = 9ms,平均 = 5ms
复制代码
可以看见已经能ping通开发板。说明开发板已经挂在无线网络上,并且项目提供了被ping通的功能。这在windows中被称呼为文件和打印机共享(回显请求 - ICMPv4-In)。windows中需要在防火墙中设置才能开启这个功能。这个项目应该没有防火墙吧。但是直接就提供了回显请求功能了。这个功能应该能使得外部设备能知道这个开发板是否在线。

*********************************************************************************************
至此,初步探索结束。应该下一步可以在此基础上开展工作了?
可惜理想很丰满,现实很骨感。
首先,功能实现之前,先实现对功能得触发。去看看项目得指令wifi_sta_connect是如何触发?
找到wifi_sta_connect函数定义:


  1. static void wifi_sta_connect(char *ssid, char *password)
  2. {
  3. wifi_interface_t wifi_interface;
  4. wifi_interface = wifi_mgmr_sta_enable();
  5. wifi_mgmr_sta_connect(wifi_interface, ssid, password, NULL, NULL, 0, 0);
  6. }
复制代码




以及函数引用


  1. case CODE_WIFI_ON_PROV_CONNECT:
  2. {
  3. printf("[APP] [EVT] [PROV] [CONNECT] %lldrn", aos_now_ms());
  4. printf("connecting to %s:%s...rn", ssid, password);
  5. wifi_sta_connect(ssid, password);
  6. }
复制代码

这个引用在函数static void event_cb_wifi_event(input_event_t *event, void *private_data)里。。。
这是什么鬼。命令行不是在以下数据结构里吗?


  1. const static struct cli_command cmds_user[] STATIC_CLI_CMD_ATTRIBUTE = {
  2. { "aws", "aws iot demo", cmd_aws},
  3. { "pka", "pka iot demo", cmd_pka},
  4. { "wifi", "wifi", cmd_wifi},
  5. { "sha", "sha iot demo", cmd_sha},
  6. { "trng", "trng test", cmd_trng},
  7. { "aes", "trng test", cmd_aes},
  8. { "cks", "cks test", cmd_cks},
  9. { "dma", "dma test", cmd_dma},
  10. { "exception_load", "exception load test", cmd_exception_load},
  11. { "exception_l_illegal", "exception load test", cmd_exception_l_illegal},
  12. { "exception_store", "exception store test", cmd_exception_store},
  13. { "exception_inst_illegal", "exception illegal instruction", cmd_exception_illegal_ins},
  14. /*Stack Command*/
  15. { "stack_wifi", "Wi-Fi Stack", cmd_stack_wifi},
  16. /*TCP/IP network test*/
  17. {"http", "http client download test based on socket", http_test_cmd},
  18. {"httpc", "http client download test based on RAW TCP", cmd_httpc_test},
  19. };
复制代码

然后,全文件查找cli


  1. fd_console = aos_open("/dev/ttyS0", 0);
  2. if (fd_console >= 0) {
  3. printf("Init CLI with event Drivenrn");
  4. aos_cli_init(0);
  5. aos_poll_read_fd(fd_console, aos_cli_event_cb_read_get(), (void*)0x12345678);
  6. _cli_init();
  7. }
复制代码

原来命令行有两种模式,一种是直接解码,一种是消息发送或者说事件方式。

以上函数中fd_console应该是默认的,烧录代码的串口吧?
看样子在实现自己的功能代码之前,还得有#include的相关知识。
特别提醒。这点一定注意。如果有相关知识会很顺利学习这个开发板。
*******************************************************************************************************
如果板子还在我手上的话,也许下一步借助这个板子,先开始一段FreeRTOS
的学习吧。
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
  • 跃昉科技
    +关注

    关注

    0

    文章

    87

    浏览量

    3376
  • 开发板试用
    +关注

    关注

    3

    文章

    303

    浏览量

    2805
收藏 人收藏
加入交流群
微信小助手二维码

扫码添加小助手

加入工程师交流群

    评论

    相关推荐
    热点推荐

    ·星光开发板使用基础和GPIO点灯

    小于100mA,超过最大值将损坏引脚。 本次课程,将会用到40Pin中的GPIO13(UART RX)、GPIO14(UART TX)、GPIO0、GPIO2、GPIO4、GND。 ·星光
    发表于 03-26 07:51

    ·星光开发板按键处理

    本次课程为·星光开发板IoT开发系列课程的第二讲,将带领同学们在·星光开发板上,通过GPIO进行按键处理。 一、
    发表于 03-26 06:31

    ·星光开发板方案:·星光开发板光敏传感器之光强度数据读取

    ·星光开发板光敏传感器使用2之光强度数据读取 本次课程为·星光开发板IoT开发系列课程的第
    发表于 03-18 06:19

    ·星光方案:·星光开发板心率传感器使用

    时透光率变化信号转换成电信号采集。该模块使用5V供电,3.3V也可,通讯使用II2C接口通讯。 、心率传感器使用 首先,参考下图,将心率传感器模块,连接到·星光开发板: 3.连
    发表于 03-18 06:03

    ·星光开发板火灾报警装置

    本次课程为·星光开发板IoT开发系列课程的第十一讲,将带领同学们在·星光开发板上,使用火焰传感器和蜂鸣器制作火灾报警装置。 本次课程,在
    发表于 03-16 07:19

    ·星光开发板火焰传感器探测火光

    本次课程为·星光开发板IoT开发系列课程的第九讲,将带领同学们在·星光开发板上,使用火焰传感器探测火焰火光。 本次课程,在
    发表于 03-16 06:48

    ·星光开发板巡线传感器使用

    本次课程为·星光开发板IoT开发系列课程的第十二讲,将带领同学们在·星光开发板上,使用巡线传感器。 本次课程,在
    发表于 03-13 08:09

    ·星光开发板上结合使用温度传感器控制风扇转速

    本次课程为·星光开发板IoT开发系列课程的第十三讲,将带领同学们在·星光开发板上,结合使用温度传感器控制风扇转速。 本次课程,在
    发表于 03-11 08:10

    科技与米立科技达成战略合作

    2025年12月9日,广东科技有限公司与福州米立科技股份有限公司正式签署战略合作协议,共同宣布在智慧社区与物联网领域展开深度合作。科技事业部总经理刘清波与米立科技副总经理李伟代
    的头像 发表于 12-16 11:15 610次阅读

    【获奖名单】2025开发板评测大赛优秀开发者、最受欢迎开发板公布

    HH-SCDAYU800A281852lustao 最受欢迎开发板:专题开发板名称 RISC-V专题赛 VisionFive 2 沁恒 CH585 玄铁 Banana Pi
    发表于 11-21 09:31

    【作品合集】赛科技VisionFive 2单板计算机开发板测评

    科技VisionFive 2单板计算机开发板测评作品合集 产品介绍: ·星光 2是全球首款集成了3D GPU的高性能量产RISC-V单
    发表于 09-04 09:08

    基于RK3576处理器,米尔RK3576开发板免费试用

    年7月19日   评测数量: 3块   更多热点文章阅读 基于平头哥TH1520芯片,润开鸿HH-SCDAYU800A开发板免费试用 RISC-V开发板深度评测!顶级开发板免费
    的头像 发表于 06-09 15:00 1446次阅读
    基于RK3576处理器,米尔RK3576<b class='flag-5'>开发板</b>免费<b class='flag-5'>试用</b>

    基于RK处理器,创龙TL3562-MiniEVM开发板试用体验

    数量: 10块   更多热点文章阅读 基于平头哥TH1520芯片,润开鸿HH-SCDAYU800A开发板免费试用 RISC-V开发板深度评测!顶级开发板免费
    的头像 发表于 06-05 16:31 1414次阅读
    基于RK处理器,创龙TL3562-MiniEVM<b class='flag-5'>开发板</b><b class='flag-5'>试用</b>体验

    性能强悍!合众HZ-RK3568开发板试用体验

    月19日   评测数量: 10块   更多热点文章阅读 基于平头哥TH1520芯片,润开鸿HH-SCDAYU800A开发板免费试用 RISC-V开发板深度评测!顶级开发板免费
    的头像 发表于 06-05 16:30 1826次阅读
    性能强悍!合众HZ-RK3568<b class='flag-5'>开发板</b><b class='flag-5'>试用</b>体验

    【评测试用】合众HZ-T536开发板免费试用体验

    【评测试用】合众HZ-T536开发板免费试用体验
    的头像 发表于 05-27 08:05 1337次阅读
    【评测<b class='flag-5'>试用</b>】合众HZ-T536<b class='flag-5'>开发板</b>免费<b class='flag-5'>试用</b>体验