2022-01-18 10:58 PM
Hi,
I am working on SPC58NG84E7 bootloader.
Everything works fine - I have BL code(at 0xFC0000) which jumps to the APP location 0xFD0000 after waiting for 10sec after startup and executes the code there. Both codes are without SWT.
Issue - But when I added SWT component to BL, on powerOn BL is not running. swt_lld_stop() is called before jump.
If I start the BL through UDE debugger application it executes BL, jumps to APP, executes APP code, but then reset from APP and entering into BL is not working.
This issue remains in APP with SWT and without SWT both.
What could be the issue here?
Regards,
AM
2022-01-20 04:57 AM
Hi Olivier,
I already have added the callback function and also stopped the SWT before jump.
Thanks & Regards,
AVM
2022-01-20 05:02 AM
Hi Olivier,
when you say:
"on powerOn BL is not running", it means -
When I flash the BL code, disconnect the debugger and reset hw, that time BL doesn't run.
But when I flash the BL code, start the code through debugger, BL runs correctly and jumps also.
SWT is activated on BL only.
Thanks & Regards,
AVM
2022-01-20 07:36 AM
Could you try to Erase your complete Flash
Flash again your program BL and APP (check there is no recovery between them with addresses and sizes)
Boot your board without debugger
Regards,
-Olivier
2022-01-21 04:16 AM
Hi Olivier,
I am erasing complete flash before programming BL and APP every time.
What do you exactly mean by - 'no recovery between them with addresses and sizes'?
Thanks & Regards,
AVM
2022-01-21 04:52 AM
Hello,
I meant if your BL is at address1 and APP at address2 > address1
then the size of program BL must be less than (address2-address1)
No overlap between BL and APP in flash memory
BRs,
-Olivier
2022-01-21 04:56 AM
Hi Olivier,
These things are verified.
There is no overlap between BL and APP.
Thanks & Regards,
AVM
2022-01-24 01:21 AM
Hello,
would you please test with this modified interrupt function in swt_lld.c:
static void swt_interrupt_handler(SWTDriver *swtp)
{
/* Acknowledge the interrupt, no bit field access on TIF */
swtp->swtp->IR.R = 1;
/* Protection in case of swt_lld_stop */
if (swtp->swt_config == NULL) {
return;
}
/* call the callback, if set */
if (swtp->swt_config->callback != NULL) {
swtp->swt_config->callback(swtp);
}
}
Best Regards,
-Olivier
2022-01-24 01:24 AM
Do you use only 1 SWT device or several ones ?
Could you test with Time period 40000 or greater to let time to your APP to boot ?
2022-01-24 07:43 AM
Hello,
I think I found the root cause of your issue: you probably unchecked the from platform component->runtime settings
you need to check it again:would you please check it and confirm me it works fine again ?
Regards,
-Olivier
2022-01-27 11:52 PM
Hello,
is it fixed ?
Best Regards,
-Olivier