I changed the repository (with correct linker scripts ) and recompiled everything.
Unfortunately, I still have the same error…
When I do not start FreeRTOS and use e.g. the polling version of the I2C driver example (as a basis for access a I2C device on my custom board), the code works correctly.
However, adding the code for the ecspi_interrupt example causes trouble again.
Some observations that may help:
- When I set a breakpoint at Reset_Handler and start debugging, the processor stops here.
Since I’m using OCRAM, the vector table is supposed to be at address 0 (m_interrupts in the linker file).
When I look at the data at address 0 and further, I see 0x00002420 and 0xD1009100 at the first two double words (initial stack pointer value and reset address). Most of the next double words are 0xF1009100: )
According to the linker file, the code should execute in a region starting at 0x00910000 (m_text region) and with the code still at the initial breakpoint, the disassembly shows indeed 0x009100d2 for the address of the next instruction.
This means that the vector table at address 0 is correct, if you read the bytes LSByte first: the second entry, 0xD1009100, corresponds to 0x009100D1 which is the address at which Reset_Handler starts plus one. Actually, all addresses in the vector table are the interrupt handler addresses + 1. I suppose this is OK ? This is the Linker map file (2.2 MB) where you can find the vector table at line 20812 and further.
So I think we can conclude that the vector table is correctly placed and initialized…
So the problem remains in port.c, prvPortStartFirstTask() which contains a number of assembly instructions and is supposed to start the first task.
One of the instructions is SVC which triggers an exception for which the vector is at the 12th long word in the vector table. It reads 0x00910371 and the map file shows 0x00910370 for “SVC_Handler”.
A search for SVC_Handler learns that there is a #define in FreeRTOSConfig.h:
#define vPortSVCHandler SVC_Handler
So in the end, I conclude that vPortSVCHandler(),. defined in port.c, should be called but setting a breakpoint at that function never results in a hit…
I hope this will give you an idea of what goes wrong ! I’m sorry for the long text…
Thanks in advance,
Jeroen
PS: I suppose the repository that you mention is the “official one” ? It would be nice to remove any reference to the other one on GitHub because it is confusing (I don’t know where I found it but it was on the Toradex site)