Hello Jose,
Based on information I received from our LIN Stack SW team:
It seems like you have problems with receive and transmit the diagnostic frames (0x3C and 0x3D) with SDK LIN stack driver. However it looks like you are receiving and transmitting the diagnostic frames incorrectly.
Can you provide more information:
the .ldf file or the configuration files, diagnostic frames that want to receive and transmit.
I would like to share some information about diagnostic frame when the device is a slave node.
Receiving: The slave node only receive the diagnostic request(0x3D) contain correctly data or ld_receive_message() was called before.
e.g.: Assign NAD service request.

- Transmitting: The slave node will provide response to slave response frame (0x3D) when it receives a diagnostic request correctly or the ld_send_message() has been called before.
e.g.: Assign NAD service response.

Please check the following:
1. Make sure that ld_init() has been called before you use the transport layer.
2. Defined the UDS with correct SID.
3. Data length of UDS frame needs to be less than max message length that has been configured.
I have an example to implement the UDS frame base on SDK LIN stack release 4.0.2
1. On S32DS:
- Choose diagnostic class 3
- Set the max message length corresponding.
- Tick to use and configured UDS

2. The configuration files are generated
- lin_cfg.c

- Lin_cfg.h

3. This is the example code to implement the UDS frame:
l_u8 req_data[106] = {0};
ld_init(LI0);
l_ifc_init(LI0);
/* Infinite loop */
for (; ; )
{
#if (SUPPORT_PROTOCOL_21 == 1)
/* Set max message length before receive message */
length = 106;
ld_receive_message(LI0,&length, &nad, req_data);
#endif
#if (SUPPORT_DIAG_CLASS_III == 1)
if(diag_get_flag(LI0, LI0_DIAGSRV_USER_TL_ORDER))
/*Option 1*/
{
diag_clear_flag(LI0, LI0_DIAGSRV_USER_TL_ORDER);
req_data[0] += 0x40;
/* Send response 17 data bytes */
ld_send_message(LI0, 17,nad, req_data);
}
#endif
}
One more thing about the S32DS configuration.
Please tick on Use Transport Layer and Support Diagnostic Service as below:

Thank you,
Regards,
Daniel