Control By Design

電子硬體、嵌入式韌體與控制系統;以目的為導向的設計

English 中文

CAN 匯流排產品

CAN 匯流排產品線:韌體函式庫、透過 CAN 的安全韌體更新,以及 CAN 資料記錄。

韌體函式庫

UDS

實作以下標準的框架:

OBD-II 是 UDS 的子集,專門針對排氣(排放)測試。

ISOTP

實作 ISO 15765-2 ISO 傳輸層協定

ISOTP 層允許在固定 8 位元組的 CAN 訊息上傳送較長的訊息;它負責將訊息拆分成區塊,再重新組合成完整的訊息。

使用範例

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);
	}
}

安全韌體更新器

Bin 檔 → 加密 Bin → 編程器 → CAN(UDS + ISOTP)→ MCU(晶片內解密)

bootloader 開發期間比對快閃記憶體寫入的螢幕截圖

比對 bootloader 開發期間快閃記憶體寫入的影像

CAN 記錄器

MFTS 產品範例記錄資料的 Log Viewer 圖表

MFTS 產品的範例記錄資料

獨立嵌入式編程器