首页> 外国专利> Semaphore coding method to ensure data integrity in a can microcontroller and a can microcontroller that implements this method

Semaphore coding method to ensure data integrity in a can microcontroller and a can microcontroller that implements this method

机译:信号量编码方法,用于确保Can微控制器和实现该方法的Can微控制器中的数据完整性

摘要

A method for use in a CAN device (e.g., a CAN microcontroller) that includes a processor core and hardware external to the processor core (e.g., a DMA engine) that writes message data into a designated message buffer for ensuring integrity of the message data stored in the designated message buffer. The method includes providing a three-state semaphore to indicate a current access status of the designated message buffer, the three-state semaphore having a first state indicative of the hardware external to the processor core starting to write new message data into the designated message buffer, a second state indicative of the hardware external to the processor core having finished writing the new message data into the designated message buffer, and, a third state indicative of the processor core starting to read message data from the designated message buffer. The processor core determines whether the designated message buffer is ready to be accessed based on the current state of the semaphore. The processor core, after determining that the designated message buffer is ready to be accessed, reads the message data from the designated message buffer. After the processor core has finished reading the message data from the designated message buffer, it checks the current state of the semaphore to determine whether it has changed to a different state during the time that the processor core was reading the message data from the designated message buffer. If the processor core determines that the current state of the semaphore changed during the time that the processor core was reading the message data from the designated message buffer, it again determines whether the designated message buffer is ready to be accessed, based on the current state of the semaphore. After again determining that the designated message buffer is ready to be accessed, the processor core again reads the message data from the designated message buffer.
机译:一种用于CAN设备(例如CAN微控制器)的方法,该方法包括处理器内核和处理器内核外部的硬件(例如DMA引擎),该硬件将消息数据写入指定的消息缓冲区以确保消息数据的完整性存储在指定的消息缓冲区中。该方法包括提供三态信号量以指示指定消息缓冲器的当前访问状态,该三态信号量具有指示处理器内核外部的硬件的第一状态,该第一状态开始将新消息数据写入到指定消息缓冲器中。指示处理器核心外部硬件已完成将新消息数据写入指定消息缓冲区的第二状态,以及指示处理器内核开始从指定消息缓冲区读取消息数据的第三状态。处理器内核根据信号量的当前状态确定是否已准备好访问指定的消息缓冲区。在确定已准备好访问指定的消息缓冲区之后,处理器核心将从指定的消息缓冲区中读取消息数据。处理器内核完成从指定消息缓冲区中的消息数据读取之后,它检查信号量的当前状态,以确定在处理器内核从指定消息中读取消息数据期间,信号量是否已更改为其他状态。缓冲。如果处理器内核确定信号量的当前状态在处理器内核从指定消息缓冲区中读取消息数据的过程中发生了更改,则它会基于当前状态再次确定指定消息缓冲区是否准备好访问信号量。在再次确定指定的消息缓冲区已准备好访问之后,处理器内核再次从指定的消息缓冲区读取消息数据。

著录项

相似文献

  • 专利
  • 外文文献
  • 中文文献
获取专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号