Thank you for quick test and response.
As per our R&D standards in the embedded team we make sure all the PINs must have configured to desired state, so this pin PTD3(FTM3_CH5) is not used and hence configured as "PORT_PIN_DISABLED".
For testing we removed this the array and there is no change in the behavior.
In current implementation we are good with Input Capture on Duel Edge by connecting only PTD2(FTM3_CH4) and PTD3(FTM3_CH5) to Ground.
We planning to have Encoder signal connected to both PTD2(FTM3_CH4) and PTD3(FTM3_CH5), if required we will use GPIO Interrupt on edges to compute the ON/OFF time of encoder (as a backup).
When we have PTD3(FTM3_CH5) connected to the Encoder Signal though we configured or not this PRD2 in the pins mux randomly (with in one hour execution 10 times) we are hitting "FTM_DRV_InputCaptureHandler" and at that time we are seeing error_count is incrementing (below code add in the "FTM_DRV_InputCaptureHandler" for testing):
// Toggle the Pin PORT-E10 upon CH4 and CH5 Timer counts are same.
if (first_event_time == second_event_time){
error_count++;
if (toggle_sp0){
toggle_sp0 = false;
PTD->PCOR |= 1<<28;
}else{
toggle_sp0 = true;
PTD->PSOR |= 1<<28;
}
}
Same is not hitting when we are not connected this PTD3(FTM3_CH5) for 24hrs of execution.
As per the Reference manual PTD3(FTM3_CH5) will be ignored, but that is not the case here.
We need NXP thoughts on this PTD3(FTM3_CH5) encoder signal connected with pin not configured in recommended or not.
Also find the attached waveform:

CH4 and CH5 are Encoder Signal, INT is GPIO Toggle and TRIGGER is Error Toggle in the "FTM_DRV_InputCaptureHandler".
Here is the modified "FTM_DRV_InputCaptureHandler" code:
static void FTM_DRV_InputCaptureHandler(uint32_t instance,
uint8_t channelPair)
{
DEV_ASSERT(instance < FTM_INSTANCE_COUNT);
DEV_ASSERT(channelPair < (FEATURE_FTM_CHANNEL_COUNT >> 1U));
ftm_state_t * state = ftmStatePtr[instance];
FTM_Type * ftmBase = g_ftmBase[instance];
uint8_t channel = (uint8_t)(channelPair << 1U);
// Toggle Pin PORT-D24 upon interrupt (Named INT in the capture)
if (toggle_sp1){
toggle_sp1 = false;
PTB->PCOR |= 1<<16;
}else{
toggle_sp1 = true;
PTB->PSOR |= 1<<16;
}
/* Verify the mode for current pair of channels */
if (FTM_DRV_GetDualEdgeCaptureBit(ftmBase, channelPair))
{
/* Dual edge input capture case */
uint16_t first_event_time = FTM_DRV_GetChnCountVal(ftmBase, channel);
uint16_t second_event_time = FTM_DRV_GetChnCountVal(ftmBase, (uint8_t)(channel + 1U));
if (second_event_time <= first_event_time)
{
/* Measurement when overflow occurred */
state->measurementResults[channel] = (uint16_t)(second_event_time + (FTM_DRV_GetMod(ftmBase) - first_event_time));
}
else
{
/* Measurement when overflow doesn't occurred */
state->measurementResults[channel] = (uint16_t)(second_event_time - first_event_time);
}
/* Clear flags for channels n and n+1 */
FTM_DRV_ClearChnEventFlag(ftmBase, channel);
FTM_DRV_ClearChnEventFlag(ftmBase, (uint8_t)(channel + 1U));
// Toggle the Pin PORT-E10 upon CH4 and CH5 Timer counts are same.
// Named TIGGER in the Capture
if (first_event_time == second_event_time){
error_count++;
if (toggle_sp0){
toggle_sp0 = false;
PTD->PCOR |= 1<<28;
}else{
toggle_sp0 = true;
PTD->PSOR |= 1<<28;
}
}
encoder_val[encoder_index++] = state->measurementResults[channel];
if (encoder_index >= ENCODER_ARRAY_MAX){ encoder_index = 0U;}
}
else
{
/* To get the channel interrupt source the both channels flag must be checked */
if (false == FTM_DRV_HasChnEventOccurred(ftmBase, channel))
{
channel++;
}
/* Get the time stamp of the event */
state->measurementResults[channel] = FTM_DRV_GetChnCountVal(ftmBase, channel);
/* Clear the flag for C(n+1) channel */
FTM_DRV_ClearChnEventFlag(ftmBase, channel);
}
/* If the callback is defined to use it */
if (((state->channelsCallbacks[channel]) != NULL) && (state->enableNotification[channel] == true))
{
state->channelsCallbacks[channel](IC_EVENT_MEASUREMENT_COMPLETE, state->channelsCallbacksParams[channel]);
}
}
Pratap Metharamitta