I'm trying to make my aux gauge display a little more flexible, which means going a little deeper with diagnostic modes to get more detailed data.
I can poll OBD2 data no problem, ISOTP works just fine... But when I open a channel and try to poll KWP2k data, I can get the first data set fine, but the ECU is tossing extra CAN frames and then disconnect me:
200h 7 01h C0h 00h 10h 00h 03h 01h // Request channel setup (module 01h, RX CAN ID 300h)
201h 7 00h D0h 00h 03h 40h 07h 01h // Response channel setup (module 01h, RX CAN ID 300h, TX CAN ID 740h)
740h 6 A0h 0Fh 8Ah FFh 32h FFh // Request timing parameters
300h 6 A1h 0Fh 8Ah FFh 4Ah FFh // Response timing parameters
740h 5 10h 00h 02h 10h 89h // startDiagnosticSession (param 89h)
300h 1 B1h // ECU Acknowledge
300h 5 10h 00h 02h 50h 89h // startDiagnosticSession positive response
740h 1 B1h // Tester Acknowledge
740h 5 11h 00h 02h 21h 01h // readDataByLocalIdentifier (parameter 01h)
300h 1 B2h // ECU Acknowledge
300h 8 21h 00h 1Ah 61h 01h 01h 73h 00h // More packets to follow, no ack, KWP2k data (positive response to readDataByLocalId)
300h 8 22h 27h 46h 00h 64h 50h 00h 05h // More packets to follow, no ack.
300h 8 23h 09h 80h 25h 02h 7Ah 25h 00h // More packets to follow, no ack.
300h 8 14h 00h 25h 00h 00h 25h 00h 00h // Last packet, expecting ack.
740h 1 B2h // Tester Acknowledge
300h 8 22h 27h 46h 00h 64h 50h 00h 05h // Repeat second packet
300h 8 14h 00h 25h 00h 00h 25h 00h 00h // Repeat third packet
300h 8 14h 00h 25h 00h 00h 25h 00h 00h // Repeat third packet
300h 8 14h 00h 25h 00h 00h 25h 00h 00h // Repeat third packet
300h 1 A8h // ECU disconnects
I'm sending data exactly how the docs say, it's also identical to how VCDS is doing it. I just don't get why I get a proper data block, then some junk and then disconnected.
I get this on both my Teensy 3.1 and STM32F429 discovery boards, so I'm pretty sure it's nothing hardware or a CAN driver issue.
Any ideas?