PSoC5LP :Transition of USB FS component to suspend mode in Bootloader processing

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

cross mob
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Hi,

We are configuring PSoC5LP with Dual-application Bootloader.

In other words, Bootloader and Application (Bootloadable) projects are separated.

In the Bootloader program,

After calling USBFS_CheckActivity() in the CY_ISR() function using the timer interrupt,

Suspending the USB FS component and putting the system into sleep mode.

Are there any problems with the above procedure and operation?

We would like to reduce the amount of processing in the CY_ISR() function that is the interrupt processing,

When the CyBtldr_Start() function is called,

the loop processing of the automatically generated program will be executed,

and control will not return from the function, so the above processing is performed.

Is there any other way to temporarily return control after calling the CyBtldr_Start() function.

pastedImage_0.png

The red letters in the above flow chart correspond to the flow.

Regards,

0 Likes
1 Solution
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello MaMi_1205306

It is possible to perform interrupt processing.

I tried creating a Bootloader project and performed a task by triggering the interrupt after calling the Bootloader_Start function. I had configured my Bootloader to wait forever.

The project was working properly for me. So there should be no issue with the steps mentioned by you in your first response.

Are you facing any issues while running your project?

Best Regards

Ekta

View solution in original post

0 Likes
4 Replies
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello MaMi_1205306

As you have correctly mentioned that the Bootloader_Start() function does not return. Thus it is not possible to check for the USB activity in the main function once the Bootloader_Start is called.

The method and steps suggested by to check the activity of USB in the Timer_ISR seems to be correct. I tried triggering the Timer interrupt after calling the bootloader_start and it is working for me.

Can you please let me know by dual application bootloader do you mean one bootloader Project and two application projects (two bootloadable projects) or are you referring to the classic bootloader application which consists of one bootloader project and one bootloadable project?

Are you using the USBFS component only as a communiation interface while bootloading?

In case you are using the dual bootloader application and USBFS component is used only for communication then you can use the Launcher project instead. It has a bootloader project that is defined through incorporation of a Bootloader component without a communication component. The Bootloader only performs the switching function. The applications can update each other. The applications are allocated an equal amount of flash space.

Please refer to the Bootloader/Bootloadable datasheet for more information on this: https://www.cypress.com/documentation/component-datasheets/bootloader-and-bootloadable

Please let me know if you have further queries related to this.

Best Regards

Ekta

0 Likes
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Ekta-san,

Thank you for you response.

Dual Bootloader consists of one Bootloader and two Bootloadables.

When Bootloader is running,

We are using the USBFS component as an interface for data communication.

Dual-application, even if one Bootloadble is damaged,

It is used by assuming that the other bootloadble will start after switching.

We do not consider updating the firmware of one Bootloadble while it is running.

As a basic operation,

While the Bootloader is running, it is configured not only to rewrite the firmware in the Bootloadable area but also to update the EEPROM data via USB from the host GUI application.

After the Bootloader_Start() API is called,

Is it not recommended to perform other interrupt processing?

Regards,

0 Likes
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello MaMi_1205306

It is possible to perform interrupt processing.

I tried creating a Bootloader project and performed a task by triggering the interrupt after calling the Bootloader_Start function. I had configured my Bootloader to wait forever.

The project was working properly for me. So there should be no issue with the steps mentioned by you in your first response.

Are you facing any issues while running your project?

Best Regards

Ekta

0 Likes
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Hi,

We are considering two interrupt actions after calling Bootloader_Start().

One is a timer interrupt,

The other is GPIO interrupt by UART.

After calling the CyBtldr_Start function,

UART reception cannot be performed in the CY_ISR function executed by the timer interrupt.

Before the CyBtldr_Start function is called, data can be received from the UART by the same processing.

When the interrupt priority of UART RX and TX is set to the highest priority (priority 0),

UART reception is now possible.

for that reason,

We are wondering what to do with the priority of interrupts in Bootloader_Start.

If the interrupt during Bootloader_Start is okay,

Make sure to design only the priority.

However, why during Bootloader_Start,

UART interrupt is not enabled at timer interrupt,

Before Bootloader_Start,

We don't know if UART interrupt is enabled during timer interrupt.

Regards,

0 Likes