psoc4100s jump to app

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

cross mob
mjt_4825471
Level 1
Level 1
10 sign-ins 5 questions asked 5 sign-ins

I made the bootloader project without using bootloader and bootloadable component. And I want jump form bootloader to the app . I changed the link file of app.

CY_APPL_ORIGIN = 0x5000;

I tried to jump to the reset vector of app(0x5010) .It doesn' t  work.Shoud I add a function to change the isr table vector ?

In addition, is there an API  to erase flash  except "CySysFlashWriteRow"?

 

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello @mjt_4825471 ,

At startup, the bootloader code loads configuration bytes for its own configuration. It must also initialize the stack and other resources as well as peripherals to do the transfer. When the transfer is complete, control is passed to the bootloadable project with a software reset.

The bootloadable project then loads configuration bytes for its own configuration and reinitializes the stack and other resources and peripherals for its functions. 

What I'm trying to convey here is when you want to shift from one application to another, you need to reinitialize the stack and other resources and peripherals. You cannot jump to the reset vector of another app without doing this. 

Please look at this code example. You will notice that in the linker script the start addresses will be defined for both the bootloader and bootloadable. A value gets written to flash to set the active application in the bootloader.c file and then reset. Based on this active application, the reset vectors, vector table etc.. get stored in the region allocated for the particular application in flash after software reset. 

So, going through the linker script, the way the bootloader.c file is written, should give you an idea of how you can implement it in your own way.

No, there is no API to erase flash specifically because calling CySysFlashWriteRow erases the flash and writes whatever data is passed to it. You can use this API to write 0x00 to the rows to emulate an erase. 

Hope this helps 🙂

Regards,
Dheeraj

View solution in original post

0 Likes
1 Reply
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello @mjt_4825471 ,

At startup, the bootloader code loads configuration bytes for its own configuration. It must also initialize the stack and other resources as well as peripherals to do the transfer. When the transfer is complete, control is passed to the bootloadable project with a software reset.

The bootloadable project then loads configuration bytes for its own configuration and reinitializes the stack and other resources and peripherals for its functions. 

What I'm trying to convey here is when you want to shift from one application to another, you need to reinitialize the stack and other resources and peripherals. You cannot jump to the reset vector of another app without doing this. 

Please look at this code example. You will notice that in the linker script the start addresses will be defined for both the bootloader and bootloadable. A value gets written to flash to set the active application in the bootloader.c file and then reset. Based on this active application, the reset vectors, vector table etc.. get stored in the region allocated for the particular application in flash after software reset. 

So, going through the linker script, the way the bootloader.c file is written, should give you an idea of how you can implement it in your own way.

No, there is no API to erase flash specifically because calling CySysFlashWriteRow erases the flash and writes whatever data is passed to it. You can use this API to write 0x00 to the rows to emulate an erase. 

Hope this helps 🙂

Regards,
Dheeraj

0 Likes