AUTOSAR Special Project - Practical Issues: Sleep Problems Caused by Multi-channel CAN Configuration

1. Problem background

        In previous projects, a CAN channel has been used; recently, due to changes in the vehicle topology, a new subnet CAN has been added, and this CAN does not support wake-up, but needs to relay network management messages.

       After importing DBC, I clicked through the vector tool to generate code. I went down to the board and saw that there was a problem. The system does not sleep, and the current is always around 300mA after the message transmission is stopped. What is the reason for this?

2. Problem location

        According to our previous introduction to mode management, we know that MCU sleep is mainly controlled by BswM and EcuM. First, the state of BswM needs to be switched. According to the AUTOSAR special project - BswM state analysis, we know that during normal operation, BswM is in the RUN state, and to sleep, it needs to be switched from RUN->POST_RUN->PRE-SHUTDOWN->WAIT_FOR_NVM->SLEEP , finally transfer control to EcuM, and EcuM chooses to enter Go Halt/Poll.

        Obviously, the system does not sleep, so we can only start with the state migration of BswM. First, break the point at the ActionList entry of each state after RUN, execute it in a single step, and finally find that BswM does not enter the NormalSleep state, as follows:

        Obviously, the if condition in the above code is not satisfied, so this

Guess you like

Origin blog.csdn.net/djkeyzx/article/details/131652713