Using NRF52 (NRF52832) as bluetooth module for my psoc 6

Hi 

I have a mbed application, which runs on a PSOC6 MCU, i am going to be using a fanstel BC832 (which is based of NRF52832)BT module for RF-communication. To verify that my project can run on the fanstel module, I have the nRF52, until I get my board with the fanstel module. I am using mbed 5.14.1, which uses cordio stack for uart communication with the bt module. 

So i got two question: 
1) is there a specfic .hex which needs to be on my nRF52 when using it as a BT module? if, where can i find this? 
2) Might be out of scope, but how do i configure my mbed setup, so i am using the correct nordic drivers? 

Thanks 

Parents
  • Excluding the previous comment, I do have some information:

    1) is there a specfic .hex which needs to be on my nRF52 when using it as a BT module? if, where can i find this? 

    You need the nRF52 to run as a HCI device. This lets you use it to control BLE from other devices. HCI should be a standard thing. For example, if you configure it as a HCI device, I can connect it to my linux computer and it will be able to use it as a BLE device without me adding any nordic specific configurations (except maybe udev).

    To build the HCI code for your nRF52, I would recommend the nRF Connect SDK.

    Does this answer your question?

Reply
  • Excluding the previous comment, I do have some information:

    1) is there a specfic .hex which needs to be on my nRF52 when using it as a BT module? if, where can i find this? 

    You need the nRF52 to run as a HCI device. This lets you use it to control BLE from other devices. HCI should be a standard thing. For example, if you configure it as a HCI device, I can connect it to my linux computer and it will be able to use it as a BLE device without me adding any nordic specific configurations (except maybe udev).

    To build the HCI code for your nRF52, I would recommend the nRF Connect SDK.

    Does this answer your question?

Children
  • Hi  

    Yes, this is what I am looking for. I was hoping to use the example project in zephyr/samples/bluetooth/hci_uart. But I am very new to zephyr, so I am struggling. Could you help me if I am on the right track? 

    My plan is to (1) create a custom target for the BC832 (because the uart pins are on different pins than the NRF52DK/NRF52832. (2) Compile the HCI_UART project for BC832 board and flash my BC832. (3) From my firmware project running on the PSOC, access the BC832 via HCI. 

    Does this sound correct? 

  • Hi Karl-Johan, 

    Using hci-uart is the right direction if you do have BLE Host stack on the PSOC and if it supports HCI interface on UART. 
    If you don't have that on the PSOC, you may consider using BLE shell instead. 
    You can take a look here: Using Bluetooth Shell 

    The Bluetooth Shell module provide an interface that the peer device can sand UART command to do BLE tasks on the nRF52. It's useful when you want to have both the Host and the Controller stack on the nRF52 instead of the Host on the PSOC and the controller on the  nRF52. 

  • Hi   

    My psoc support HCI interface via UART, so this is the way i am going. 

    I got the hci_uart example running on the nrf52832 via the nrf52dk eval kit for a start, because when flashin the example onto BC832 directly the uart seems dead. 

    When talking through a serial port through the interface MCU on nrf52dk to nrf52832. I can send different commands and receive response, I also verified this on my scope. But from my understand should flow-control be enabled? when the board overlay file says: 

    /* SPDX-License-Identifier: Apache-2.0 */

    &uart0 {
    compatible = "nordic,nrf-uart";
    current-speed = <115200>;
    status = "okay";
    hw-flow-control;
    };

    Both CTS and RTS are constantly low, even when transmission is going on. I got the flow control turned on on the switch on the eval board. 

    I need flow control for my HCI HOST on the PSOC. 

    Thanks. 

  • Hi again @Hung_Bui

    I have am running nrf52832 with zephyr's HCI_UART sample, and has connected that to my PSOC. 

    I am able to read out the following command (from PSOC perspective) 
    TX: 0x01030C00 (A reset cmd, i assume) 
    RX: 0x040E0401030C00 (Correct response)

    There is a delay between the two above cmd, so i seems like something is taking time to reset...

    Next TX is: 0x0119FC060000C0C62D00
    RX: 0x040F04010118FX 

    And then it stops. Nothing happens hereafter. 
    Flow control is still not working. 

    Any hints? 

  • Hi Karl, 


    By having hw-flow-control; in the device tree the hw flow control should be selected, and it's by default the HCI UART (H4) should be. 
    Have you tried to manually pull the RTS or CTS pin up to see if the communication stop ? Could you try to test with some simple UART sample first ? 


    Could you try to use Zephyr host to test with the controller ? Meaning using 2 nRF52 to each other ? This way it will be easier for us to reproduce the issue. You can follow the guide here: https://docs.nordicsemi.com/bundle/ncs-2.4.0/page/zephyr/samples/bluetooth/hci_uart/README.html

Related