I'm working with the IPU/M4 core of the DRA744 processor. I'm running Green Hills RTOS called uVelosity and building the binary & debugging with the Green Hills tool chain.
The M4 processor is used to marshal data back and forth to the A15 which is running Linux. Under Linux device tree we use /memreserve/ to block off a section of physical memory to which we load the M4 image into, set up the various M4 registers and kick it off.
The MMUs on the J6 are setup such that the M4 executes out of L3 DDR memory that was /memreserved/.
The problem is that after running for a few minutes, we throw a fault and get a run-time error that has alluded us for some time now. Since the M4 has no MPU and no processor trace, this is very difficult to track down and the Green Hills debugger is not revealing any useful information. Static analysis on our code base is not producing anything useful either.
I'm highly suspicious that, somehow, Linux might be corrupting L3-DDR memory despite the /memreserve/. I've not been able to prove this. The Green Hills tools have a way to read back memory and at least when we read back the .text segment, it checks out (no memory corruption).
Question: Is there an in-circuit-emulator we can purchase or one that Ti can recommend to help track things down? I'm looking for help on tools and type of hardware socket I would need to get specified for our circuit boards.
Are there any debug tools or suggestions Ti can suggest to help try to track down?
Another issue I ran into that I believe has been solved but could use some Ti expert to chime in:
The TI docs do not really explain it. This has to do with an implementation dependent feature of the ARMv7-M (i.e., Cortex-M4) architecture. (And “implementation” in this case is TI’s implementation – specifically the SPI peripheral.)
During a SPI Tx sequence, three SPI interrupts are enabled. When the ISR runs, it sees which SPI interrupts are active and services them. It also clears the corresponding active bit(s.) However, it clears the bits in two steps – first for the Rx & Tx status bits, and then for the EOW (End of Word Count) bit. The problem is, when clearing any of these bits, if others are still active (and enabled), the result is that the CM4 NVIC sees a new interrupt event, even though later on the additional active bit is cleared. (By that time it’s too late because the interrupt event has already been latched in the CM4 NVIC.) So, when the ISR leaves, the SPI interrupt is still pending, as far as the CM4 NVIC is concerned, so it immediately invokes the ISR again. This time, however, the source bits are cleared and disabled, so they don’t cause yet another interrupt event. (Note that the NVIC automatically clears a pending interrupt on ISR entry. The trouble is that the ISR was causing an additional, accidental interrupt event to the NVIC.)
So, the fix is to clear the active bits all at once, instead of partially in multiple steps, per ISR invocation.
Thanks for your time!
Best,
Eric Mayo