作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2020, Vol. 46 ›› Issue (3): 192-197. doi: 10.19678/j.issn.1000-3428.0054506

• 体系结构与软件技术 • 上一篇    下一篇

VxWorks系统下CAN驱动的设计与优化

尹加豹, 朱涛, 崔凯华   

  1. 江苏自动化研究所, 江苏 连云港 222061
  • 收稿日期:2019-04-04 修回日期:2019-06-21 发布日期:2019-06-29
  • 作者简介:尹加豹(1986-),男,工程师、硕士,主研方向为嵌入式驱动开发;朱涛、崔凯华,工程师、硕士。
  • 基金资助:
    "十三五"全军共用信息系统装备专用技术预先研究项目(31511020401)。

Design and Optimization of CAN Driver Under VxWorks

YIN Jiabao, ZHU Tao, CUI Kaihua   

  1. Jiangsu Automation Research Institute, Lianyungang, Jiangsu 222061, China
  • Received:2019-04-04 Revised:2019-06-21 Published:2019-06-29

摘要: 为在VxWorks系统下实现龙芯3A3000主板的控制器局域网(CAN)总线通信,采用SJA1000T设计基于PCI总线的8通道CAN通信板,并提出相应的驱动设计和优化方案。对龙芯3A3000处理器的驱动进行优化,在发送数据时禁用CAN而使用查询方式发送,在接收数据时中断服务程序对所有通道进行遍历查询,以提高中断利用率,在创建设备函数时根据PCI总线信息识别每个CAN通信板,以确保系统中不同CAN通道拥有唯一的通道号。实验结果表明,该驱动方案运行稳定,数据传输安全可靠,经优化后能够有效降低CAN通信板的中断次数,提高CAN总线的通信速率,避免多板环境下故障板卡干扰正常板卡,提高了系统的健壮性。

关键词: VxWorks系统, 控制器局域网总线, SJA1000T控制器, 龙芯3A, 驱动设计

Abstract: In order to realize the Controller Area Network(CAN) bus communication of Loongson 3A3000 motherboard under VxWorks,an eight-channel CAN communication board based on PCI bus is designed by using SJA1000T,and the corresponding driver design and optimization scheme are proposed.The design optimizes the driver of the Loongson 3A3000 processor by disabling CAN and using the query mode to send data,and traversing all channels in the interrupt service routine when receiving data,so as to improve the utilization of interrupts.When creating a device function,each CAN communication board is identified based on the PCI bus information to ensure that different CAN channels in the system have their unique channel numbers.Experimental results show that the driving scheme runs stably,and the data transmission is safe and reliable.After optimization,it can effectively reduce the number of interrupts of the CAN communication board,improve the communication speed of CAN bus,and prevent the normal board from the interference of failing boards in a multi-board environment,which improves the robustness of the system.

Key words: VxWorks, Controller Area Network(CAN) bus, SJA1000T controller, Loongson 3A, driver design

中图分类号: