The coffee has not kicked in yet, but...
I took the hang from before and added more print out stuff.
So like the code I posted above, it now outputs:
Code:
PulsePositionInput::begin pin:19 idx: 9 CH:0 SC:1440 CSC:300
Select Input Regster: 401f857c 1
Select Input completed
CP1:ffff CP2:0 CAPT:0 LOAD:0
HOLD:0 CNTR:20a CTRL:3420 SCTRL:1440
CMPLD1:ffff, CMPLD2:0, FILT:0 DMA:0 ENBL:0
I then mucked with my ISR3 function as using pin 19, which is 3-0...
Code:
void PulsePositionBase::isrTimer3()
{
digitalWriteFast(2, HIGH);
static uint8_t report_count = 0;
if (report_count < 10) {
report_count++;
Serial1.printf("isrTimer3: %x %x %x %x\n ", (uint32_t)list[6], (uint32_t)list[7], (uint32_t)list[8], (uint32_t)list[9]);
for (uint8_t ch=0; ch < 4; ch++) {
Serial1.printf(" %d: %04x %04x", ch, (uint16_t)IMXRT_TMR3.CH[ch].SCTRL, (uint16_t)IMXRT_TMR3.CH[ch].CSCTRL);
}
Serial1.println();
}
if (list[6] && TimerCHInPending(&IMXRT_TMR3.CH[2])) { list[6]->isr();}
if (list[7] && TimerCHInPending(&IMXRT_TMR3.CH[3])) { list[7]->isr();}
if (list[8] && TimerCHInPending(&IMXRT_TMR3.CH[1])) { list[8]->isr();}
if (list[9] && TimerCHInPending(&IMXRT_TMR3.CH[0])) { list[9]->isr();}
asm volatile ("dsb"); // wait for clear memory barrier
digitalWriteFast(2, LOW);
}
Hooked up USB to serial adapter to pin 1, and did a Serial1.begin in setup...
Now seeing:
Code:
isrTimer3: 0 0 0 200013d0
0: 1d40 0300 1: a10b 1311 2: a10b 1311 3: a00b 1311
isrTimer3: 0 0 0 200013d0
0: 9c40 0310 1: a00b 1311 2: a00b 1311 3: a00b 1311
isrTimer3: 0 0 0 200013d0
0: 9c40 0310 1: a00b 1311 2: a00b 1311 3: a00b 1311
isrTimer3: 0 0 0 200013d0
0: 9c40 0310 1: a00b 1311 2: a00b 1311 3: a00b 1311
isrTimer3: 0 0 0 200013d0
0: 9c40 0310 1: a00b 1311 2: a00b 1311 3: a00b 1311
isrTimer3: 0 0 0 200013d0
0: 9c40 0310 1: a00b 1311 2: a00b 1311 3: a00b 1311
isrTimer3: 0 0 0 200013d0
0: 9c40 0310 1: a00b 1311 2: a00b 1311 3: a00b 1311
isrTimer3: 0 0 0 200013d0
0: 9c40 0310 1: a00b 1311 2: a00b 1311 3: a00b 1311
isrTimer3: 0 0 0 200013d0
0: 9c40 0310 1: a00b 1311 2: a00b 1311 3: a00b 1311
isrTimer3: 0 0 0 2000
And now debugging: So it shows I have list[9] with object as expected. Now
To look at the SCTRL and CSCTRL values to see which channel is actually triggering the ISR...
For CH:0 we have
SCTRL: 9c40 TCF, TOFIE, IEF IEFIE, CAPTURE_MODE(1)
CSCTRL: 0310 UP, TCF1
So I think it should trigger the input ISR?
Oops found it. 
Look at the function:
Code:
inline bool TimerCHInPending(volatile IMXRT_TMR_CH_t *tmr_ch) {
if ((tmr_ch->CSCTRL & (TMR_CSCTRL_TCF1 | TMR_CSCTRL_TCF1EN)) == (TMR_CSCTRL_TCF1 | TMR_CSCTRL_TCF1EN))
return true;
if ((tmr_ch->SCTRL & (TMR_SCTRL_TOF | TMR_SCTRL_TOFIE)) == (TMR_SCTRL_TOF | TMR_SCTRL_TOFIE))
return true;
if ((IMXRT_TMR1.CH[2].SCTRL & (TMR_SCTRL_IEF | TMR_SCTRL_IEFIE)) == (TMR_SCTRL_IEF | TMR_SCTRL_IEFIE))
return true;
return false;
}
Should be:
Code:
inline bool TimerCHInPending(volatile IMXRT_TMR_CH_t *tmr_ch) {
if ((tmr_ch->CSCTRL & (TMR_CSCTRL_TCF1 | TMR_CSCTRL_TCF1EN)) == (TMR_CSCTRL_TCF1 | TMR_CSCTRL_TCF1EN))
return true;
if ((tmr_ch->SCTRL & (TMR_SCTRL_TOF | TMR_SCTRL_TOFIE)) == (TMR_SCTRL_TOF | TMR_SCTRL_TOFIE))
return true;
if ((tmr_ch->SCTRL & (TMR_SCTRL_IEF | TMR_SCTRL_IEFIE)) == (TMR_SCTRL_IEF | TMR_SCTRL_IEFIE))
return true;
return false;
}