i filed to following bug into ASF bugzilla. Maybe this infos helps some guys struggling with CAN using ASF3.1.3:
can_tx in can.c does not clear dlc before setting a new one. Since CANIF_mob_set_dlc does only _or_ the new value, this leads to wrong dlc set.
Solution: add a CANIF_mob_clr_dlc before set: