How to create callback from bootloader on PSoC 4?

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

cross mob
JoWi_3984961
Level 4
Level 4
First like received First like given

This code in the bootloader seems to make defining a callback macro for new commands for the bootloader difficult:

#if ((CYDEV_PROJ_TYPE != CYDEV_PROJ_TYPE_LAUNCHER) && (!CY_PSOC3))

/**

*  This variable holds the pointer on the user's callback-function that implements the custom

*  bootloader command processing.

*/

static Bootloader_callback_type Bootloader_callback = NULL;

#endif /*(CYDEV_PROJ_TYPE != CYDEV_PROJ_TYPE_LAUNCHER) && (!CY_PSOC3)*/

Using the standard bootloader, one appication to load, on the PSoC 4, the variable Bootloader_callback is set to the NULL function pointer.

This means I cannot set it to point to my code.

Why is this done?  I wish to define new commands for the bootloader on the PSoC 4, and I THOUGHT callback macros was the way to go, until I see the above code.

This code appears in bootloader.c, target is PSoC4, and it is generated code, so I modify it at my peril.

What gives?

0 Likes
1 Solution
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Please refer section Bootloader_Callback in Bootloader component datasheet.

View solution in original post

0 Likes
4 Replies
JoWi_3984961
Level 4
Level 4
First like received First like given

never mind. I get it!

GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Please refer section Bootloader_Callback in Bootloader component datasheet.

0 Likes

I have better way

0 Likes

Hi,

Could you share your method with the community. It might help other users facing the same problem.

0 Likes