You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Jeff Belz <jb...@vectorform.com> on 2018/06/26 02:11:46 UTC

bleprph using HCI 4 wire

All:


I'm using a BroadCom(Cypress)43438 Bluetooth chip that receives a 4 wire HCI.  I got one response that said I just have to change the  syscfg setting in my target to



    BLE_HCI_TRANSPORT_NIMBLE_BUILTIN: 0

    BLE_HCI_TRANSPORT_UART: 1



  1.  I can't find any documentation to what these lines do?
  2.  How can I make sure it's configuring the right UART?
  3.  Do I change the target syscfg or the one in the app folder?
  4.  Do I really need the bootloader? If so, is there documentation to why, I will eventually need to modify this.



Also  do I need all the dependencies in the pkg.yml.  I would think I do not need the controller, since that is the Broadcom.



pkg.deps:

    - boot/split

    - boot/bootutil

    - kernel/os

    - mgmt/imgmgr

    - mgmt/newtmgr

    - mgmt/newtmgr/transport/ble

     -net/nimble/controller

    - net/nimble/host

    - net/nimble/host/services/ans

    - net/nimble/host/services/gap

    - net/nimble/host/services/gatt

    - net/nimble/host/store/config

    - net/nimble/transport/ram

    - sys/console/full

    - sys/log/full

    - sys/stats/full

    - sys/sysinit

    - sys/id

Re: bleprph using HCI 4 wire

Posted by Christopher Collins <ch...@runtime.io>.
Hi Jeff,

On Tue, Jun 26, 2018 at 05:18:40PM +0000, Jeff Belz wrote:
> I think the naming convention is changed on the 1.4.1 relaese.   What is the URL for 1.4.1 
> 
> Here it is for 1.3.
> wget -P /tmp https://raw.githubusercontent.com/runtimeco/binary-releases/master/mynewt-newt-tools_1.3.0/newt_1_3_0_windows_amd64.tar.gz
> 
> But, changing the number did not work, it can't find it
> wget -P /tmp https://raw.githubusercontent.com/runtimeco/binary-releases/master/mynewt-newt-tools_1.4.1/newt_1_4_1_windows_amd64.tar.gz

I will explain why below, but I'm afraid you only have these two
options:

1. Wait for the official release of 1.4.1, when the Windows binaries
will be made available (hopefully in a few days).

2. Build 1.4.1 yourself from source.

1.4.0, which was released about a week ago, has Windows-related issues.
This is part of the reason for the 1.4.1 bugfix relase.  This is also
the reason there is no 1.4.0 Windows binary on github.

Building the newt tool is not that complicated.  You would need to set
up a Golang environment on your machine, and then run

    go get mynewt.apache.org/newt/newt

Chris

> 
> Jeff
> 
> -----Original Message-----
> From: Christopher Collins <ch...@runtime.io> 
> Sent: Monday, June 25, 2018 11:25 PM
> To: dev@mynewt.apache.org
> Subject: Re: bleprph using HCI 4 wire
> 
> Hi Jeff,
> 
> My responses are inline.
> 
> On Tue, Jun 26, 2018 at 02:11:46AM +0000, Jeff Belz wrote:
> > All:
> > 
> > 
> > I'm using a BroadCom(Cypress)43438 Bluetooth chip that receives a 4 
> > wire HCI.  I got one response that said I just have to change the  
> > syscfg setting in my target to
> > 
> > 
> > 
> >     BLE_HCI_TRANSPORT_NIMBLE_BUILTIN: 0
> >     BLE_HCI_TRANSPORT_UART: 1
> > 
> >   1.  I can't find any documentation to what these lines do?
> 
> The documentation for syscfg settings is in the packages themselves.
> Both of the above settings are defined by the @apache-mynewt-nimble/nimble/transport package.  You can see the full list of settings in a project, along with their descriptions, with this
> command:
> 
>     newt target config show <target-name>
> 
> However, I don't think you will see either of these settings if you execute this command.  From the dependency list you quoted, it looks like you are using an older version of Mynewt which does not support these two settings.  I believe you are using Mynewt 1.3.0; you will want to upgrade to 1.4.0, released about one week ago.  There was a long delay between the releases of 1.3.0 and 1.4.0, and I mistakenly forgot that 1.4.0 was not yet released when I wrote my original email.
> 
> The latest version introduces some fairly major changes, so I suggest you upgrade as follows:
> 
> 1. Download Newt 1.4.0 as described here:
> http://mynewt.apache.org/develop/get_started/native_install/index.html
> 
> 2. Upgrade the Mynewt repos to 1.4.0 by running:
> 
>     newt upgrade
> 
> inside your project directory.
> 
> >   2.  How can I make sure it's configuring the right UART?
> 
> There is a syscfg setting defined by
> @apache-mynewt-nimble/nimble/transport/uart called `BLE_HCI_UART_PORT`.
> By default, this is defined to be 0.  You can change its value if you need to use a different UART.
> 
> >   3.  Do I change the target syscfg or the one in the app folder?
> 
> I recommend changing the target's syscfg.  The target configuration overrides the app configuration, and it is best not to change a foreign repo except when necessary.  The syscfg system is described in more detail here:
> http://mynewt.apache.org/develop/os/modules/sysinitconfig/sysinitconfig.html
> 
> >   4.  Do I really need the bootloader? If so, is there documentation to why, I will eventually need to modify this.
> 
> The boot loader is not strictly required, but much of the Mynewt infrastructure assumes it is present.  When you are getting Mynewt up and running for the first time, I recommend you use the boot loader so that you can follow the documentation more closely.
> 
> Chris

RE: bleprph using HCI 4 wire

Posted by Jeff Belz <jb...@vectorform.com>.
I think the naming convention is changed on the 1.4.1 relaese.   What is the URL for 1.4.1 

Here it is for 1.3.
wget -P /tmp https://raw.githubusercontent.com/runtimeco/binary-releases/master/mynewt-newt-tools_1.3.0/newt_1_3_0_windows_amd64.tar.gz

But, changing the number did not work, it can't find it
wget -P /tmp https://raw.githubusercontent.com/runtimeco/binary-releases/master/mynewt-newt-tools_1.4.1/newt_1_4_1_windows_amd64.tar.gz

Jeff

-----Original Message-----
From: Christopher Collins <ch...@runtime.io> 
Sent: Monday, June 25, 2018 11:25 PM
To: dev@mynewt.apache.org
Subject: Re: bleprph using HCI 4 wire

Hi Jeff,

My responses are inline.

On Tue, Jun 26, 2018 at 02:11:46AM +0000, Jeff Belz wrote:
> All:
> 
> 
> I'm using a BroadCom(Cypress)43438 Bluetooth chip that receives a 4 
> wire HCI.  I got one response that said I just have to change the  
> syscfg setting in my target to
> 
> 
> 
>     BLE_HCI_TRANSPORT_NIMBLE_BUILTIN: 0
>     BLE_HCI_TRANSPORT_UART: 1
> 
>   1.  I can't find any documentation to what these lines do?

The documentation for syscfg settings is in the packages themselves.
Both of the above settings are defined by the @apache-mynewt-nimble/nimble/transport package.  You can see the full list of settings in a project, along with their descriptions, with this
command:

    newt target config show <target-name>

However, I don't think you will see either of these settings if you execute this command.  From the dependency list you quoted, it looks like you are using an older version of Mynewt which does not support these two settings.  I believe you are using Mynewt 1.3.0; you will want to upgrade to 1.4.0, released about one week ago.  There was a long delay between the releases of 1.3.0 and 1.4.0, and I mistakenly forgot that 1.4.0 was not yet released when I wrote my original email.

The latest version introduces some fairly major changes, so I suggest you upgrade as follows:

1. Download Newt 1.4.0 as described here:
http://mynewt.apache.org/develop/get_started/native_install/index.html

2. Upgrade the Mynewt repos to 1.4.0 by running:

    newt upgrade

inside your project directory.

>   2.  How can I make sure it's configuring the right UART?

There is a syscfg setting defined by
@apache-mynewt-nimble/nimble/transport/uart called `BLE_HCI_UART_PORT`.
By default, this is defined to be 0.  You can change its value if you need to use a different UART.

>   3.  Do I change the target syscfg or the one in the app folder?

I recommend changing the target's syscfg.  The target configuration overrides the app configuration, and it is best not to change a foreign repo except when necessary.  The syscfg system is described in more detail here:
http://mynewt.apache.org/develop/os/modules/sysinitconfig/sysinitconfig.html

>   4.  Do I really need the bootloader? If so, is there documentation to why, I will eventually need to modify this.

The boot loader is not strictly required, but much of the Mynewt infrastructure assumes it is present.  When you are getting Mynewt up and running for the first time, I recommend you use the boot loader so that you can follow the documentation more closely.

Chris

Re: bleprph using HCI 4 wire

Posted by Christopher Collins <ch...@runtime.io>.
Hi Jeff,

The `ble_hci_ram_rx_cmd_ll_cb` callback should be getting configured by
the controller at startup (assuming you are running the
combined-host-controller).

I have a few questions:
1. What version of Mynewt are you using?
2. What changes have you made to the apps that are failing?

Also, could you please post your bleprph target?  You can display it
with:

    newt target show <target-name>

Thanks,
Chris

On Wed, Jun 27, 2018 at 08:03:06PM +0000, Jeff Belz wrote:
> Nimble error?
> I have tried the bleprph and bleuart  and both fail at this point in the ble_hci_ram.c
> 
> assert(ble_hci_ram_rx_cmd_ll_cb != NULL);   
> 
> Either I'm missing a setting or maybe an error in Nimble
> 
> /////////////////////This is the whole trace////////////////////////////////
> #12 0x08020b30 in os_eventq_run (evq=<optimized out>) at repos/apache-mynewt-core/kernel/os/src/os_eventq.c:162
> 162         ev->ev_cb(ev);
> (gdb)
> #11 0x08025c12 in ble_hs_event_start (ev=<optimized out>) at repos/apache-mynewt-nimble/nimble/host/src/ble_hs.c:498
> 498         rc = ble_hs_start();
> (gdb)
> #10 0x08025bf6 in ble_hs_start () at repos/apache-mynewt-nimble/nimble/host/src/ble_hs.c:563
> 563         ble_hs_sync();
> (gdb)
> #9  0x08025966 in ble_hs_sync () at repos/apache-mynewt-nimble/nimble/host/src/ble_hs.c:325
> 325         rc = ble_hs_startup_go();
> (gdb)
> #8  0x0802800e in ble_hs_startup_go () at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_startup.c:341
> 341         rc = ble_hs_startup_reset_tx();
> (gdb)
> #7  0x08027d52 in ble_hs_startup_reset_tx () at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_startup.c:326
> 326         rc = ble_hs_hci_cmd_tx_empty_ack(BLE_HCI_OP(BLE_HCI_OGF_CTLR_BASEBAND,
> (gdb)
> #6  0x0802696a in ble_hs_hci_cmd_tx_empty_ack (opcode=opcode@entry=3075, cmd=cmd@entry=0x0,
>     cmd_len=cmd_len@entry=0 '\000') at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci.c:332
> 332         rc = ble_hs_hci_cmd_tx(opcode, cmd, cmd_len, NULL, 0, NULL);
> (gdb)
> #5  0x08026906 in ble_hs_hci_cmd_tx (opcode=<optimized out>, cmd=cmd@entry=0x0, cmd_len=<optimized out>,
>     evt_buf=evt_buf@entry=0x0, evt_buf_len=evt_buf_len@entry=0 '\000', out_evt_buf_len=out_evt_buf_len@entry=0x0)
>     at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci.c:294
> 294         rc = ble_hs_hci_cmd_send_buf(opcode, cmd, cmd_len);
> (gdb)
> #4  0x08026efc in ble_hs_hci_cmd_send_buf (opcode=opcode@entry=3075, buf=buf@entry=0x0,
>     buf_len=buf_len@entry=0 '\000') at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci_cmd.c:122
> 122         return ble_hs_hci_cmd_send(opcode, buf_len, buf);
> (gdb)
> #3  0x08026d0e in ble_hs_hci_cmd_send (opcode=opcode@entry=3075, len=len@entry=0 '\000', cmddata=cmddata@entry=0x0)
>     at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci_cmd.c:90
> 90          rc = ble_hs_hci_cmd_transport(buf);
> (gdb)
> #2  0x08026c9e in ble_hs_hci_cmd_transport (cmdbuf=cmdbuf@entry=0x0)
>     at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci_cmd.c:42
> 42          rc = ble_hci_trans_hs_cmd_tx(cmdbuf);
> (gdb)
> #1  0x0802e834 in ble_hci_trans_hs_cmd_tx (cmd=cmd@entry=0x0)
>     at repos/apache-mynewt-nimble/nimble/transport/ram/src/ble_hci_ram.c:89
> 89          assert(ble_hci_ram_rx_cmd_ll_cb != NULL);
> (gdb)
> #0  __assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0)
>     at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:137
> 137            asm("bkpt");
> 
> -----Original Message-----
> From: Christopher Collins <ch...@runtime.io> 
> Sent: Monday, June 25, 2018 11:25 PM
> To: dev@mynewt.apache.org
> Subject: Re: bleprph using HCI 4 wire
> 
> Hi Jeff,
> 
> My responses are inline.
> 
> On Tue, Jun 26, 2018 at 02:11:46AM +0000, Jeff Belz wrote:
> > All:
> > 
> > 
> > I'm using a BroadCom(Cypress)43438 Bluetooth chip that receives a 4 
> > wire HCI.  I got one response that said I just have to change the  
> > syscfg setting in my target to
> > 
> > 
> > 
> >     BLE_HCI_TRANSPORT_NIMBLE_BUILTIN: 0
> >     BLE_HCI_TRANSPORT_UART: 1
> > 
> >   1.  I can't find any documentation to what these lines do?
> 
> The documentation for syscfg settings is in the packages themselves.
> Both of the above settings are defined by the @apache-mynewt-nimble/nimble/transport package.  You can see the full list of settings in a project, along with their descriptions, with this
> command:
> 
>     newt target config show <target-name>
> 
> However, I don't think you will see either of these settings if you execute this command.  From the dependency list you quoted, it looks like you are using an older version of Mynewt which does not support these two settings.  I believe you are using Mynewt 1.3.0; you will want to upgrade to 1.4.0, released about one week ago.  There was a long delay between the releases of 1.3.0 and 1.4.0, and I mistakenly forgot that 1.4.0 was not yet released when I wrote my original email.
> 
> The latest version introduces some fairly major changes, so I suggest you upgrade as follows:
> 
> 1. Download Newt 1.4.0 as described here:
> http://mynewt.apache.org/develop/get_started/native_install/index.html
> 
> 2. Upgrade the Mynewt repos to 1.4.0 by running:
> 
>     newt upgrade
> 
> inside your project directory.
> 
> >   2.  How can I make sure it's configuring the right UART?
> 
> There is a syscfg setting defined by
> @apache-mynewt-nimble/nimble/transport/uart called `BLE_HCI_UART_PORT`.
> By default, this is defined to be 0.  You can change its value if you need to use a different UART.
> 
> >   3.  Do I change the target syscfg or the one in the app folder?
> 
> I recommend changing the target's syscfg.  The target configuration overrides the app configuration, and it is best not to change a foreign repo except when necessary.  The syscfg system is described in more detail here:
> http://mynewt.apache.org/develop/os/modules/sysinitconfig/sysinitconfig.html
> 
> >   4.  Do I really need the bootloader? If so, is there documentation to why, I will eventually need to modify this.
> 
> The boot loader is not strictly required, but much of the Mynewt infrastructure assumes it is present.  When you are getting Mynewt up and running for the first time, I recommend you use the boot loader so that you can follow the documentation more closely.
> 
> Chris

Re: bleprph using HCI 4 wire

Posted by Andrzej Kaczmarek <an...@codecoup.pl>.
Hi Jeff,

It seems you have explicit dependency to net/nimble/transport/ram
somewhere in your configuration (target, I suppose) which you need to
remove. bleprph app already includes net/nimble/transport package
which pulls proper HCI transport package depending on
BLE_HCI_TRANSPORT_* syscfg values and with settings you mentioned in
1st post it will automatically pull net/nimble/transport/uart.

bleuart is not updated to use meta-package for HCI transport so in
order to use it with different HCI transport you will need to manually
remove both net/nimble/controller and net/nimble/transport/ram
packages from its pkg.yml. Also there seem to be some includes from
both of these packages in main.c which are probably not needed and
should be removed as otherwise it won't build.

Best,
Andrzej


On Wed, Jun 27, 2018 at 10:03 PM Jeff Belz <jb...@vectorform.com> wrote:
>
> Nimble error?
> I have tried the bleprph and bleuart  and both fail at this point in the ble_hci_ram.c
>
> assert(ble_hci_ram_rx_cmd_ll_cb != NULL);
>
> Either I'm missing a setting or maybe an error in Nimble
>
> /////////////////////This is the whole trace////////////////////////////////
> #12 0x08020b30 in os_eventq_run (evq=<optimized out>) at repos/apache-mynewt-core/kernel/os/src/os_eventq.c:162
> 162         ev->ev_cb(ev);
> (gdb)
> #11 0x08025c12 in ble_hs_event_start (ev=<optimized out>) at repos/apache-mynewt-nimble/nimble/host/src/ble_hs.c:498
> 498         rc = ble_hs_start();
> (gdb)
> #10 0x08025bf6 in ble_hs_start () at repos/apache-mynewt-nimble/nimble/host/src/ble_hs.c:563
> 563         ble_hs_sync();
> (gdb)
> #9  0x08025966 in ble_hs_sync () at repos/apache-mynewt-nimble/nimble/host/src/ble_hs.c:325
> 325         rc = ble_hs_startup_go();
> (gdb)
> #8  0x0802800e in ble_hs_startup_go () at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_startup.c:341
> 341         rc = ble_hs_startup_reset_tx();
> (gdb)
> #7  0x08027d52 in ble_hs_startup_reset_tx () at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_startup.c:326
> 326         rc = ble_hs_hci_cmd_tx_empty_ack(BLE_HCI_OP(BLE_HCI_OGF_CTLR_BASEBAND,
> (gdb)
> #6  0x0802696a in ble_hs_hci_cmd_tx_empty_ack (opcode=opcode@entry=3075, cmd=cmd@entry=0x0,
>     cmd_len=cmd_len@entry=0 '\000') at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci.c:332
> 332         rc = ble_hs_hci_cmd_tx(opcode, cmd, cmd_len, NULL, 0, NULL);
> (gdb)
> #5  0x08026906 in ble_hs_hci_cmd_tx (opcode=<optimized out>, cmd=cmd@entry=0x0, cmd_len=<optimized out>,
>     evt_buf=evt_buf@entry=0x0, evt_buf_len=evt_buf_len@entry=0 '\000', out_evt_buf_len=out_evt_buf_len@entry=0x0)
>     at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci.c:294
> 294         rc = ble_hs_hci_cmd_send_buf(opcode, cmd, cmd_len);
> (gdb)
> #4  0x08026efc in ble_hs_hci_cmd_send_buf (opcode=opcode@entry=3075, buf=buf@entry=0x0,
>     buf_len=buf_len@entry=0 '\000') at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci_cmd.c:122
> 122         return ble_hs_hci_cmd_send(opcode, buf_len, buf);
> (gdb)
> #3  0x08026d0e in ble_hs_hci_cmd_send (opcode=opcode@entry=3075, len=len@entry=0 '\000', cmddata=cmddata@entry=0x0)
>     at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci_cmd.c:90
> 90          rc = ble_hs_hci_cmd_transport(buf);
> (gdb)
> #2  0x08026c9e in ble_hs_hci_cmd_transport (cmdbuf=cmdbuf@entry=0x0)
>     at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci_cmd.c:42
> 42          rc = ble_hci_trans_hs_cmd_tx(cmdbuf);
> (gdb)
> #1  0x0802e834 in ble_hci_trans_hs_cmd_tx (cmd=cmd@entry=0x0)
>     at repos/apache-mynewt-nimble/nimble/transport/ram/src/ble_hci_ram.c:89
> 89          assert(ble_hci_ram_rx_cmd_ll_cb != NULL);
> (gdb)
> #0  __assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0)
>     at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:137
> 137            asm("bkpt");
>
> -----Original Message-----
> From: Christopher Collins <ch...@runtime.io>
> Sent: Monday, June 25, 2018 11:25 PM
> To: dev@mynewt.apache.org
> Subject: Re: bleprph using HCI 4 wire
>
> Hi Jeff,
>
> My responses are inline.
>
> On Tue, Jun 26, 2018 at 02:11:46AM +0000, Jeff Belz wrote:
> > All:
> >
> >
> > I'm using a BroadCom(Cypress)43438 Bluetooth chip that receives a 4
> > wire HCI.  I got one response that said I just have to change the
> > syscfg setting in my target to
> >
> >
> >
> >     BLE_HCI_TRANSPORT_NIMBLE_BUILTIN: 0
> >     BLE_HCI_TRANSPORT_UART: 1
> >
> >   1.  I can't find any documentation to what these lines do?
>
> The documentation for syscfg settings is in the packages themselves.
> Both of the above settings are defined by the @apache-mynewt-nimble/nimble/transport package.  You can see the full list of settings in a project, along with their descriptions, with this
> command:
>
>     newt target config show <target-name>
>
> However, I don't think you will see either of these settings if you execute this command.  From the dependency list you quoted, it looks like you are using an older version of Mynewt which does not support these two settings.  I believe you are using Mynewt 1.3.0; you will want to upgrade to 1.4.0, released about one week ago.  There was a long delay between the releases of 1.3.0 and 1.4.0, and I mistakenly forgot that 1.4.0 was not yet released when I wrote my original email.
>
> The latest version introduces some fairly major changes, so I suggest you upgrade as follows:
>
> 1. Download Newt 1.4.0 as described here:
> http://mynewt.apache.org/develop/get_started/native_install/index.html
>
> 2. Upgrade the Mynewt repos to 1.4.0 by running:
>
>     newt upgrade
>
> inside your project directory.
>
> >   2.  How can I make sure it's configuring the right UART?
>
> There is a syscfg setting defined by
> @apache-mynewt-nimble/nimble/transport/uart called `BLE_HCI_UART_PORT`.
> By default, this is defined to be 0.  You can change its value if you need to use a different UART.
>
> >   3.  Do I change the target syscfg or the one in the app folder?
>
> I recommend changing the target's syscfg.  The target configuration overrides the app configuration, and it is best not to change a foreign repo except when necessary.  The syscfg system is described in more detail here:
> http://mynewt.apache.org/develop/os/modules/sysinitconfig/sysinitconfig.html
>
> >   4.  Do I really need the bootloader? If so, is there documentation to why, I will eventually need to modify this.
>
> The boot loader is not strictly required, but much of the Mynewt infrastructure assumes it is present.  When you are getting Mynewt up and running for the first time, I recommend you use the boot loader so that you can follow the documentation more closely.
>
> Chris

RE: bleprph using HCI 4 wire

Posted by Jeff Belz <jb...@vectorform.com>.
Nimble error?
I have tried the bleprph and bleuart  and both fail at this point in the ble_hci_ram.c

assert(ble_hci_ram_rx_cmd_ll_cb != NULL);   

Either I'm missing a setting or maybe an error in Nimble

/////////////////////This is the whole trace////////////////////////////////
#12 0x08020b30 in os_eventq_run (evq=<optimized out>) at repos/apache-mynewt-core/kernel/os/src/os_eventq.c:162
162         ev->ev_cb(ev);
(gdb)
#11 0x08025c12 in ble_hs_event_start (ev=<optimized out>) at repos/apache-mynewt-nimble/nimble/host/src/ble_hs.c:498
498         rc = ble_hs_start();
(gdb)
#10 0x08025bf6 in ble_hs_start () at repos/apache-mynewt-nimble/nimble/host/src/ble_hs.c:563
563         ble_hs_sync();
(gdb)
#9  0x08025966 in ble_hs_sync () at repos/apache-mynewt-nimble/nimble/host/src/ble_hs.c:325
325         rc = ble_hs_startup_go();
(gdb)
#8  0x0802800e in ble_hs_startup_go () at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_startup.c:341
341         rc = ble_hs_startup_reset_tx();
(gdb)
#7  0x08027d52 in ble_hs_startup_reset_tx () at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_startup.c:326
326         rc = ble_hs_hci_cmd_tx_empty_ack(BLE_HCI_OP(BLE_HCI_OGF_CTLR_BASEBAND,
(gdb)
#6  0x0802696a in ble_hs_hci_cmd_tx_empty_ack (opcode=opcode@entry=3075, cmd=cmd@entry=0x0,
    cmd_len=cmd_len@entry=0 '\000') at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci.c:332
332         rc = ble_hs_hci_cmd_tx(opcode, cmd, cmd_len, NULL, 0, NULL);
(gdb)
#5  0x08026906 in ble_hs_hci_cmd_tx (opcode=<optimized out>, cmd=cmd@entry=0x0, cmd_len=<optimized out>,
    evt_buf=evt_buf@entry=0x0, evt_buf_len=evt_buf_len@entry=0 '\000', out_evt_buf_len=out_evt_buf_len@entry=0x0)
    at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci.c:294
294         rc = ble_hs_hci_cmd_send_buf(opcode, cmd, cmd_len);
(gdb)
#4  0x08026efc in ble_hs_hci_cmd_send_buf (opcode=opcode@entry=3075, buf=buf@entry=0x0,
    buf_len=buf_len@entry=0 '\000') at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci_cmd.c:122
122         return ble_hs_hci_cmd_send(opcode, buf_len, buf);
(gdb)
#3  0x08026d0e in ble_hs_hci_cmd_send (opcode=opcode@entry=3075, len=len@entry=0 '\000', cmddata=cmddata@entry=0x0)
    at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci_cmd.c:90
90          rc = ble_hs_hci_cmd_transport(buf);
(gdb)
#2  0x08026c9e in ble_hs_hci_cmd_transport (cmdbuf=cmdbuf@entry=0x0)
    at repos/apache-mynewt-nimble/nimble/host/src/ble_hs_hci_cmd.c:42
42          rc = ble_hci_trans_hs_cmd_tx(cmdbuf);
(gdb)
#1  0x0802e834 in ble_hci_trans_hs_cmd_tx (cmd=cmd@entry=0x0)
    at repos/apache-mynewt-nimble/nimble/transport/ram/src/ble_hci_ram.c:89
89          assert(ble_hci_ram_rx_cmd_ll_cb != NULL);
(gdb)
#0  __assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0)
    at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:137
137            asm("bkpt");

-----Original Message-----
From: Christopher Collins <ch...@runtime.io> 
Sent: Monday, June 25, 2018 11:25 PM
To: dev@mynewt.apache.org
Subject: Re: bleprph using HCI 4 wire

Hi Jeff,

My responses are inline.

On Tue, Jun 26, 2018 at 02:11:46AM +0000, Jeff Belz wrote:
> All:
> 
> 
> I'm using a BroadCom(Cypress)43438 Bluetooth chip that receives a 4 
> wire HCI.  I got one response that said I just have to change the  
> syscfg setting in my target to
> 
> 
> 
>     BLE_HCI_TRANSPORT_NIMBLE_BUILTIN: 0
>     BLE_HCI_TRANSPORT_UART: 1
> 
>   1.  I can't find any documentation to what these lines do?

The documentation for syscfg settings is in the packages themselves.
Both of the above settings are defined by the @apache-mynewt-nimble/nimble/transport package.  You can see the full list of settings in a project, along with their descriptions, with this
command:

    newt target config show <target-name>

However, I don't think you will see either of these settings if you execute this command.  From the dependency list you quoted, it looks like you are using an older version of Mynewt which does not support these two settings.  I believe you are using Mynewt 1.3.0; you will want to upgrade to 1.4.0, released about one week ago.  There was a long delay between the releases of 1.3.0 and 1.4.0, and I mistakenly forgot that 1.4.0 was not yet released when I wrote my original email.

The latest version introduces some fairly major changes, so I suggest you upgrade as follows:

1. Download Newt 1.4.0 as described here:
http://mynewt.apache.org/develop/get_started/native_install/index.html

2. Upgrade the Mynewt repos to 1.4.0 by running:

    newt upgrade

inside your project directory.

>   2.  How can I make sure it's configuring the right UART?

There is a syscfg setting defined by
@apache-mynewt-nimble/nimble/transport/uart called `BLE_HCI_UART_PORT`.
By default, this is defined to be 0.  You can change its value if you need to use a different UART.

>   3.  Do I change the target syscfg or the one in the app folder?

I recommend changing the target's syscfg.  The target configuration overrides the app configuration, and it is best not to change a foreign repo except when necessary.  The syscfg system is described in more detail here:
http://mynewt.apache.org/develop/os/modules/sysinitconfig/sysinitconfig.html

>   4.  Do I really need the bootloader? If so, is there documentation to why, I will eventually need to modify this.

The boot loader is not strictly required, but much of the Mynewt infrastructure assumes it is present.  When you are getting Mynewt up and running for the first time, I recommend you use the boot loader so that you can follow the documentation more closely.

Chris

RE: bleprph using HCI 4 wire

Posted by Jeff Belz <jb...@vectorform.com>.
Also  I keep getting these errors when I try to debug, any ideas


Program received signal SIGTRAP, Trace/breakpoint trap.
__assert_func (file=0x0, line=0, func=<optimized out>, e=<optimized out>)
    at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:137
137            asm("bkpt");
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
hal_system_reset () at repos/apache-mynewt-core/hw/mcu/stm/stm32_common/src/hal_system.c:32
32                  asm("bkpt");
(gdb)



-----Original Message-----
From: Christopher Collins <ch...@runtime.io> 
Sent: Monday, June 25, 2018 11:25 PM
To: dev@mynewt.apache.org
Subject: Re: bleprph using HCI 4 wire

Hi Jeff,

My responses are inline.

On Tue, Jun 26, 2018 at 02:11:46AM +0000, Jeff Belz wrote:
> All:
> 
> 
> I'm using a BroadCom(Cypress)43438 Bluetooth chip that receives a 4 
> wire HCI.  I got one response that said I just have to change the  
> syscfg setting in my target to
> 
> 
> 
>     BLE_HCI_TRANSPORT_NIMBLE_BUILTIN: 0
>     BLE_HCI_TRANSPORT_UART: 1
> 
>   1.  I can't find any documentation to what these lines do?

The documentation for syscfg settings is in the packages themselves.
Both of the above settings are defined by the @apache-mynewt-nimble/nimble/transport package.  You can see the full list of settings in a project, along with their descriptions, with this
command:

    newt target config show <target-name>

However, I don't think you will see either of these settings if you execute this command.  From the dependency list you quoted, it looks like you are using an older version of Mynewt which does not support these two settings.  I believe you are using Mynewt 1.3.0; you will want to upgrade to 1.4.0, released about one week ago.  There was a long delay between the releases of 1.3.0 and 1.4.0, and I mistakenly forgot that 1.4.0 was not yet released when I wrote my original email.

The latest version introduces some fairly major changes, so I suggest you upgrade as follows:

1. Download Newt 1.4.0 as described here:
http://mynewt.apache.org/develop/get_started/native_install/index.html

2. Upgrade the Mynewt repos to 1.4.0 by running:

    newt upgrade

inside your project directory.

>   2.  How can I make sure it's configuring the right UART?

There is a syscfg setting defined by
@apache-mynewt-nimble/nimble/transport/uart called `BLE_HCI_UART_PORT`.
By default, this is defined to be 0.  You can change its value if you need to use a different UART.

>   3.  Do I change the target syscfg or the one in the app folder?

I recommend changing the target's syscfg.  The target configuration overrides the app configuration, and it is best not to change a foreign repo except when necessary.  The syscfg system is described in more detail here:
http://mynewt.apache.org/develop/os/modules/sysinitconfig/sysinitconfig.html

>   4.  Do I really need the bootloader? If so, is there documentation to why, I will eventually need to modify this.

The boot loader is not strictly required, but much of the Mynewt infrastructure assumes it is present.  When you are getting Mynewt up and running for the first time, I recommend you use the boot loader so that you can follow the documentation more closely.

Chris

RE: bleprph using HCI 4 wire

Posted by Jeff Belz <jb...@vectorform.com>.
A few more questions

1) If I configure to UART 2, what pins does it select.  UART 2 on the STM32F4 can be configured to different pins.
2) HAL_UART_FLOW_CTL_RTS_CTS <-  Where is this definition
3) When Selection UART 2.  Is that actual UART 2 or is it really UART 1.     What I mean to say the STM32f412 does not have a UART 0.   It starts from 1.  So when I type in the "value" 0 in the BLE_HCI_UART_PORT, what UART does it select



-----Original Message-----
From: Christopher Collins <ch...@runtime.io> 
Sent: Monday, June 25, 2018 11:25 PM
To: dev@mynewt.apache.org
Subject: Re: bleprph using HCI 4 wire

Hi Jeff,

My responses are inline.

On Tue, Jun 26, 2018 at 02:11:46AM +0000, Jeff Belz wrote:
> All:
> 
> 
> I'm using a BroadCom(Cypress)43438 Bluetooth chip that receives a 4 
> wire HCI.  I got one response that said I just have to change the  
> syscfg setting in my target to
> 
> 
> 
>     BLE_HCI_TRANSPORT_NIMBLE_BUILTIN: 0
>     BLE_HCI_TRANSPORT_UART: 1
> 
>   1.  I can't find any documentation to what these lines do?

The documentation for syscfg settings is in the packages themselves.
Both of the above settings are defined by the @apache-mynewt-nimble/nimble/transport package.  You can see the full list of settings in a project, along with their descriptions, with this
command:

    newt target config show <target-name>

However, I don't think you will see either of these settings if you execute this command.  From the dependency list you quoted, it looks like you are using an older version of Mynewt which does not support these two settings.  I believe you are using Mynewt 1.3.0; you will want to upgrade to 1.4.0, released about one week ago.  There was a long delay between the releases of 1.3.0 and 1.4.0, and I mistakenly forgot that 1.4.0 was not yet released when I wrote my original email.

The latest version introduces some fairly major changes, so I suggest you upgrade as follows:

1. Download Newt 1.4.0 as described here:
http://mynewt.apache.org/develop/get_started/native_install/index.html

2. Upgrade the Mynewt repos to 1.4.0 by running:

    newt upgrade

inside your project directory.

>   2.  How can I make sure it's configuring the right UART?

There is a syscfg setting defined by
@apache-mynewt-nimble/nimble/transport/uart called `BLE_HCI_UART_PORT`.
By default, this is defined to be 0.  You can change its value if you need to use a different UART.

>   3.  Do I change the target syscfg or the one in the app folder?

I recommend changing the target's syscfg.  The target configuration overrides the app configuration, and it is best not to change a foreign repo except when necessary.  The syscfg system is described in more detail here:
http://mynewt.apache.org/develop/os/modules/sysinitconfig/sysinitconfig.html

>   4.  Do I really need the bootloader? If so, is there documentation to why, I will eventually need to modify this.

The boot loader is not strictly required, but much of the Mynewt infrastructure assumes it is present.  When you are getting Mynewt up and running for the first time, I recommend you use the boot loader so that you can follow the documentation more closely.

Chris

Re: bleprph using HCI 4 wire

Posted by Christopher Collins <ch...@runtime.io>.
Hi Jeff,

My responses are inline.

On Tue, Jun 26, 2018 at 02:11:46AM +0000, Jeff Belz wrote:
> All:
> 
> 
> I'm using a BroadCom(Cypress)43438 Bluetooth chip that receives a 4 wire HCI.  I got one response that said I just have to change the  syscfg setting in my target to
> 
> 
> 
>     BLE_HCI_TRANSPORT_NIMBLE_BUILTIN: 0
>     BLE_HCI_TRANSPORT_UART: 1
> 
>   1.  I can't find any documentation to what these lines do?

The documentation for syscfg settings is in the packages themselves.
Both of the above settings are defined by the
@apache-mynewt-nimble/nimble/transport package.  You can see the full
list of settings in a project, along with their descriptions, with this
command:

    newt target config show <target-name>

However, I don't think you will see either of these settings if you
execute this command.  From the dependency list you quoted, it looks
like you are using an older version of Mynewt which does not support
these two settings.  I believe you are using Mynewt 1.3.0; you will want
to upgrade to 1.4.0, released about one week ago.  There was a long
delay between the releases of 1.3.0 and 1.4.0, and I mistakenly forgot
that 1.4.0 was not yet released when I wrote my original email.

The latest version introduces some fairly major changes, so I suggest
you upgrade as follows:

1. Download Newt 1.4.0 as described here:
http://mynewt.apache.org/develop/get_started/native_install/index.html

2. Upgrade the Mynewt repos to 1.4.0 by running:

    newt upgrade

inside your project directory.

>   2.  How can I make sure it's configuring the right UART?

There is a syscfg setting defined by
@apache-mynewt-nimble/nimble/transport/uart called `BLE_HCI_UART_PORT`.
By default, this is defined to be 0.  You can change its value if you
need to use a different UART.

>   3.  Do I change the target syscfg or the one in the app folder?

I recommend changing the target's syscfg.  The target configuration
overrides the app configuration, and it is best not to change a foreign
repo except when necessary.  The syscfg system is described in more
detail here:
http://mynewt.apache.org/develop/os/modules/sysinitconfig/sysinitconfig.html

>   4.  Do I really need the bootloader? If so, is there documentation to why, I will eventually need to modify this.

The boot loader is not strictly required, but much of the Mynewt
infrastructure assumes it is present.  When you are getting Mynewt up
and running for the first time, I recommend you use the boot loader so
that you can follow the documentation more closely.

Chris