FW Update without External Memory

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

cross mob
JaHo_4675726
Level 1
Level 1

I am trying to get to grips with the FW update process for the SDK, i have been using the uart_firmware_upgrade as a reference, but i am struggling to understand the following:

  1. Is it possible to update the FW without external memories (External EEPROM or SFLASH)?
  2. Is there any instruction for getting the uart_firmware_upgrade working on TAG4? I am unable to get this to work,

          WsUartFu: Read timeout

          WsUartFu: failed to start

It appears the data is never received on the device.

Thank you

0 Likes
1 Solution

Hi,

Q1:

The demo uart_firmware_upgrade doesn't require external memory.

The demo uart_firmware_upgrade normally requires external memory. Refer to the additional reply.

And the demo uart_firmware_upgrade is now tested working on my side. This is how I alter and test it.

  1. Change the variable hello_sensor_puart_cfg as the following screenshot, which is listed in '<WICED-Smart-SDK-2.2.3>\WICED-Smart-SDK\Apps\uart_firmware_upgrade\hello_sensor.c'.
    pastedImage_0.png
  2. Program the board and make sure it's successfully programmed and running. When the application is loaded and running, the red LED on the board will be on.
  3. Make sure no other software is occupying the PUART port connected to your PC currently. To be more specific, PUART is the COM port other than the COM port WICED Smart IDE is used to program the board. For example, COM4 and COM5 are the two ports connected to my PC from my TAG4 and COM5 is the HCI UART port. So I'm going to use COM4 in the following sequences as PUART and close all other TTY terminals which are trying to occupy COM4 and show traces before I go to the next step.
  4. Copy the newest compiled ota file uart_firmware_upgrade-BCM920737TAG_Q32-rom-ram-Wiced-release.ota.bin to the folder WsUartFu. The file is generated in '<WICED-Smart-SDK-2.2.3>\WICED-Smart-SDK\build\uart_firmware_upgrade-BCM920737TAG_Q32-rom-ram-Wiced-release' and the folder is placed in '<WICED-Smart-SDK-2.2.3>\WICED-Smart-SDK\Apps\uart_firmware_upgrade\peerapps\Windows\WsUartFu'.
  5. (Optional) You can reboot the board now to make sure the board always works steadily and robustly. After reboot, the red LED should always be on again, which indicates the application is loaded and running. If no, the chip might stall and pending in download mode. If you tried many times to reboot the board by pressing the RST button, only to see no red LED on, you can now verify the SW6 DIP switches and make sure switch 2 is off. To completely ensure that, you can pull all switches in SW6 DIP to off, to disable all functions of HCI UART, which pins will be tested during boot period and might cause the chip trapped into download mode accidentally.
  6. Now your board is running, with the red LED on. Give it 5 seconds to get everything initiated. Then open a CMD window, goto the WsUartFu directory, and type the commands to upgrade the chip as the following screenshot shows. The chip will be correctly OTAed and the success message will be shown in the CMD window.
    pastedImage_1.png
  7. After the OTA procedure, the board will reboot and the red LED will be temporary off and then on again. To show the robustness of it, you can OTA the chip again and again (but make sure to OTA it after the red LED is on every time). The OTA procedure will end up successfully each time and the board will reboot and recover as always. See the screenshot below:
    pastedImage_3.png

-------------------------------------------------------------------------

Q2:

The "ModusToolbox WICED Firmware Upgrade Library" document and its library is provided in WICED STUDIO, not WICED Smart. The upgrade APIs on WICED Smart side is listed in '<WICED-Smart-SDK-2.2.3>\WICED-Smart-SDK\Wiced-Smart\bleapp\utils\bleappfwu.h' instead, without docs fully describing it. So this document is provided to you only as reference, not guidance, since they share the same flow and procedure..

-------------------------------------------------------------------------

Hope the information is helpful to you. And thanks for bearing with me patiently and kindly.

<<<<<<<<<<<<<>>>>>>>>>>>>>

Sincere regards from​ C. L.

<<<<<<<<<<<<<>>>>>>>>>>>>>

View solution in original post

9 Replies
Charles_Lai
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 sign-ins

Hi,

Kindly inform you of this document. You might find something you need in it:

WICED Firmware Upgrade Library

<<<<<<<<<<<<<>>>>>>>>>>>>>

Sincere regards from​ C. L.

<<<<<<<<<<<<<>>>>>>>>>>>>>

0 Likes

Thank you,

Will this work on CYW20736?

This also appears to be part of ModusToolbox, We currently use WICED Smart IDE, are these two compatible

0 Likes

Hi,


I too have found the same errors when trying to run with the uart_firmware_upgrade example project on the BCM92073X_LE_TAG4 evaluation board with WICED-Smart-SDK-2.2.3

WsUartFu: Read timeout

WsUartFu: failed to start

Please could you answer the following questions:

  1. What are the DIP switch settings for performing the UART upgrade, please? e.g. SW6 positions?
  2. Are the GPIO_PIN_ settings in the platform.h correct for the TAG4 board?
  3. Is the EEPROM referred to in the ws_upgrade_uart.c and ws_upgrade.c driver files actually the internal flash memory inside the 920737 SoC device?

Regards

0 Likes

Hi,

We look forward to receiving your answers to our questions. We are anxious to make progress, as we are scaling the manufacture of our first generation product up and we also wish to de-risk this work for the next generation of our product, which is already in the design phase. If we are to use a newer Cypress BLE SoC in our latest designs, we will need to validate this work very soon. Please could someone carefully consider our questions and offer to support us?

Many thanks.

0 Likes

Hi,

Question #1:

BCM92073X_LE_TAG4 has 320K ROM internally while also provides support for external memory interfaces, as shown in the datasheet of CYW20737.

And the .btp file in WICED Smart IDE shows that the chip intends to use internal ROM only. No external memory is required in most pre-defined demos.

Question #2:

I reproduced the same error as yours. After some research, I think I've found what is the problem.

WICED Smart SDK 2.2.3 uses the generic CYW20737 platform configuration a.k.a. BCM920737TAG_Q32. And it defines GPIO_PIN_UART_TX as 32 and GPIO_PIN_UART_RX as 33. Which are served in variable hello_sensor_puart_cfg later in uart_firmware_upgrade.

But from the Schematic of BCM92073X_LE_TAG4​, what I can tell is that the chip only uses P24/P25 for PUART, not P32/P33. So program uart_firmware_upgrade unchanged to the board won't get the PUART port work correctly. Hence WsUartFu.exe won't work as expected and produces the error you saw.

In a word, the root cause is that the PUART port don't actually connect to PC. But I haven't find a nice and clean way to alter this. Basically we can change it in platform.h / uart_firmware_upgrade or manually wire up using the GPIO pins. You can try it yourself.

These links may be useful:

WICED Smart Quick Start Guide (SDK 2.x and TAG4 Board)

Trouble programming TAG4

CYW20737 Single-Chip Bluetooth Low Energy-Only System-On-Chip with Support for Wireless Charging

<<<<<<<<<<<<<>>>>>>>>>>>>>

Sincere regards from​ C. L.

<<<<<<<<<<<<<>>>>>>>>>>>>>

Dear CL,

Thank you for responding. I have two further questions for you to answer, please.

Firstly, you say "No external memory is required in most pre-defined demos." Please tell me:

Question 1: Is external memory required by the uart_firmware_upgrade example application - yes or no?

I too saw the UART pin definitions in the patform.h were incorrect according to the schematics. I tried changing them to what appeared to be the correct values, but still the uart_firmware_upgrade example would not work.

Please could I ask for you to get this example to work on the TAG4 yourself and offer me a working solution.

Question 2: Is the "ModusToolbox WICED Firmware Upgrade Library" document you referred to earlier applicable to the CYW20736 device we are using? It does not appear to be included in the SDK 2.2.3, how do we obtain this library, please?

Without full support from Cypress, I will have to reconsider our plans to use a Cypress BLE device in our new designs.

Regards

0 Likes

Hi,

Q1:

The demo uart_firmware_upgrade doesn't require external memory.

The demo uart_firmware_upgrade normally requires external memory. Refer to the additional reply.

And the demo uart_firmware_upgrade is now tested working on my side. This is how I alter and test it.

  1. Change the variable hello_sensor_puart_cfg as the following screenshot, which is listed in '<WICED-Smart-SDK-2.2.3>\WICED-Smart-SDK\Apps\uart_firmware_upgrade\hello_sensor.c'.
    pastedImage_0.png
  2. Program the board and make sure it's successfully programmed and running. When the application is loaded and running, the red LED on the board will be on.
  3. Make sure no other software is occupying the PUART port connected to your PC currently. To be more specific, PUART is the COM port other than the COM port WICED Smart IDE is used to program the board. For example, COM4 and COM5 are the two ports connected to my PC from my TAG4 and COM5 is the HCI UART port. So I'm going to use COM4 in the following sequences as PUART and close all other TTY terminals which are trying to occupy COM4 and show traces before I go to the next step.
  4. Copy the newest compiled ota file uart_firmware_upgrade-BCM920737TAG_Q32-rom-ram-Wiced-release.ota.bin to the folder WsUartFu. The file is generated in '<WICED-Smart-SDK-2.2.3>\WICED-Smart-SDK\build\uart_firmware_upgrade-BCM920737TAG_Q32-rom-ram-Wiced-release' and the folder is placed in '<WICED-Smart-SDK-2.2.3>\WICED-Smart-SDK\Apps\uart_firmware_upgrade\peerapps\Windows\WsUartFu'.
  5. (Optional) You can reboot the board now to make sure the board always works steadily and robustly. After reboot, the red LED should always be on again, which indicates the application is loaded and running. If no, the chip might stall and pending in download mode. If you tried many times to reboot the board by pressing the RST button, only to see no red LED on, you can now verify the SW6 DIP switches and make sure switch 2 is off. To completely ensure that, you can pull all switches in SW6 DIP to off, to disable all functions of HCI UART, which pins will be tested during boot period and might cause the chip trapped into download mode accidentally.
  6. Now your board is running, with the red LED on. Give it 5 seconds to get everything initiated. Then open a CMD window, goto the WsUartFu directory, and type the commands to upgrade the chip as the following screenshot shows. The chip will be correctly OTAed and the success message will be shown in the CMD window.
    pastedImage_1.png
  7. After the OTA procedure, the board will reboot and the red LED will be temporary off and then on again. To show the robustness of it, you can OTA the chip again and again (but make sure to OTA it after the red LED is on every time). The OTA procedure will end up successfully each time and the board will reboot and recover as always. See the screenshot below:
    pastedImage_3.png

-------------------------------------------------------------------------

Q2:

The "ModusToolbox WICED Firmware Upgrade Library" document and its library is provided in WICED STUDIO, not WICED Smart. The upgrade APIs on WICED Smart side is listed in '<WICED-Smart-SDK-2.2.3>\WICED-Smart-SDK\Wiced-Smart\bleapp\utils\bleappfwu.h' instead, without docs fully describing it. So this document is provided to you only as reference, not guidance, since they share the same flow and procedure..

-------------------------------------------------------------------------

Hope the information is helpful to you. And thanks for bearing with me patiently and kindly.

<<<<<<<<<<<<<>>>>>>>>>>>>>

Sincere regards from​ C. L.

<<<<<<<<<<<<<>>>>>>>>>>>>>

Dear CL,

Thank you very much for verifying the uart_firmware_upgrade example and for providing the instructions for the necessary code changes and the steps to get it working. I will follow your instructions and see if I can obtain a good result during the next day or two.

Best regards

0 Likes

Hi,

Sorry but I have to withdraw / rephrase what I said.

In further research, it's confirmed that TAG4 normally needs external memory to store and load program to RAM.

If no external memory is attached, then TAG4 will go into and stalls in Download Mode. In this case, if you still want to load program (without external memory), you can manually interact with TAG4 via HCI UART port, using WICED HCI commands to get your program transmitted through HCI UART port and loaded to RAM.

Just like what MiniDriver will do, and please refer to "Downloading the Application to RAM" in the following documentation:

https://www.cypress.com/design-guides/wiced-hci-uart-control-protocol

But this case needs a lot of work of modification, and the demo uart_firmware_upgrade wasn't designed to work like that so I withdraw what I said and you have to figure it out yourself.

To be more specific, If you didn't want to use external memory, you didn't need to mind UPGRADE / FW_UPDATE / OTA features at all because no programs are stored in the chip. Just reboot the board and make sure you send the newest program to RAM via HCI UART every time you reboot it, and then you will get the newest program running.

<<<<<<<<<<<<<>>>>>>>>>>>>>

Sincere regards from​ C. L.

<<<<<<<<<<<<<>>>>>>>>>>>>>

0 Likes