How to use HCI UART H5 mode with BCM43438/CYW43438?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
mringwal
Level 4
Level 4
Associated Partner - BlueKitchen GmbH
5 sign-ins 10 questions asked 10 replies posted

I'm trying to setup the H5 Link and communicate with the BCM43438.

Setup: RedBear IoT pHAT with AP6212A (BCM43438A1) (GitHub - redbear/IoT_pHAT: WiFi + Bluetooth, designed for the Raspberry Pi Zero ) connected via USB-2-UART adapter to OS X, with btstack (http://btstack.org) from port/posix-h5 folder.

When using the same code for H5 that works with TI's CC256x line and CSR8811, the BCM detects the H5 SYNC message and responds with a SYNC RESPONSE. Then, the Config is successfully exchanged, too. After that, BTstack tries to send an HCI Reset, but it never gets an answer from the BCM.

Traces from Saleae Logic analyzer:  https://bluekitchen-gmbh.com/files/cypress/BCM43xx_H5_No_Flow.logicdata 

Log: https://bluekitchen-gmbh.com/files/cypress/BCM43xx_H5_No_Flow.txt

--

Is there anything special to consider for H5 with BCM?

Is there a setup that I could try and compare?

Is there an option to configure WICED Studio to use H5 e.g. for the BCM43xx platform?

I've tried blueZ hciattach from Debian 8 with "3wire" and "bcsp", but did not get a response from the BCM. I've tried the 'broadcom-patchram" tool and it is also able to setup a H5 Link, but then sends an HCI Command as H4. Can the BCM work in H5 AND H4 at the same time?

Thanks!

Matthias

I'll also paste the log here:

[2017-04-18 15:49:52.868] LOG -- hci.c.2485: hci_power_control: 1, current mode 0

[2017-04-18 15:49:54.368] LOG -- btstack_uart_block_posix.c.166: h4_set_baudrate 115200

[2017-04-18 15:49:54.369] LOG -- hci_transport_h5.c.789: UART driver does not provide compatible sleep mode

[2017-04-18 15:49:54.369] LOG -- hci_transport_h5.c.688: resend timeout for 115200 baud: 355 ms

[2017-04-18 15:49:54.369] LOG -- hci_transport_h5.c.307: link send sync

[2017-04-18 15:49:54.369] LOG -- hci_transport_h5.c.301: hci_transport_link_send_control: size 2, append dic 0

[2017-04-18 15:49:54.369] LOG -- btstack_util.c.225: 0x01, 0x7E,

[2017-04-18 15:49:54.369] LOG -- hci_transport_h5.c.238: slip: send 8 bytes

[2017-04-18 15:49:54.369] LOG -- hci.c.3411: BTSTACK_EVENT_STATE 1

[2017-04-18 15:49:54.369] EVT <= 60 01 01

[2017-04-18 15:49:54.623] LOG -- hci_transport_h5.c.307: link send sync

[2017-04-18 15:49:54.623] LOG -- hci_transport_h5.c.301: hci_transport_link_send_control: size 2, append dic 0

[2017-04-18 15:49:54.623] LOG -- btstack_util.c.225: 0x01, 0x7E,

[2017-04-18 15:49:54.623] LOG -- hci_transport_h5.c.238: slip: send 8 bytes

[2017-04-18 15:49:54.874] LOG -- hci_transport_h5.c.307: link send sync

[2017-04-18 15:49:54.874] LOG -- hci_transport_h5.c.301: hci_transport_link_send_control: size 2, append dic 0

[2017-04-18 15:49:54.874] LOG -- btstack_util.c.225: 0x01, 0x7E,

[2017-04-18 15:49:54.875] LOG -- hci_transport_h5.c.238: slip: send 8 bytes

[2017-04-18 15:49:55.126] LOG -- hci_transport_h5.c.307: link send sync

[2017-04-18 15:49:55.126] LOG -- hci_transport_h5.c.301: hci_transport_link_send_control: size 2, append dic 0

[2017-04-18 15:49:55.126] LOG -- btstack_util.c.225: 0x01, 0x7E,

[2017-04-18 15:49:55.126] LOG -- hci_transport_h5.c.238: slip: send 8 bytes

[2017-04-18 15:49:55.376] LOG -- hci_transport_h5.c.307: link send sync

[2017-04-18 15:49:55.376] LOG -- hci_transport_h5.c.301: hci_transport_link_send_control: size 2, append dic 0

[2017-04-18 15:49:55.376] LOG -- btstack_util.c.225: 0x01, 0x7E,

[2017-04-18 15:49:55.376] LOG -- hci_transport_h5.c.238: slip: send 8 bytes

[2017-04-18 15:49:55.627] LOG -- hci_transport_h5.c.307: link send sync

[2017-04-18 15:49:55.627] LOG -- hci_transport_h5.c.301: hci_transport_link_send_control: size 2, append dic 0

[2017-04-18 15:49:55.627] LOG -- btstack_util.c.225: 0x01, 0x7E,

[2017-04-18 15:49:55.627] LOG -- hci_transport_h5.c.238: slip: send 8 bytes

[2017-04-18 15:49:55.697] LOG -- hci_transport_h5.c.518: process_frame, reliable 0, packet type 15, seq_nr 0, ack_nr 0 , dic 0

[2017-04-18 15:49:55.697] LOG -- btstack_util.c.225: 0x00, 0x2F, 0x00, 0xD0,

[2017-04-18 15:49:55.697] LOG -- btstack_util.c.225: 0x01, 0x7E,

[2017-04-18 15:49:55.697] LOG -- hci_transport_h5.c.560: link received sync

[2017-04-18 15:49:55.697] LOG -- hci_transport_h5.c.312: link send sync response

[2017-04-18 15:49:55.697] LOG -- hci_transport_h5.c.301: hci_transport_link_send_control: size 2, append dic 0

[2017-04-18 15:49:55.697] LOG -- btstack_util.c.225: 0x02, 0x7D,

[2017-04-18 15:49:55.697] LOG -- hci_transport_h5.c.238: slip: send 8 bytes

[2017-04-18 15:49:55.713] LOG -- hci_transport_h5.c.518: process_frame, reliable 0, packet type 15, seq_nr 0, ack_nr 0 , dic 0

[2017-04-18 15:49:55.713] LOG -- btstack_util.c.225: 0x00, 0x2F, 0x00, 0xD0,

[2017-04-18 15:49:55.713] LOG -- btstack_util.c.225: 0x02, 0x7D,

[2017-04-18 15:49:55.713] LOG -- hci_transport_h5.c.564: link received sync response

[2017-04-18 15:49:55.713] LOG -- hci_transport_h5.c.567: link initialized

[2017-04-18 15:49:55.713] LOG -- hci_transport_h5.c.317: link send config

[2017-04-18 15:49:55.713] LOG -- hci_transport_h5.c.301: hci_transport_link_send_control: size 3, append dic 0

[2017-04-18 15:49:55.713] LOG -- btstack_util.c.225: 0x03, 0xFC, 0x01,

[2017-04-18 15:49:55.713] LOG -- hci_transport_h5.c.238: slip: send 10 bytes

[2017-04-18 15:49:55.729] LOG -- hci_transport_h5.c.518: process_frame, reliable 0, packet type 15, seq_nr 0, ack_nr 0 , dic 0

[2017-04-18 15:49:55.729] LOG -- btstack_util.c.225: 0x00, 0x2F, 0x00, 0xD0,

[2017-04-18 15:49:55.729] LOG -- btstack_util.c.225: 0x02, 0x7D,

[2017-04-18 15:49:55.963] LOG -- hci_transport_h5.c.317: link send config

[2017-04-18 15:49:55.963] LOG -- hci_transport_h5.c.301: hci_transport_link_send_control: size 3, append dic 0

[2017-04-18 15:49:55.963] LOG -- btstack_util.c.225: 0x03, 0xFC, 0x01,

[2017-04-18 15:49:55.963] LOG -- hci_transport_h5.c.238: slip: send 10 bytes

[2017-04-18 15:49:55.969] LOG -- hci_transport_h5.c.518: process_frame, reliable 0, packet type 15, seq_nr 0, ack_nr 0 , dic 0

[2017-04-18 15:49:55.969] LOG -- btstack_util.c.225: 0x00, 0x2F, 0x00, 0xD0,

[2017-04-18 15:49:55.969] LOG -- btstack_util.c.225: 0x02, 0x7D,

[2017-04-18 15:49:56.215] LOG -- hci_transport_h5.c.317: link send config

[2017-04-18 15:49:56.215] LOG -- hci_transport_h5.c.301: hci_transport_link_send_control: size 3, append dic 0

[2017-04-18 15:49:56.215] LOG -- btstack_util.c.225: 0x03, 0xFC, 0x01,

[2017-04-18 15:49:56.215] LOG -- hci_transport_h5.c.238: slip: send 10 bytes

[2017-04-18 15:49:56.225] LOG -- hci_transport_h5.c.518: process_frame, reliable 0, packet type 15, seq_nr 0, ack_nr 0 , dic 0

[2017-04-18 15:49:56.225] LOG -- btstack_util.c.225: 0x00, 0x2F, 0x00, 0xD0,

[2017-04-18 15:49:56.225] LOG -- btstack_util.c.225: 0x02, 0x7D,

[2017-04-18 15:49:56.466] LOG -- hci_transport_h5.c.317: link send config

[2017-04-18 15:49:56.466] LOG -- hci_transport_h5.c.301: hci_transport_link_send_control: size 3, append dic 0

[2017-04-18 15:49:56.466] LOG -- btstack_util.c.225: 0x03, 0xFC, 0x01,

[2017-04-18 15:49:56.466] LOG -- hci_transport_h5.c.238: slip: send 10 bytes

[2017-04-18 15:49:56.481] LOG -- hci_transport_h5.c.518: process_frame, reliable 0, packet type 15, seq_nr 0, ack_nr 0 , dic 0

[2017-04-18 15:49:56.481] LOG -- btstack_util.c.225: 0x00, 0x2F, 0x00, 0xD0,

[2017-04-18 15:49:56.481] LOG -- btstack_util.c.225: 0x03, 0xFC,

[2017-04-18 15:49:56.481] LOG -- hci_transport_h5.c.580: link received config, 0x00

[2017-04-18 15:49:56.481] LOG -- hci_transport_h5.c.322: link send config response

[2017-04-18 15:49:56.481] LOG -- hci_transport_h5.c.301: hci_transport_link_send_control: size 3, append dic 0

[2017-04-18 15:49:56.481] LOG -- btstack_util.c.225: 0x04, 0x7B, 0x01,

[2017-04-18 15:49:56.481] LOG -- hci_transport_h5.c.238: slip: send 10 bytes

[2017-04-18 15:49:56.497] LOG -- hci_transport_h5.c.518: process_frame, reliable 0, packet type 15, seq_nr 0, ack_nr 0 , dic 0

[2017-04-18 15:49:56.497] LOG -- btstack_util.c.225: 0x00, 0x3F, 0x00, 0xC0,

[2017-04-18 15:49:56.497] LOG -- btstack_util.c.225: 0x04, 0x7B, 0x01,

[2017-04-18 15:49:56.497] LOG -- hci_transport_h5.c.586: link received config response 0x01, data integrity check supported 0

[2017-04-18 15:49:56.497] LOG -- hci_transport_h5.c.589: link activated

[2017-04-18 15:49:56.497] EVT <= 6E 00

[2017-04-18 15:49:56.497] CMD => 03 0C 00

[2017-04-18 15:49:56.497] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:49:56.497] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:49:56.497] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:49:56.697] LOG -- hci.c.973: Resend HCI Reset

[2017-04-18 15:49:56.853] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:49:56.853] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:49:56.853] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:49:57.212] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:49:57.212] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:49:57.212] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:49:57.567] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:49:57.567] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:49:57.567] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:49:57.925] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:49:57.925] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:49:57.925] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:49:58.282] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:49:58.282] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:49:58.282] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:49:58.640] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:49:58.640] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:49:58.640] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:49:58.999] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:49:58.999] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:49:58.999] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:49:59.358] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:49:59.358] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:49:59.358] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:49:59.714] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:49:59.714] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:49:59.714] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:50:00.072] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:50:00.073] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:50:00.073] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:50:00.428] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:50:00.428] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:50:00.428] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:50:00.783] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:50:00.783] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:50:00.783] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:50:01.140] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:50:01.140] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:50:01.140] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:50:01.500] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:50:01.500] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:50:01.500] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:50:01.859] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:50:01.859] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:50:01.859] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:50:02.218] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:50:02.218] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:50:02.218] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:50:02.576] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:50:02.576] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:50:02.576] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:50:02.934] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:50:02.934] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:50:02.934] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:50:03.291] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:50:03.291] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:50:03.291] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

[2017-04-18 15:50:03.650] LOG -- hci_transport_h5.c.350: hci_transport_link_send_queued_packet: seq 0, ack 0, size 3. Append dic 0, dic = 0x0000

[2017-04-18 15:50:03.650] LOG -- btstack_util.c.225: 0x03, 0x0C, 0x00,

[2017-04-18 15:50:03.651] LOG -- hci_transport_h5.c.238: slip: send 9 bytes

^CCTRL-C - SIGINT received, shutting down..

0 Likes
1 Solution
mringwal
Level 4
Level 4
Associated Partner - BlueKitchen GmbH
5 sign-ins 10 questions asked 10 replies posted

During the H5 Link Setup, the BCM chipset did send an 'empty' CONFIG message { 0x03 0xfc } without the actual Configuration Field. Our stack was responding with a regular CONFIG RESPONSE (0x04 0xfb 0x11). After receiving this message the BCM chipset did not send any other message anymore. A work around has been to respond with an equally 'empty' CONFIG RESPONSE { 0x04 0xfb }. After that we were able to send regular HCI commands.

(just for the record: hciattach actually worked when I've tried another time, )

View solution in original post

0 Likes
1 Reply
mringwal
Level 4
Level 4
Associated Partner - BlueKitchen GmbH
5 sign-ins 10 questions asked 10 replies posted

During the H5 Link Setup, the BCM chipset did send an 'empty' CONFIG message { 0x03 0xfc } without the actual Configuration Field. Our stack was responding with a regular CONFIG RESPONSE (0x04 0xfb 0x11). After receiving this message the BCM chipset did not send any other message anymore. A work around has been to respond with an equally 'empty' CONFIG RESPONSE { 0x04 0xfb }. After that we were able to send regular HCI commands.

(just for the record: hciattach actually worked when I've tried another time, )

0 Likes