You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Oleg Persidskiy <pe...@gmail.com> on 2016/11/23 12:07:11 UTC

HW configuration of Nimble (HCI)

good time dear Engineers!

Have a question about your newt Nimble (HCI) subproject.
(sorry I'm a newbie with newt ~ 1 day)

During the test (I use nRF52 own board) faced with a problem , where I can
reconfigure
PORT IO pins, SPEED & etc. parameters ?

nRF5x SoC has very flexible PIO configuration ability but I cannot set my
board paratemetrs to Nimble HCI driver (it default uses nRF52DK based board
configuration).

Summary I need to
1. decrease the HCI_UART speed to 19200 (long line capacity issue)
2. remap IO pins Numbers: RX/TX/CTS/RTS according to my board.
3. change Protocol 8 bit to 9 bit (w parity)


Thanks you a lot!

Oleg.

Re: HW configuration of Nimble (HCI)

Posted by Christopher Collins <cc...@apache.org>.
Hi Oleg,

On Wed, Nov 23, 2016 at 03:07:11PM +0300, Oleg Persidskiy wrote:
> good time dear Engineers!
> 
> Have a question about your newt Nimble (HCI) subproject.
> (sorry I'm a newbie with newt ~ 1 day)

Great!

> During the test (I use nRF52 own board) faced with a problem , where I can
> reconfigure
> PORT IO pins, SPEED & etc. parameters ?
> 
> nRF5x SoC has very flexible PIO configuration ability but I cannot set my
> board paratemetrs to Nimble HCI driver (it default uses nRF52DK based board
> configuration).
> 
> Summary I need to
> 1. decrease the HCI_UART speed to 19200 (long line capacity issue)
> 2. remap IO pins Numbers: RX/TX/CTS/RTS according to my board.
> 3. change Protocol 8 bit to 9 bit (w parity)

This is one area of Mynewt that could definitely use some better
documentation.  To adjust these settings, you need to use the syscfg
mechanism.  In short, each package defines system-wide settings via
something called syscfg.  Your project can then override the default
values of these settings in various packages, usually the app or target.
For simplicity, I would recommend overriding these settings at the
target level for now.

Here is how you would override these settings.  Note: For the following,
I am assuming you are using the nRF52dk BSP.  If you are not, the
following will still probably work, but you may want to adjust the
comments accordingly.

* Create a file called "syscfg.yml" in your target directory
  (targets/<target-name>/syscfg.yml)

* Add the following contents to this file:

    syscfg.vals:
        # @apache-mynewt-core/hw/bsp/nrf52dk
        UART_0_PIN_TX:          <pin-num-1>
        UART_0_PIN_RX:          <pin-num-2>
        UART_0_PIN_RTS:         <pin-num-3>
        UART_0_PIN_CTS:         <pin-num-4>

        # @apache-mynewt-core/net/nimble/transport/uart
        BLE_HCI_UART_BAUD:      19200
        BLE_HCI_UART_DATA_BITS: 9
        BLE_HCI_UART_STOP_BITS: (*)
        BLE_HCI_UART_PARITY:    (**)

Replace pin-num values as appropriate.

I wasn't sure which values are appropriate for stop bits or parity.
Valid parity values are:
    HAL_UART_PARITY_NONE,
    HAL_UART_PARITY_ODD,
    HAL_UART_PARITY_EVEN,

This file will reconfigure your project as specified.  You can see a
list of all the settings in your project with the "newt target config
<target-name>" command.  The settings are organized by their defining
package.  As indicated by the comments above, the settings in this case
come from the nrf52dk BSP package and the nimble UART transport package.

> 
> 
> Thanks you a lot!
> 
> Oleg.