Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN,
Tool/software:
This is a continuation of the previous thread that has been locked.
I've found that the HALCoGen generated port macro portYIELD_WITHIN_API does not properly yield. My interpretation of the TRM is that writing the proper key to the SSIR register will trigger the corresponding software interrupt (default mapped to vPortYeildWithinAPI) immediately. However, in practice, I find that writing the register only causes the interrupt to be taken after an unspecified number of clock cycles.
In the attached sample project, I've inserted two assembly breakpoints: one at the end of portYIELD_WITHIN_API, and one at the beginning of vPortYeildWithinAPI. If the interrupt is taken, then the breakpoint in vPortYeildWithinAPI will trigger. If not, the one in portYIELD_WITHIN_API will trigger.
main simply enables interrupts and then makes a call to portYIELD_WITHIN_API;
As is, the breakpoint at the end of portYIELD_WITHIN_API is (incorrectly) triggering.
I can "fix" the problem by adding some contrived delay in the portYIELD_WITHIN_API- either by inserting NOPs, additional ISB/DSB, or a read of a register. That is, this causes the BKPT in the interrupt to be hit (correct):
As does this: