Control By Design

Electronic Hardware, Embedded Firmware and Control Systems; Design with Intent

English 中文

CAN BUS Products

CAN BUS product line: firmware libraries, secure over-CAN firmware updates, and CAN data logging.

Firmware Libraries

UDS

Implements the framework for:

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)

Screenshot comparing flash writes during the bootloader development

Image comparing flash writes during the bootloader development

CAN Logger

Log Viewer plot of sample logged data for the MFTS product

Sample logged data for MFTS product

Standalone Embedded Programmer