CySoftwareReset when OTA firmware upgrade completed

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

cross mob
FaBi_2763241
Level 4
Level 4
10 likes given 5 likes given First like received

Dear all

I performed an OTA firmware upgrade with CY8C4248LQI-BL583 and CYBL11573-56LQXI using the BLE Pioneer kit and all went okay, at the end the BLE unit reset and started advertising. I did the same with the same project code using a CYBLE-214009-00 module on a custom pcb: it performed the OTA successfully but it did not reset, so I have to reset it with a reset button.

It seems it doesn't get to CySoftwareReset()?

Regards

Fausto

0 Likes
1 Solution

Update for the issue of reverting to application when in bootloader mode before performing the OTA upgrade:

it actually works okay either toggling the user switch or after a timeout of inactivity.

In the function void TimeoutImplementation()defined in the ota_optional.c for the upgradable stack project, I decreased the SWITCHING_TIMEOUT constant down to 170 and gave a 1000ms delay for the SW2_S_Read(). Now it's more apparent that if inactive it reverts back to the application in about 1min 30sec; previously it seems to remain in bootloader mode indefinitely. I hope this could help somebody else too doing an upgradable stack OTA.

View solution in original post

0 Likes
18 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello ,

Can you verify if the Bootloader Host has sent the "Exit Bootloader 0x3B" command.

Thanks,

Hima

0 Likes
lock attach
Attachments are accessible only for community members.

Hello,

attached are two logs performing OTA with dongle cysmart:

same firmware image, on the cybl11573-56lqxi the reset at the end goes okay, on the cyble214009-00 it doesn't even though the upgrade is completed. same happens using the android app.

Thanks.

Fausto

0 Likes

Can you please double check on the chip. Can you try programming a simple firmware with BLE and check if the device is working fine. This is just to confirm if it is a hardware issue.

Thanks,

Hima

0 Likes
lock attach
Attachments are accessible only for community members.

Hello,

yes the device cyble214009-00 responds to all events in my firmware as it does on the cybl11573-56lqxi on the Pioneer board.

The module cyble214009-00 is mounted on a custom pcb.

I attach the schematic of the custom unit.

Thank you.

0 Likes

Can you run the bootloader in debug mode and check if it hits the exit bootloader  0x3B command.

Thanks,

Hima

Hello,

in my configuration I am using the SWD pins P0[6] and P0[7] as GPIO for the SPI component; I suspect this doesn't allow for SWD debugging but only programming the chip?

0 Likes
Anonymous
Not applicable

If you tried to debug, then the GPIO pin declarations would conflict with the SWD debug pins and cause the debugger to crash (at the very least), so not. You can't debug if you are using the SWD pins for GPIO. But you should still be able to program it.

In fact I program it without a problem. When I designed the board I needed to route the  SPI sclk and found only the P0[7]

that could be available and had to share it with the programming header...

I will think twice next time before using those pins as GPIO again.

0 Likes

An update: I checked if the CYBLE-214009-00 really got updated with a new firmware after performing the OTA.

Despite the process seems complete either using the dongle or the app (except for the auto-reset at the end), it doesn't actually load the updated application. When I resume the advertising by manual reset, it still runs the old firmware.

That is why it doesn't reset as it should. But the OTA seems to end without warnings.

Shall I unchecked Application Validation in the bootloader component?

0 Likes
lock attach
Attachments are accessible only for community members.

It did not make difference with Application Validation unchecked. I attach the log file for the last OTA.

0 Likes
Anonymous
Not applicable

There are different types of OTA updates, see here: http://www.cypress.com/file/198301/download

External Memory, Fixed Stack, Upgradeable Stack

0 Likes

I have chosen the external fram method when I designed my board, and it could be that the cause of problem I encounter.

I am going to adapt the firmware to fixed stack OTA or the third option if any can work in my case...

0 Likes
Anonymous
Not applicable

It sounds like most of the bootload update is working, and an external fram update solution is possible (others on here have done so). You would just need to step through what is going wrong and find the problem, but checking that you are applying the update method correctly with one of the other two methods should help with understanding.

0 Likes
lock attach
Attachments are accessible only for community members.

I am adapting my application with the  OTA upgradable stack and testing on evaluation kit (CY8C4248LQI-BL583.

It works, but I need a freedom to switch back to the bootloadable application (either on reset switch or user switch), when I am in the bootloader stack and decide not to proceed with the upgrade. Currently one can restart the application only completing the upgrade process, but what if the user for some reason decide to not continue with the process of upgrade? it will always launch the bootloader again and again.

Is there an API that could force reverting to the bootloadable application either with user switch or reset switch when running the main loop of bootloader stack?

By the way: in the Topdesign under the Switch component, the note says it should be possible to re-launch the application if I understand correct.

0 Likes

...just tried the upgradable stack OTA on my custom CYBLE214009-00 board and it is working correctly.

This point at some issue with the FRAM circuit, which read 2.65v.

0 Likes
Anonymous
Not applicable

I would suspect there is an API to cancel the update, but I don't know.

There is a thread mentioning custom bootloader commands added/remove/replaced here: Modify, add or delete bootloader commands.

Edit: Reading the android source code for the cysmart OTA app, the command EXIT_BOOTLOADER has data value 0x3B. I think if you send the command 0x3B then the bootloader will exit bootload mode?

I will look into that.

thank you.

0 Likes

Update for the issue of reverting to application when in bootloader mode before performing the OTA upgrade:

it actually works okay either toggling the user switch or after a timeout of inactivity.

In the function void TimeoutImplementation()defined in the ota_optional.c for the upgradable stack project, I decreased the SWITCHING_TIMEOUT constant down to 170 and gave a 1000ms delay for the SW2_S_Read(). Now it's more apparent that if inactive it reverts back to the application in about 1min 30sec; previously it seems to remain in bootloader mode indefinitely. I hope this could help somebody else too doing an upgradable stack OTA.

0 Likes