CAN BUS Products
CAN BUS product line: firmware libraries, secure over-CAN firmware updates, and CAN data logging.
Firmware Libraries
- Firmware libraries for UDS, ISOTP, and firmware decryption.
- Modular libraries that are not hardware-dependent and can be imported directly into any STM32 codebase.
UDS
Implements the framework for:
- ISO 14229 Unified Diagnostic Services (UDS)
- ISO 15031 On-Board Diagnostics II (OBD-II)
OBD-II is a subset of UDS oriented specifically towards emissions-testing.
ISOTP
Implements ISO 15765-2, ISO Transport Layer Protocol
The ISOTP layer allows for transmission of longer messages over fixed 8-byte CAN messages. It handles breaking the messages up into chunks and then re-assembling them into a full message.
Example Usage
In "main.c":
#include "can_isotp.h"
#include "can_uds.h" //[OPTIONAL] if paired with "can_uds.h"
ISOTP_state_tracker ISOTP;
//Define isotp callback functions
uint8_t ISOTP_can_cb(SerBuf *isotp_frame){
APPLICATION_CAN_transmit(isotp_frame->buffer);
if(SUCCESS){ //Must return (0-1)
return 0;
}else{
return 1;
}
}
uint32_t ISOTP_timer_cb(void){
return system_time_in_milliseconds;
}
static void isotp_debug_info(SerBuf *buf){ //[OPTIONAL] If debug is needed
while (!SBUF_end_of_msg(buf)) {
APPLICATION_print_debug(SBUF_get_char(buf));
}
}
//Receive CAN data
APPLICATION_CAN_RX_CALLBACK{
uint8_t CAN_FRAME[8];
ISOTP_receive_data(&ISOTP, CAN_FRAME);
}
//Send CAN data
void APPLICATION_TX_DATA(SerBuf *buf){
ISOTP_send_data(&ISOTP, &buf);
}
void main{
ISOTP_init(&ISOTP);
//ISOTP.WAIT_FC_TIMEOUT = 250; //[OPTIONAL] Change the default ISOTP configuration settings
//ISOTP.WAIT_CF_TIMEOUT = 250; // See "can_isotp.h" for detailed definitions
//ISOTP.STmin_local = 0;
//ISOTP.blocksize_local = 0;
//ISOTP.retry_attempts = 5;
//ISOTP.retry_delay = 10;
ISOTP_register_can_cb(&ISOTP_can_cb);
ISOTP_register_timer_cb(&ISOTP_timer_cb);
ISOTP_register_data_cb(&UDS_handle_message); //Use UDS handler or APPLICATION-specific implementation
UDS_init(); //[OPTIONAL] if paired with "can_uds.h"
while(1){
[APPLICATION MAINLOOP CODE]
ISOTP_update(&ISOTP);
}
}
Secure Firmware Updater
Bin file → Encrypted Bin → Programmer → CAN (UDS + ISOTP) → MCU (in-chip decryption)
- Secure product updates delivered over the CAN bus.
- Includes a bootloader binary for in-chip decryption.
Image comparing flash writes during the bootloader development
CAN Logger
- Customizable data logging over the CAN bus using UDS.
- Small PCB with a wide input range that can be connected directly via the CAN bus.
- In-field firmware updating.
Sample logged data for MFTS product
Standalone Embedded Programmer
- Temporary solution to meet production deadlines for in-field firmware updates.