Is it possible to generate a warm reset through software?
Also, is there any difference between what happens with a warm reset and a jump (via a software call) to the reset vector?
Thanks,
Richard
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Is it possible to generate a warm reset through software?
Also, is there any difference between what happens with a warm reset and a jump (via a software call) to the reset vector?
Thanks,
Richard
Richard,
First, can you tell me on which device you are using.
On TMS570 devices, to generate a warm reset by software, you have to access the SYSECR Register (System Exception Control Register) in the system module.
This register is mapped at the following address:
0xFFFF_FFE0.
Read access will not cause a reset.
Bit 15 and 14 should read 0
Any write to these bits other than "01" will cause a software reset.
The CPU will jump back to the reset vector, and all internal modules will be back to their reset condition.
In your Reset Routine, it is possible to figure out if you are starting from a cold or warm reset.
The SYSESR Register (System Exception Status Register) located at 0xFFFF_FFE4 will inform you about the root cause of the reset.
Please let me know if this will answer your question.
Regards,
Jean-Marc
Hi Jean-Marc,
Thanks for your help (I can confirm that we are using the TMS570) - I will try this and let you know if it does what we expect.
Do you know the answer to the second part of my question which was is there is a difference between a warm reset and a jump to the reset vector at address 0?
Thanks,
Richard
I have been trawling through the Technical Reference Manual a bit more and table 3-1 on page 36 shows the way in which the TMS570 can be reset.
So another way to reset the processor in software is to use the MMUGCR register.
What is less clear is how registers and memory are set following a reset. Is there some documentation that describes what is preserved and what is modified for the various types of reset?
Also on page 237 a list of registers that should be preserved following a CPU reset during self test is provided. Can these be stored anywhere in TMS570 memory or must external memory be provided to hold this data?
Thanks,
Richard
Hello Richard,
The external nPORRST clears almost every register. Usually if a register or a register bit is not cleared is documented in the respective register description. For example there might be certain bits which indicate why a certain reset happened and those need to be maintained for analysis by the application.
You are correct that you could also generate a reset via the MMUGCR register, but this only resets the Cortex-R4 CPU and nothing else in the system. Generating a reset via the SYSECR register will reset almost everything (except the bits which are only reset by nPORRST). This is similar to pulling the nRST signal low.
Memory is usually not reset and maintains the previous state. The only exception is that we cannot guarantee the state of the memory when a nPORRST happens. Since this reset is asynchronous, it could happen while a write operation to a RAM takes place and could disrupt this operation. We can't guarantee what will happen if this write is not finished correctly. All other resets are synchronous and there is not problem with the RAM content.
If you want to preserve the CPU registers before for example running LBIST (STC) on the CPU, then this can be safely done in the internal RAM and after the LBIST completed these registers can be reloaded again.
Please let us know if you have more questions.
Regards
Frank
Hi Frank,
Thanks for the comprehensive answer. I think this answers all my questions.
Regards,
Richard
Hello Jean-Marc,
I'm new in the use of this MCU and read the post and I tested a little code with an instruction to reset the TMS570 but I have two problems in my program.
The main function of the program in my MCU is sent each minute a frame in the serial port 1, the secondary function receives a command in serial port 2 and one of this command should be an instruction to reset the MCU. This part work fine, but I add in this day the instruction to reset the microcontroller according in this post of the forum: "e2e.ti.com/.../400558"
To use this instruction I needed to add the header file: #include "HL_reg_system.h" but when I add and compiled the program not present any problems during this process, but when I run the program in the MCU, the device no send more frames to the serial port 1. I don't know what is the reason for this situation because I only add a header file and the MCU do the same.
Could you say me or guide me to do the best process to reset the system?
Thanks