imx6ull移植ap6236 wifi模块(三)

                       bluetooth模式     1、将固件写入模块:         在第一节中我们已经将bluetooth固件保存至/etc/firmware/bcm4343b0.hcd中,在向模块写入固件前,先通过模块的RST引脚...

                       bluetooth模式

    1、将固件写入模块:

        在第一节中我们已经将bluetooth固件保存至/etc/firmware/bcm4343b0.hcd中,在向模块写入固件前,先通过模块的RST引脚使模块复位:

            echo 15 > /sys/class/gpio/export

            echo out > /sys/class/gpio/gpio15/direction

            echo 0 > /sys/class/gpio/gpio15/value

            sleep 1

            echo 1 > /sys/class/gpio/gpio15/value

            sleep 1

        然后使用应用brcm_patchram_plus可以将固件写入模块:

            brcm_patchram_plus -d --enable_hci --no2bytes --tosleep 200000 --baudrate 3000000 --patchram /etc/firmware/bcm4343b0.hcd /dev/ttymxc1 &

attachments-2020-03-FGKi57rF5e833b8a8e261.png

        brcm_patchram_plus由附件brcm_patchram_plus.c通过交叉编译链编译得到。

    2、使用hciconfig判断是否已打开蓝牙:

attachments-2020-03-71zmwbYW5e833bfc8631b.png    3、使用hcitool扫描蓝牙设备:

attachments-2020-03-4aIvo5eg5e833cbdb4a53.png    4、测试蓝牙ble功能:

        通过/etc/bluetooth/main.conf修改蓝牙的名称等信息。

        cd /root && bluetoothd -n -d --compat --plugin=time --experimental &

        /usr/lib/bluez/test/example-gatt-server &

        hciconfig hci0 up

        hciconfig hci0 leadv

        手机下载一个叫nRF Connect的软件,然后根据蓝牙名字找到模块并进行连接,通过其中的服务,比如电池电量,来测试蓝牙的通信功能。

brcm_patchram_plus.c


  • 发表于 2020-03-31 21:15
  • 阅读 ( 1173 )
  • 分类:i.MX6ULL

0 条评论

请先 登录 后评论
ronnie
ronnie

11 篇文章

作家榜 »

  1. BBelephant 13 文章
  2. ronnie 11 文章
  3. FU 9 文章
  4. toca 4 文章
  5. 大飞 3 文章
  6. Vivek 3 文章
  7. jack-fang 2 文章
  8. Bin 1 文章