Tool/software: TI-RTOS
Some info: I am using BIOS 5.42.2.10 for C5517, only using it for memory map handling and SWI/HWI configuration (and LOG) - I am not using Tasks, and trying to remove any dependency on BIOS generally.
Hi - I have been using a CLK timer using the tcf file :
bios.CLK.create("SysTick");
bios.CLK.instance("SysTick").order = 1;
bios.CLK.instance("SysTick").fxn = prog.extern("CLK_TimerTick");
However, I noticed that the BIOS handles this by hooking a _CLK_Dispatch call to the HW_INT_4, and some point in there it decides to call CLK_TimerTick().
I was assuming this was called in HWI context (at the priority of the HW_INT_4 interrupt).
However, I noticed that if I do SWI_Post() to a very low priority task (to manage some background behaviour) when I breakpoint in this SWI Handler context, the TINT interrupt is disabled (more often than not).
I am expecting that if I run SWI_Post() from a HWI context, although the interrupt is disabled in the HWI, it should be re-enabled on exit, and when the SWI is handled it should be enabled (as described in DSP BIOS User Guide).
This causes big problems - I am expecting the Timer interrupt to be enabled in these SWI contexts, and used to deal with bus lock up scenarios - but as TINT is disabled, sometimes the system hangs.
I decided to disable the CLK and PRD function in the BIOS:
bios.PRD.USECLK = 0;
bios.CLK.ENABLECLK = 0;
This removes the CLK_dispatch call from HWI_IN4, and I can manage this myself now, handling the TINT enable, etc.
However - it seems the BIOS is still affecting how the TINT enable is being set, as TINT is still disabled in the SWI's.
I noticed that if I prevent main() from completing (by adding in a while(1){} in the main() after BIOS_Start()), this behaviour does not occur, and TINT stays enabled consistently in the SWI contexts.
I presumed this may be that in the IDL_Loop the BIOS is doing something to manipulate this interrupt, even though CLK is disabled.
(By the way, I am not using any IDL functions, and turned off any features that create IDL functions (real time analysis, etc))
I can't see where this is happening, as I don't have visibility of the source? Can you tell me what is going on here?
Also - if I continue to use the while(1) {} loop so main() never completes, is there any drawback issue with this?