Hi,
I can recommend to refer to TR1309 Application hints TJA1145 (https://www.nxp.com/documents/report/AH1309_v1_1_Application_Hints_TJA1145.pdf ) and its driver SW which can be found on https://community.nxp.com/message/936919?commentID=936919#comment-936919
BR, Petr