- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi guys,
I am using CE220959:
CE220959 – PSoC 6 MCU Bluetooth Low Energy (BLE) Device Firmware Update (DFU) with External Memory
How to reset the PSP/MSP (process/master stack pointers) mode in this PSoC6 bootloader?
Please point me to the exact line of code
Thanks
Ben
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In cmsis_gcc.h, you find:
__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack)
{
__ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : );
}
and
__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack)
{
__ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : );
}
In cy_dfu.c, Cy_DFU_SwitchToApp, which is called by CY_DFU_OnResetApp0, switches to App1 by calling SwitchToApp. This function writes to the MSP register.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Could you please clarify, why do you want to reset PSP and MSP in CE220959?
Thanks and Regards,
Sudheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
the bootloader of this testcase does not work.
We have been trying for weeks to make this bootloader work on external memory.
We have a violation like this one:
CM4 FAULT!!
SCB->CFSR = 0x00020000
r0 = 0x00000000
r1 = 0x08047784
r2 = 0x00000001
r3 = 0x00000113
r12 = 0x100c8248
lr = 0xfffffff1
pc = 0x08047800
psr = 0x40000040
The ARM CM4 documentation states that this usually a result of missing to reset PSP/MSP once APP0 gives control to APP1
Hope this clarifies
Thanks
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sudheesh,
any feedback on this?
Thanks and Regards,
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In cmsis_gcc.h, you find:
__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack)
{
__ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : );
}
and
__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack)
{
__ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : );
}
In cy_dfu.c, Cy_DFU_SwitchToApp, which is called by CY_DFU_OnResetApp0, switches to App1 by calling SwitchToApp. This function writes to the MSP register.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much for your feedback Rudolfo. I will check and comment.