How to Factory Reset CYW920819EVB-02 (Connection timeout in hciconfig)

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

cross mob
HotPotTofu
Level 1
Level 1
10 sign-ins 5 replies posted 5 questions asked

Hi,

I need help to factory reset the CYW920819EVB-02 evaluation board. I had previously did something wrong after I downloaded an application and cannot use "btattach -B /dev/ttyUSB1 -S 115200 &" (where ttyUSBx is the first to be USB dev path to be attached in "dmesg" as there are 2 numbers when the dev board is plugged in) command to attach the development board to Linux OS properly.

When executing "hciconfig", it shows the BT address as 00:00:00:00:00:00 and is DOWN. Executing "hciconfig hci1 up" will result in connection time out. Previously before programming the application was not like this.

I have tried:

1) Pressing BLUE Reset button

2) Entering Recovery Mode

  • Press and hold the RED 'Recover' button on the board.
  • Press and hold the BLUE 'Reset' button on the board.
  • Release the BLUE 'Reset' button.
  • After one second, release the RED 'Recover' button.

Both method does not seem to work. I am not sure how to tell if reset is successful as only some LED blinks.

I have also tried to follow: https://community.infineon.com/t5/Resource-Library/Running-BlueZ-on-CY-Part/ta-p/246050
When executing "sudo hciattach  /dev/ttyUSB0 -t 10 any 115200 noflow nosleep", "dmesg" shows hci command timeout. I have tried to manually reset by pressing BLUE 'Reset' button but it still doesn't work.

Is there ANY way to factory reset the entire device to its original state (Before I downloaded sample application)?

 

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @HotPotTofu ,

The problem could be that there is some application running on the 20819 that could be corrupted and causing this issue. When the 20819 device is running in controller only mode, there should not be any application running on it. We recommend you to do the following:

Perform recovery procedure and program the device with an empty app. Something similar to below.

https://github.com/Infineon/mtb-example-btsdk-empty

You can delete all the code inside APPLICATION_START from the above app and program it.. App_bt_cfg.c/.h can also be  removed. This ensures that all the patches are loaded but no application is running.

After this try to attach the device using hciattach and start the communication using hciconfig hci1 up

Let us know if this works for you!

Regards,
Bragadeesh

View solution in original post

0 Likes
7 Replies
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @HotPotTofu ,

The problem could be that there is some application running on the 20819 that could be corrupted and causing this issue. When the 20819 device is running in controller only mode, there should not be any application running on it. We recommend you to do the following:

Perform recovery procedure and program the device with an empty app. Something similar to below.

https://github.com/Infineon/mtb-example-btsdk-empty

You can delete all the code inside APPLICATION_START from the above app and program it.. App_bt_cfg.c/.h can also be  removed. This ensures that all the patches are loaded but no application is running.

After this try to attach the device using hciattach and start the communication using hciconfig hci1 up

Let us know if this works for you!

Regards,
Bragadeesh
0 Likes

Hi @BragadeeshV 

Yes, programming empty application fix this issue. However, it seems that it is not because application is corrupted that cause device to be "DOWN" after btattach.

When programming board with empty application, the board is "UP" in hciconfig after btattach the HCI UART.

But after reprogramming the OPP server application the board is "DOWN" in hciconfig after btattach the HCI UART and the BT address is 00:00:00:00:00:00.

1) May I know the reason why the OPP server application cause the board to be down? And is there any way to fix this because I need both OPP server and btattach to be UP.

2) You also mentioned the board has controller mode and from here it also mentions there is HCI mode. Are these two modes the same?
And is there a documentation I can refer to for all the different modes of the board and how to enter them?
If no documentation, are you able to list down the modes and how I can enter the different modes as it would be very useful.

Thanks.

0 Likes
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @HotPotTofu ,

You can refer the following document to understand the two modes that chip can operate in , viz. Embedded mode and Controller only mode. See section 6.3 Firmware Architecture

https://www.cypress.com/documentation/application-notes/an226546-cyw20819-feature-and-peripheral-gui...

In the controller only mode, we need an external host to be connected to the HCI port and the host has to run the bluetooth host stack, ie BlueZ stack on linux machine in your case. You can run any profiles on the linux host.

In embedded only mode,  application, host stack and the controller will be on the BT chip itself. This is achieved by programming the chip with a custom BTSDK application.

However, you can't achieve both of these together, ie you can't run an external LINUX host running Bluez as well as run an application in the 20819 chip. We would like to understand your use case as to why you need two different host stacks (one host in 20819 and other in Linux - Bluez)

In case you want to interface the BT chip with an external linux machine as well as run the OPP server profile (as an application) on the BT Chip, then you need to implement something similar to WICED HCI Protocol, details can be found below. However, you can't use the BlueZ stack in this case since the bluetooth host stack will run on the BT Chip.

https://www.cypress.com/file/462731/download

Please let us know if you have questions.

Regards,
Bragadeesh
0 Likes
HotPotTofu
Level 1
Level 1
10 sign-ins 5 replies posted 5 questions asked

Hi @BragadeeshV 

Many thanks for your response.

You mentioned "In the controller only mode, we need an external host to be connected to the HCI port and the host has to run the bluetooth host stack, ie BlueZ stack on linux machine in your case. You can run any profiles on the linux host." 

May I check with you, does this mean that I am able to use execute commands from the linux host so that the development board can run Bluetooth profiles? For example, I have tried to make the board support OPP and FTP bluetooth profile by using "obexctl" and "obexftp" commands in Linux host, but it does not seem to work well with the development board.

My use case involve:
1) Patching the Bluetooth firmware ROM code (I believe this is done in real-time on RAM and is mentioned in the section "6.3 Firmware Architecture" of the document you linked).
The way I am doing this is to do the patches from Linux host after attaching HCI UART to BlueZ stack.
Reason is I need modify Bluetooth address and other information (unless there is a way to do this using Bluetooth application without patching ROM?).

2) And at the same time, I need to use OPP profile on the board.

0 Likes
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @HotPotTofu ,

We would like to understand why you want to use a LINUX machine for your use case. Both of these are possible to do in embedded mode itself (no need for an external HCI host).

1. Patching the Bluetooth firmware ROM code - Downloading any BTSDK application will load the latest ROM code into the BT Chip. Therefore when you download the OPP server example project, the latest patch ROM code will be loaded to the chip.

2. Modifying the Bluetooth address - We have an API wiced_bt_set_local_bdaddr() in the BTSDK to modify the bluetooth address in runtime. We also have a makefile option to set the BT Address of the device.

https://infineon.github.io/btsdk-docs/BT-SDK/208XX-A1_Bluetooth/API/group__group__dev__functions__ct...

This article is applicable for 20819 as well - https://community.infineon.com/t5/Resource-Library/Configuring-the-Bluetooth-device-address-in-CYW20...

If you want to use our chip as only controller only mode, then you need to do the following:

1. Load the latest patch ROM code on to the chip by following the below article.

https://community.infineon.com/t5/ModusToolbox-Blog/How-to-download-general-ROM-patch-in-BTSDK-platf...

CyBluetool linux installer can be found here: https://community.infineon.com/t5/Public-Archive/CyBluetool-Linux-Installer/m-p/252297#M4214

2. You can attach the Bluez host stack as before.

3. You can change the BT addr by issuing the Set BD addr HCI command from the linux host using hcitool command

https://community.infineon.com/t5/Wi-Fi-Bluetooth-for-Linux/How-to-change-Bluetooth-MAC-address-on-R...

We do not have examples running OBEX profile in Bluez stack since it is an open source stack. You should be able to find resources online for that. If it still doesn't work, you can share the HCI logs with us to debug further.

Regards,
Bragadeesh
0 Likes
HotPotTofu
Level 1
Level 1
10 sign-ins 5 replies posted 5 questions asked

Hi @BragadeeshV 

For my use case, apart from setting Bluetooth address, may I know is it also possible to set the device's Bluetooth Name, LMP version, LMP subversion, companyid, LMP feature pages, input/output capability, authentication requirements, out-of-band data and Class of Device (COD) in embedded mode using an application developed in ModusToolbox?

Thanks.

0 Likes
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @HotPotTofu ,

Yes this is possible. You need to use wiced_bt_cfg_settings_t  structure to set most of the BT/ BLE related parameters.

https://github.com/Infineon/mtb-example-btsdk-peripheral-privacy/blob/master/app_bt_cfg.c

Advertising parameters can be set using the wiced_bt_ble_set_raw_advertisement_data() API.

OOB data and Auth Req can be set in the BTM_PAIRING_IO_CAPABILITIES_BLE_REQUEST_EVT (for BLE) or BTM_PAIRING_IO_CAPABILITIES_BR_EDR_REQUEST_EVT (for BR/EDR) event of Bluetooth stack management event handler that we register using wiced_bt_stack_init().

Use our Github repository to find out several BTSDK examples for your use case

https://github.com/Infineon?q=%22mtb-example-btsdk%22%20NOT%20Deprecated

We recommend you to go through the BT 101 training material to explore the different features of BTSDK.

https://github.com/Infineon/CypressAcademy_BT101_Files

Regards,
Bragadeesh
0 Likes