stm32f405 + CYW43012

224 views
Skip to first unread message

Vladimir

unread,
Mar 15, 2021, 7:26:54 AM3/15/21
to btstack-dev
Hello Matthias

I use stm32f405 microcontroller with CYW43012 BlueTooth chip
As I understand this chip needs an init script

You mentioned BCM43430A1.hcd file at

But is it suitable with CYW43012 chip?
And how it can be converted to *.c file?

Best regards
Vladimir 

Matthias Ringwald

unread,
Mar 15, 2021, 12:45:30 PM3/15/21
to btsta...@googlegroups.com
Hi Vladimir

Yes, most non-USB Bluetooth Controller require configuration or init scripts, as they are called in BTstack.

The Bluetooth component of the CYW43012 is most likely different from the one in the BCM43430A1.

---

Where did you get the CYW43012? Are there any dev kits?
It's a good place to ask for the 'PatchRAM' (the Broadcom name for the init script)

The PatchRAM data is also provided for some Wifi+Bluetooth Controllers as part of the official WICED SDK.

It does not look like there is a file for it in WICED 6.6 On the other hand, there is none for the 20704/7 controllers, and they work fine without.
So, I suggest to give it a try without an init script.

---

According to this:
https://cypresssemiconductorco.github.io/btsdk-docs/BT-SDK/43012-C0_Bluetooth/API/index.html#wiced_web

there's a WICED BT SDK which seems to be included in the ModusToolbox:
https://cypresssemiconductorco.github.io/btsdk-docs/BT-SDK/index.html

The first step is to see, if you get a response to HCI Reset at 115200. If yes, go ahead, if not. there's a chance that the RTS line must be either HIGH or LOW during CYW43012 reset and it only works in one configuration.

Best
Matthias
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/664f0f36-7ee4-4aa1-a834-a08b9a3e50b5n%40googlegroups.com.

Vladimir

unread,
Mar 16, 2021, 9:01:20 AM3/16/21
to btstack-dev
Thank you, Matthias!

I use  1LV M.2 Module from Embedded Artists
https://www.embeddedartists.com/products/1lv-m-2-module/

The task is to connect this module to stm32f405 microcontroller without WiFi (not now at least)
I'll try to get answer to RESET command and if it's necessary  set RTS to HIGH or LOW, and then setup BTSTACK with costom profile without the init script 

Best regards 
Vladimir 
понедельник, 15 марта 2021 г. в 18:45:30 UTC+2, Matthias Ringwald:

Matthias Ringwald

unread,
Mar 17, 2021, 6:16:14 AM3/17/21
to btsta...@googlegroups.com
Hi Vladimir.

Thanks for the link. A pity Cypress/Infineon does not provide dev kits themselves/publicly.

Following these, I found a link on the Murata webpage to Cypress PatchRAM files incl. the 43012C0: https://github.com/murata-wireless/cyw-bt-patch

You could use the posix-h4 port first, which can directly read .hcd files. For embedded, you can convert the .hcd file e.g. with xxd into a large C array
and use with the BCM support in BTstack.

Please let me know how you proceed.

Last question: what do you plan to use for Wifi? There's support mentioned as part of NXP’s MCUXpresso SDK 2.8.5 or later (https://wireless.murata.com/products/rf-modules-1/wi-fi-bluetooth-for-nxp-i-mx.html#FreeRTOS).

Best
Matthias
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/5cf81686-edbf-44fc-8a36-dcb345b779b0n%40googlegroups.com.

Vladimir

unread,
Mar 25, 2021, 11:25:57 AM3/25/21
to btstack-dev
Hi Matthias
Thank you for helping me
As for WiFi, there is no task to support it for now
Thank you for the patch link, I download BCM43012C0_003.001.015.0102.0141.1LV.hcd file and converted it to C array, it was turned out that it's size is about 64KB :)
I have a problem with baud change command now, here is the log:
[00:00:00.309] CMD => 03 0C 00 
[00:00:00.310] EVT <= 6E 00 
[00:00:00.510] LOG -- hci.c.1164: Resend HCI Reset
[00:00:00.510] CMD => 03 0C 00 
[00:00:00.511] EVT <= 6E 00 
[00:00:00.513] EVT <= 0E 04 01 03 0C 00 
[00:00:00.513] CMD => 01 10 00 
[00:00:00.514] EVT <= 6E 00 
[00:00:00.516] LOG -- hci_transport_h4.c.212: Bluetooth controller not by Cypress
[00:00:00.516] EVT <= 0E 0C 01 01 10 00 09 00 00 09 0F 00 0F 61 
[00:00:00.517] LOG -- hci.c.2118: Manufacturer: 0x000f
[00:00:00.518] CMD => 14 0C 00 
[00:00:00.518] EVT <= 6E 00 
[00:00:00.543] EVT <= 0E FC 01 14 0C 00 42 43 4D 34 33 30 31 32 43 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[00:00:00.552] LOG -- hci.c.2024: local name: BCM43012C0
[00:00:00.553] LOG -- hci.c.1703: Received local name, need baud change 1
[00:00:00.554] CMD => 18 FC 06 00 00 00 C2 01 00 
[00:00:00.555] EVT <= 6E 00 
[00:00:00.556] EVT <= 0E 04 01 18 FC 00 
[00:00:00.556] LOG -- hci.c.1716: Local baud rate change to 115200(w4_send_baud_change)
[00:00:00.557] LOG -- hci_transport_h4.c.175: hci_transport_h4_set_baudrate 115200
[00:00:00.558] CMD => 2E FC 00 
[00:00:00.559] EVT <= 6E 00 
[00:00:00.559] EVT <= 10 01 00 
[00:00:00.560] LOG -- hci.c.2735: Hardware Error: 0x00
[00:00:00.560] LOG -- hci.c.3323: hci_power_control_off
 
As I see, it does not detect Cypress chip, so the bug workaround does not work, although after that the local name is right
I skiped the baud change, it starts  the init script downloading, but at the endBTSTACK wants to change baud again and Hardware Error happens

Best regards
Vladimir
среда, 17 марта 2021 г. в 12:16:14 UTC+2, Matthias Ringwald:

Matthias Ringwald

unread,
Mar 25, 2021, 11:29:05 AM3/25/21
to btsta...@googlegroups.com
Hi Vladimir

I've ordered a Murata m.2 adapter and the cyw43012 module but didn't get it yet.

Baud rate changes are tricky. Please set main baud rate to 0, this will skip the baud change to see if this brings you further.
Alternatively, there could be other issues in your port - here, a logic trace of the UART lines might help.

Best
Matthias
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/f93d127d-4818-4aa4-bf00-ccbb592f4901n%40googlegroups.com.

Vladimir Hapoiants

unread,
Mar 29, 2021, 12:29:51 PM3/29/21
to btsta...@googlegroups.com
Hello Matthias 

I set main baud rate to 0 and this skipped the baud changing, so BTSTACK downloads the init script and I get  'HCI working' state for now 
Moreover I see my BlueTooth device (with customer profile, that I use on previous device with CC2564 chip ) on the phone  

But when I try to connect, something wrong happens and 'disconnect' is received: 
[00:00:43.353] EVT <= 3E 13 01 00 40 00 01 01 9F 5E 72 64 4E 69 18 00 00 00 48 00 01
[00:00:43.354] LOG -- hci.c.2193: LE Connection_complete (status=0) type 1, 69:4E:64:72:5E:9F
[00:00:43.355] LOG -- hci.c.194: create_connection_for_addr 69:4E:64:72:5E:9F, type 1
[00:00:43.356] LOG -- hci.c.1132: state 7, role 1, le_con 1
[00:00:43.357] LOG -- hci.c.1138: Num LE Peripheral roles: 1 of 1
[00:00:43.357] LOG -- hci.c.2271: New connection: handle 64, 69:4E:64:72:5E:9F
[00:00:43.358] LOG -- hci.c.5019: BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 1
[00:00:43.359] EVT <= 61 01 01
[00:00:43.359] LOG -- Core/Src/app_bt.c.757: Low level connect
[00:00:43.360] LOG -- Core/Src/app_bt.c.758: Connection handle 0x0040, state - CONNECTED, address type 1, address 69:4E:64:72:5E:9F, default mtu 20
[00:00:43.361] LOG -- Core/Src/app_bt.c.759: - Connection Interval: 30.00 ms
[00:00:43.362] LOG -- Core/Src/app_bt.c.760: - Connection Latency: 0
[00:00:43.363] LOG -- sm.c.3472: sm: connected
[00:00:43.364] LOG -- sm.c.3485: New sm_conn, role slave
[00:00:43.364] EVT <= D5 09 40 00 01 9F 5E 72 64 4E 69
[00:00:43.365] LOG -- att_server.c.401: SM_EVENT_IDENTITY_RESOLVING_STARTED
[00:00:43.366] LOG -- sm.c.2118: LE Device Lookup: device 0/1
[00:00:43.366] LOG -- sm.c.2126: device type 254, addr: 00:00:00:00:00:00
[00:00:43.367] LOG -- sm.c.2161: LE Device Lookup: not found
[00:00:43.368] EVT <= D6 09 40 00 01 9F 5E 72 64 4E 69
[00:00:43.368] LOG -- Core/Src/app_bt.c.796: Identity resolving failed
[00:00:43.369] LOG -- att_serv
[00:00:43.607] EVT <= 05 04 00 40 00 3E
[00:00:43.607] LOG -- hci.c.1132: state 10, role 1, le_con 1
[00:00:43.608] LOG -- hci.c.1138: Num LE Peripheral roles: 0 of 1
[00:00:43.609] LOG -- Core/Src/app_bt.c.827: Disconnect
[00:00:43.609] LOG -- Core/Src/app_bt.c.251: WRITE Callback, attribute handle 0000
[00:00:43.610] LOG -- Core/Src/app_bt.c.827: Disconnect
[00:00:43.611] LOG -- hci.c.950: Connection closed: handle 0x40, 69:4E:64:72:5E:9F
[00:00:43.611] LOG -- hci.c.5019: BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 0
[00:00:43.612] EVT <= 61 01 00
[00:00:43.612] CMD => 0A 20 01 01
[00:00:43.613] EVT <= 6E 00
[00:00:43.614] EVT <= FF 0C 1B 04 02 00 00 F6 01 01 00 00 00 00
[00:00:43.615] EVT <= 0E 04 01 0A 20 00

Best regards 
Vladimir

чт, 25 бер. 2021 о 17:29 Matthias Ringwald <matthias...@gmail.com> пише:
You received this message because you are subscribed to a topic in the Google Groups "btstack-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/btstack-dev/a8DJdc_SjYI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to btstack-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/809AC6D7-CDF7-4F01-A6B9-8E596D260B5D%40gmail.com.

Matthias Ringwald

unread,
Mar 30, 2021, 3:41:28 AM3/30/21
to btsta...@googlegroups.com
Hi Vladimir

Looks like progress. If you convert the log with the tool/create_packet_log.py tool, you can open it with Wireshark.
There, you'll find this:

Bluetooth HCI Event - Disconnect Complete
Reason: Connection Failed to be Established (0x3e)

So, the remote saw your device, tried to connect, but never got a single response after the connection request.

My best guess here is that the PatchRAM / Config isn't 100% correct.
I'd suggest to browse the Embedded Artists website longer and try to figure out what PatchRAM file they use or ask somehow.
If you find something, please let me know, too. I've received the uSD-m2 adapter and the module, but won't be able to look at it in the next days.

Why the CYW43012?

Best regards
Matthias
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/CAJfmEhxVshSp01p-0BwdS9nVQuOqc6BV6uOEnO%3DD1JEkN_yV_A%40mail.gmail.com.

Matthias Ringwald

unread,
May 26, 2021, 5:30:31 PM5/26/21
to btsta...@googlegroups.com
Hi Vladimir

I've got the hardware (a while ago) and did set it up with an USB-2-UART converter. I was able to run the GATT Streamer as well as the SPP Streamer examples correctly from my Mac.
I've used the BCM43012C0_003.001.015.0102.0141.1LV.hcd from the murata repo and set the main baud rate to 921600.

The guys at Embedded Artists forgot a RESET button though, I guess I need to add one to the murata uSD M.2 adatper somehow.

Best
Matthias

Vladimir Hapoiants

unread,
May 27, 2021, 3:46:38 PM5/27/21
to btsta...@googlegroups.com
Hi Matthias 

Sounds great!
I delayed this project for a while, now I am using EM9304 chip in SPI mode, but going to check it as soon as have time.
So could you 'see' the le streamer and connect to it without 'disconnect' event?
 
Best regards
Vladimir

чт, 27 трав. 2021 о 00:30 Matthias Ringwald <matthias...@gmail.com> пише:

Matthias Ringwald

unread,
May 27, 2021, 4:54:30 PM5/27/21
to btsta...@googlegroups.com
Hi Vladimir

The EM9304 is a good choice for an LE-only Controller via HCI.

Yes, the GATT Streamer was streaming for a few minutes. I've also let the SPP Streamer run for 300+ MB of data (well, that was the size of the hci dump file anyway).

Best
Matthias
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/CAJfmEhzoAn2Gja9zb7JqzFKbou%2BwHEhznUT6sxBZK1mcyrxnGw%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages