Hi Chris,

Thank you for clarifying things - that helps a lot! I will work on making a 
demo that works as you described. I'm thinking that at this early stage I can 
make a hardware change to our board to include the RTS and CTS signals and that 
would be better in the long run.

ALan

-----Original Message-----
From: Christopher Collins [mailto:[email protected]] 
Sent: Thursday, February 02, 2017 12:23 PM
To: [email protected]
Subject: Re: BLE HCI support on NRF52DK

Hi Alan,

On Thu, Feb 02, 2017 at 06:16:42PM +0000, Alan Graves wrote:
> Thanks for rechecking. I know I'm not setup with RTS/CTS handshaking on the 
> custom board so that is probably going to be a problem. When I get a chance 
> I'll repeat my tests with a complete serial signal set on the nRF52832 DK 
> board. 
> 
> BTW Do you know if Linux assumes hardware flow control by default and if it 
> is possible to override that configuration somewhere? I've been caught before 
> with hardware flow defaults on PPP over serial on Linux... 

Yes, the btattach program assumes flow control and baud rate of 1000000 (recent 
versions allow you specify baud on the command line).

Flow control can be disabled with a simple code change to
tools/btattach.c:

    *** btattach.c  2017-02-02 12:15:05.030918824 -0800
    --- /home/admin/tmp/btattach.c  2017-02-02 12:14:59.951029001 -0800
    ***************
    *** 76,85 ****
    --- 76,86 ----
            cfmakeraw(&ti);
      
            ti.c_cflag |= (speed | CLOCAL | CREAD);
      
            /* Set flow control */
    -       ti.c_cflag |= CRTSCTS;
    +       ti.c_cflag &= ~CRTSCTS;
      
            if (tcsetattr(fd, TCSANOW, &ti) < 0) {
                    perror("Failed to set serial port settings");
                    close(fd);

Then run make from the bluez source directory.  The new btattach binary will be 
named tools/btattach.

You also need to disable flow control in your Mynewt target:

    newt target set nina_hci 
syscfg=BLE_HCI_UART_FLOW_CTRL=HAL_UART_FLOW_CTL_NONE

And rebuild / reload the firmware onto your board.

Chris

Reply via email to