Navigation

    Freqchip开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. kawhi
    K
    • Continue chat with kawhi
    • Start new chat with kawhi
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    kawhi

    @kawhi

    0
    Reputation
    3
    Posts
    687
    Profile views
    1
    Followers
    0
    Following
    Joined Last Online

    kawhi Follow

    Posts made by kawhi

    • Keil 5.23 安装包

      keil 5.23 安装包, 有需要的自己下吧,附链接【点我点我】

      posted in FR801x
      K
      kawhi
    • fr801x_sdk代码简析

      关于开发环境搭建,可以参照 官方维基百科: https://github.com/qdfreqchip/FR801x-SDK/wiki/fr801x_sdk_cn_user_guide。
      谈正题,直接进入proj_main.c ,有2个函数, user_proj_main_before_ble_ini()和user_proj_main()
      前者函数体主要设置蓝牙地址(通过函数名就可以联想到)
      user_proj_main()里主要做了7个回调函数, demo里着重完成了第一个和第二个, 后五个可根据需要自行添加。sp_cfg_dev_init_done_cb(),通过字面意思,设备初始化完成回调函数,主要是增加BLE service(service 简介参照官方wiki百科)。
      sp_gatt_add_service()主要是配置service table和gatt读写回调。 先看service table, 就是配置读写gatt characteristic,可以看出这里配置了一个service Index 和5个 读写characteristic,数据的传输就是通过这些characteristic, 一个characteristic 有三部分(Characteristic 1 Declaration ,Characteristic 1 Value , Characteristic 1 User Description), 实际数据是通过value部分传输的。再看读写回调sp_gatt_read_cb()和sp_gatt_write_cb()。 进入read 函数体,判断哪个characteristic, 用户把要传输的数据填进相应的value值,这里仅作演示, simple_profile_att_table[SP_IDX_CHAR1_VALUE].p_data[0] = 1; characteristic1 的value 填成1。 write 不做解释了, 有疑问请留言。
      到这里sp_cfg_dev_init_done_cb()才算结束。
      再来看sp_cfg_svc_init_done_cb(),service 初始化完成回调,进入函数体, gpio_button_config() 按键配置,开发板带有两个按键,所以是配置这两个按键的地方,这里为我们提供了一个借鉴, 怎样配置按键。再来两个函数是设置广播数据和扫描回复的, 可以看出设备名称叫simple pheripheral, 最后gap_start_advertising()开始广播。

      其他回调在demo里仅仅打印log, 需要用户自行完善自己的代码。
      通过以上解释, 用户就可以大致了解sdk使用, 就能根据需求开始自己的开发了。

      有疑问的可以给我留言, 看到会回复。

      posted in FR801x
      K
      kawhi
    • Error: Flash Download failed - "Cortex-M3"

      烧录提示 好多错误,
      Contents mismatch at: 20000064H (Flash=21H Required=2FH) !
      Contents mismatch at: 20000065H (Flash=1AH Required=2EH) !
      Contents mismatch at: 20000066H (Flash=2AH Required=00H) !
      Contents mismatch at: 20000067H (Flash=46H Required=20H) !
      Contents mismatch at: 20000068H (Flash=18H Required=31H) !
      Contents mismatch at: 20000069H (Flash=46H Required=2EH) !
      最后弹出一个提示框: Flash Download failed - "Cortex-M3",
      这是在程序下载完进行程序校验的时候出现的,当然把程序校验功能关了,就不会提示这个问题了:0_1557287205477_微信截图_20190508114529.png

      posted in FR801x
      K
      kawhi