PSoC 4 Bootloader Dual-Application upgrade Application through cyflash is failed

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

cross mob
Yacobh
Level 3
Level 3
10 replies posted 25 sign-ins First solution authored

Hello,

The Bootloader is defined as Dual-Application.

I want to upgrade the image applications through UART and cyflash.

Upgrading of the Application1 (the valid and active) is failed with the message from cyflash:

The application is currently marked as active or golden image

Can you please advise what should I perform to upgrade the Applications in Dual-Application configuration through cyflash?

I use the product CY8C4247AZI-M485.

Thanks in advance.

Yacob.

 

0 Likes
1 Solution

Hello,

Thanks @LeoMathews for your detail explanation.

I think I  understood how to manage the Bootloader Dual-Application.

I will try it later.

Sincerely,

Yacob.

 

View solution in original post

0 Likes
12 Replies
Sidramesh_S
Moderator
Moderator
Moderator
250 sign-ins 100 replies posted 25 solutions authored

Hi @Yacobh ,

#I want to upgrade the image applications through UART and cyflash

Here what do you mean by upgrade through cyflash ?

 

Are you not using the Bootloader Host tool for upgrading the application ? If yes, we recommend using the Bootloader Host tool for upgrading the application.

 

 

Thanks and regards,

Sidramesh

0 Likes
Yacobh
Level 3
Level 3
10 replies posted 25 sign-ins First solution authored

Hello @Sidramesh_S ,

Thank you for your advise.

I want to upgrade the image application using command line without PSoC Creator.

The tool cyflash (https://github.com/arachnidlabs/cyflash) allows upgrade the image application using command line.

I used cyflash when the Bootloader was not defined as Dual-application.

Can you please advise how can I upgrade the Dual-application configuration using command line?

Sincerely,

Yacob.

0 Likes
Sidramesh_S
Moderator
Moderator
Moderator
250 sign-ins 100 replies posted 25 solutions authored

Hi @Yacobh ,

#I used cyflash when the Bootloader was not defined as Dual-application.

As per your statement, I understood you can upgrade the image application using the command line when Bootloader was defined for a single application.

Could you please provide the sequence of commands you used for upgrading the image application using the command line?

Thanks and regards,
Sidramesh

0 Likes
Yacobh
Level 3
Level 3
10 replies posted 25 sign-ins First solution authored

Hello @Sidramesh_S 

Thanks for you response.

I use the following command line:

cyflash.exe --verbose --serial COM17 --serial_baudrate 115200 --timeout 5 Controller_1.cyacd

Sincerely,

Yacob.

0 Likes
Sidramesh_S
Moderator
Moderator
Moderator
250 sign-ins 100 replies posted 25 solutions authored

Hi @Yacobh ,

Have you referred to the below document for building the Dual Application Bootloader?

Sidramesh_S_0-1711545965156.png

Thanks and regards,
Sidramesh

0 Likes
Yacobh
Level 3
Level 3
10 replies posted 25 sign-ins First solution authored

Hello @Sidramesh_S 

Thanks for your reply.

Of coarse I have referred.

How can I invalidate Application #1 to stay in bootloader?

Sincerely,

Yacob.

 

 

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @Yacobh 

Can you please clarify whether you are using different Bootloadable projects? Are you using Manual Application image placement for both the bootloadables? I believe the error "The application is currently marked as active or golden image"  occurs when you are trying to overwrite existing bootloadable image at the same location using cyflash utliliy.

LeoMathews_0-1712053470093.png

 

Thanks and Regards,
Leo

 

0 Likes
Yacobh
Level 3
Level 3
10 replies posted 25 sign-ins First solution authored

Hello all,

Thanks @LeoMathews for your reply.

How can I invalidate Application #1 to stay in bootloader?

Sincerely,

Yacob.

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @Yacobh 

I believe there is no option to invalidate an application as such. The multi-application bootloader guarantees that there is always a valid application that can be run. A Bootloadable image becomes invalid if it gets corrupted(for example undesired overwrite of that flash region or a power failure occurs during the bootloading process,i.e, when there is a checksum mismatch). Validity of the application is checked using the verify checksum command.

But you can set which of the two application must be active at a time using the "set active application" command. In Dual-application bootloader if you are using two bootloadable projects then 2 sets of cyacd files will be generated, one for the lower part of flash and one for the upper part of flash: Project_A_1.cyacd and Project_A_2.cyacd and Project_B_1.cyacd and Project_B_2.cyacd.


The .cyacd file with suffix 1 always occupies the first half of flash, and the .cyacd file with suffix 2 occupies the second half. Thus, only certain combinations of .cyacd files can be used. These combinations are:
▪ Project_A_1.cyacd and Project_A_2.cyacd
▪ Project_B_1.cyacd and Project_B_2.cyacd
▪ Project_A_1.cyacd and Project_B_2.cyacd
▪ Project_B_1.cyacd and Project_A_2.cyacd

Please note this combination while trying to bootload applications using cyflash utility.

Thanks and Regards,
Leo

0 Likes
Yacobh
Level 3
Level 3
10 replies posted 25 sign-ins First solution authored

Hello,

Thanks @LeoMathews for the explanation.

How is the command "set active application" used? through the tool "Bootloader Host" or cyflash utility or other way?

Can you please explain how two bootloadable projects with 2 sets of cyacd files help to test software upgrade with cyflash utility?

Sincerely,

Yacob.

 

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @Yacobh 

You can set the active application command within the bootloader firmware to decide which of the two images say, bootloadable1 or bootloadable2 should be active after a reset. Then the bootloader always transfer control to the activated image. For that assign application id to each images bootloadable1 with "0" and bootloadable2 with "1" in the top design of the bootloadable components as shown:

 

LeoMathews_0-1712657392492.png

Also set the Bootloader_SetActiveAppInMetadata(app ID) in the bootloader source.

 

LeoMathews_1-1712657441910.png

I believe you only can flash the images using cyflash utility tool. We cannot change the active status of any of the images within the tool. Once the bootloader in programmed, you can utilize the cyflash utlity to bootload the images with the mentioned combinations of cyacd files posted in the previous response. The utility checks the metadata for the application ID which will be set as active from the target device. After 2 images are flashed the bootloader always transfer the control to the active application on reset. But you will encounter a flash checksum failure error during flashing of active image. You can ignore the same, press reset and then try to flash the other image.

For more information please refer to Multi-Application Bootloader section in this document:
https://www.infineon.com/dgdl/Infineon-AN68272_PSoC_3_PSoC_4_PSoC_5LP_and_PSoC_Analog_Coprocessor_UA...

Thanks and Regards,
Leo

 

 

0 Likes

Hello,

Thanks @LeoMathews for your detail explanation.

I think I  understood how to manage the Bootloader Dual-Application.

I will try it later.

Sincerely,

Yacob.

 

0 Likes