In the DSPS software of DA14580, do the software reset use the code shown below. But it doesn't work.
Who can help me to find the reason.
void Start_run_user_application(void);
__asm void sw_reset(void);
/**
****************************************************************************************
* @brief sw reset
****************************************************************************************
*/
__asm void sw_reset(void)
{
LDR r0,=0x20000000
LDR r1,[r0,#0]
MOV sp,r1
LDR r2,[r0,#4]
BX r2
}
/**
****************************************************************************************
* @brief Run the user application after receiving a binany from uart or reading the binary from a non volatile memory booting
****************************************************************************************
*/
void Start_run_user_application(void)
{
volatile unsigned short tmp;
if (*(volatile unsigned*)0x20000000 & 0x20000000)
{
tmp = GetWord16(SYS_CTRL_REG);
tmp&=~0x0003;
SetWord16(SYS_CTRL_REG,tmp);
sw_reset();
}
tmp = GetWord16(SYS_CTRL_REG);
tmp|=0x8000;
SetWord16(SYS_CTRL_REG,tmp);
}
Hi bonjior,
Try using this function for reset: void platform_reset();
Thanks MT_dialog
Thank you.
The code is downloaded into the sys ram, use the function plaform_reset can jump the code entry?
Hi bonjior,
platform_reset后系统会跳转到the boot rom code.
Thanks MT_dialog