Thread 中讨论的其他器件:CODECOMPOSER
工具与软件:
是否有办法在调试会话暂停时启用 CAN 外设?
我将 通过 DSS 编写单元测试、我想让测试脚本暂停应用、写入 CAN msg、然后手动调用应用的 CAN RX 中断:
# get the current location where DSSUtils paused (at end of initialization() called from stdby_Init())
curLocation = self.__class__.dss_utils.debug_session.memory.readRegister("PC")
# send a valid NOP cmd
msgt = ntcanfd.CanMsgT()
msgt.id11 = 0x018
msgt.set_data8_len(8)
msgt.set_data8_byte(0x11, 0x0, 0x0, 0x13, 0x88, 0xFF, 0xFF, 0x0)
# send CAN message in background
result = self.can_net1.can_send(msgt)
# invoke the CAN RX interrupt to make the application receive the CAN msg
self.__class__.dss_utils.debug_session.memory.writeRegister("PC", CAN_rx_isr_start_address)
bp = self.__class__.dss_utils.debug_session.breakpoint.add(CAN_rx_isr_end_address)
self.__class__.dss_utils.debug_session.target.run()
self.__class__.dss_utils.debug_session.breakpoint.remove(bp)
# go back to the previous location (end of initialization())
self.__class__.dss_utils.debug_session.memory.writeRegister("PC", curLocation)
# continue to the end of stdby_Init
bp = self.__class__.dss_utils.debug_session.breakpoint.add(stdby_Init_end_address)
self.__class__.dss_utils.debug_session.target.run()
self.__class__.dss_utils.debug_session.breakpoint.remove(bp)
然而、只要调试会话暂停、就不会传输 CAN 消息(我将使用外部工具 ESD 的 CANReal 监控所有 CAN 流量)。
如果不暂停应用程序、而是让它在后台运行(通过 debug_session.target.runAsynch ())、则 CAN 消息将成功传输。
谢谢你




