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.
Tool/software:
Hello TI expert,
I want to trigger a ITRAP, and use the below method in the main loop.
Define a pointer and point to a illegal address, then write and read the value of it.
But I did not enter into any interrupt.
Is something wrong with my method?
volatile uint32_t *TestOverRangePoint = (uint32_t *)0xFFFFFFFF;
volatile uint32_t TestData = 0;
for (;;)
{
*TestOverRangePoint = 0x01;
TestData = *TestOverRangePoint;
}
Another question is that I want to write the handler for ITRAP.
Does TI provide the example that how to record the return address value on the stack in the ITRAP handler?
Hi W Z,
Please refer to the C28 CPU guide- https://www.ti.com/lit/ug/spru430f/spru430f.pdf section 3.6 and 3.5.2
Easiest way would to execute TRAP #19 instruction that corresponds to ITRAP
Thanks.
Thanks for your help. It is really the easiest way to execute TRAP #19
void trigger_trap19() {
asm(" TRAP #19 ");
}
Could you please help check the below question?
Is something wrong with my method?
I want to test that access to an invaild memory, then enter into the illegal interrupt.
volatile uint32_t *TestOverRangePoint = (uint32_t *)0xFFFFFFFF;
volatile uint32_t TestData = 0;
for (;;)
{
*TestOverRangePoint = 0x01;
TestData = *TestOverRangePoint;
}
Hi WZ,
I want to test that access to an invaild memory, then enter into the illegal interrupt.
Can you point to the reference document for the statement above ?
From C28x Guide I only see the below source for ITRAP:
Thanks
The first one, invalid addressing mode. Is there document that clarify more inforamtion about invalid instruction, and when the opcode value is 0x0000 and 0xFFFF
WZ,
That's is Illegal value read from program memory during an instruction fetch.
Illegal OPCODE fetch values are 0000, FFFF, or any value that does not match a defined opcode.
Thanks.
I cannot understand, what is illegal value read from program memory. Could you please show an example?
Got your OPCODE define. But When do the normal coding, how can bring in a not defined opcode?
WZ,
In a case where you start executing from memory which has either all 0000 or FFFF unintentionally then you may end up getting ITRAP
Here is a scenario explained in this e2e : https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1313506/tms320f28335-28335-illegal-instruction-execution-problem/4992071#4992071
Thanks