Unable to perform software reset in TC367

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

cross mob
varunr_4926966
Level 1
Level 1
5 sign-ins First reply posted First like given

Hello,

I am using Aurix TC367 for a motor drive application. The memory is divided to 3 partitions. 1) Boot Manager 2) Bootloader and 3) Application.  During a power ON reset, Boot Manager will be in control and it decides to jump to application or bootloader. I did the initial development using the TC397 development board. I tested the jump from Bootmanager to Bootloader and Application successfully.

Everything seems to work properly but when I perform a software reset from the bootloader using the instruction MODULE_SCU.SWRSTCON.B.SWRSTREQ = 1; the software ends up in a trap. 

What could be the reason for this behavior. Please note that I am attempting the reset from the Bootloader where control reaches bootloader from boot manager. I am fairly new to this microcontroller, my doubt is do we need to perform any steps before jumping to a different image, in this case, a jump from boot manager to bootloader. I know that in ARM Cortex series, we need to initialize the stack and vectors before jumping. Do we need to do any kind of stuff in this microcontoller. Please help,

 

BR,

Varun

0 Likes
3 Replies
Nambi
Moderator
Moderator
Moderator
50 likes received 5 likes given 100 solutions authored

Hi,

1. You can refer to the ADS example "CPU_Trap_Recognition_1_KIT_TC397_TFT"  to find the details of the TRAP encountered at your end.

2. You can check if the access mode "SV,E,P0" for the register SWRSTCON is followed when writing to it.

3. What is the value of the bit "RSTCON.SW"? You can try configuring different values like Application reset and System reset and let us know the observation.

4. Are you testing with or without a debugger?
If testing with the debugger, you can trigger a conditional reset(e.g., Trigger reset on a pin press) and test without the debugger and check.

5. Is the reset successful, and does program execution enter the trap after reset? or Is the rest itself unsuccessful?
Can you configure the ESR pin as output and observe the same when the software reset is triggered? This is to differentiate if the reset was triggered and the code gets stuck in the next boot or the reset itself is not triggered correctly.

Best Regards.

I am using Lauterbach with trace 32. I managed to do the soft reset work. But it is unreliable. I encountered a strange behavior. 

In the below code, if I comment the Fbl_Init() function, the reset works. This Fbl_Init is a dummy function only. I don't understand what difference does it make when I simply add an empty function.

varunr_4926966_0-1672319596068.png

Please see the code for performing the reset

/* This function triggers either a SW Application Reset or a SW System Reset, based on the parameter resetType */
void triggerSwReset(IfxScuRcu_ResetType resetType)
{
/* Get the CPU EndInit password */
uint16 passwd = Ifx_Ssw_getCpuWatchdogPasswordInline(&MODULE_SCU.WDTCPU[0]); /* Configured only for Core0 for now */

/* Configure the request trigger in the Reset Configuration Register */
IfxScuRcu_configureResetRequestTrigger(IfxScuRcu_Trigger_sw, resetType);

/* Clear CPU EndInit protection to write in the SWRSTCON register of SCU */
Ifx_Ssw_clearCpuEndinitInline(&MODULE_SCU.WDTCPU[0], passwd);
/* Trigger a software reset based on the configuration of RSTCON register */
MODULE_SCU.SWRSTCON.B.SWRSTREQ = 1;

/* Wait till reset */
while (1)
{}

/* The following instructions are not executed if a SW reset occurs */
/* Set CPU EndInit protection */
Ifx_Ssw_setCpuEndinitInline(&MODULE_SCU.WDTCPU[0], passwd);
}

void core0_main(void)
{

uint32 CoreCount = 0xFFFFFFFF;

Fbl_Init();
/* Should never come here*/
while(TestCount < 1000)
{
TestCount++;
CoreCount--;
Fbl_WaitForTick();
}
delay(150000);
CoreCount = 0;

triggerSwReset(IfxScuRcu_ResetType_application);

while(1);
}

 

 

 

0 Likes
Nambi
Moderator
Moderator
Moderator
50 likes received 5 likes given 100 solutions authored

Hi,

1. What is the definition of Fbl_Init()?

2. Fbl_Init();
/* Should never come here*/
while(TestCount < 1000)

What does the comment "/* Should never come here*/" mean here?

3. What is the behavior when "Fbl_Init()" remains uncommented? Where does the code execution reach?

4. What is the behavior without the debugger attached?

Best Regards.

0 Likes