1
\$\begingroup\$

Here it is mentioned that the controller will be in a logical sleep state?

If the hardware doesn't support this sleep mode, then how will this logical sleep state be achieved? What is meant by logical sleep state?

enter image description here

Source: AUTOSAR: Specification of CAN Driver

\$\endgroup\$
4
  • 1
    \$\begingroup\$ Welcome to StackOverflow! Please take the tour to learn how this site works, and read "How to Ask". Then come back and edit your question to clarify, do not post comments, this is not a forum. -- Where is this requirement from? What controller do you mean? Did you ask the author of the requirement? If not, why not? The source documents should also define the terms "sleep mode", "SLEEP state", "logical SLEEP state" (I don't see "logical sleep mode" in the requirement), and "STOPPED state". If it does not, did you complain? If not, why not? \$\endgroup\$ Commented Sep 20, 2023 at 5:43
  • 1
    \$\begingroup\$ It's actually a good question. \$\endgroup\$
    – Velvet
    Commented Sep 20, 2023 at 6:31
  • \$\begingroup\$ Except the kind of applications where you find CAN are typically not extreme low current-consumption ones, but rather high integrity ones. \$\endgroup\$
    – Lundin
    Commented Sep 20, 2023 at 7:01
  • \$\begingroup\$ this is actually answered by reading the paragraph before your current paragraph closely! \$\endgroup\$ Commented Sep 20, 2023 at 9:58

1 Answer 1

1
\$\begingroup\$

Source: AUTOSAR: Specification of CAN Driver

So this describes how a driver should behave towards the software using it.

Then that whole paragraph makes sense:

Your document (read it from the beginning) explicitly demands that your driver represents a state machine with the UNINIT, STOPPED, STARTED and SLEEP.

The sentence before the sentence that you cropped out is just as important:

[SWS_Can_00257] ⌈ When the CAN hardware supports sleep mode and is triggered to transition into SLEEP state, the Can module shall set the controller to the SLEEP state from which the hardware can be woken over CAN Bus.⌋ (SRS_SPAL_12067)

So, clearly, when the hardware supports a sleep state, there's a way of leaving that SLEEP state to the STARTED state, when the hardware receives a waking event from the bus.

Now, if the hardware doesn't support it, what are the possible state transitions?

SWS_Can_00258] ⌈ When the CAN hardware does not support sleep mode and is triggered to transition into SLEEP state, the Can module shall emulate a logical SLEEP state from which it returns only, when it is triggered by software to transition into STOPPED state.⌋ ()

So, in that case, there's no way to wake up the CAN through hardware, and the only possible state transition that can be done in software is to STOPPED.

Pretty straightforward! If it helps, draw yourself a finite state machine diagram (excerpt) for this. The only arrow between SLEEP and STARTED is a hardware wakeup, and there's an arrow from SLEEP to STOPPED which can be walked through a software command.

\$\endgroup\$
3
  • \$\begingroup\$ Thank you for your time. But I still didn't understand what they meant by logical sleep state and it is mentioned that if hardware doesn't support it it will emulate a logical sleep state. So how are they achieving this sleep state? \$\endgroup\$
    – SUPERPIE
    Commented Sep 20, 2023 at 11:17
  • 1
    \$\begingroup\$ there's nothing about "achieving" it. Your driver needs to represent a state machine. You simply change into the state called "SLEEP". It's a state of the driver, not the hardware! \$\endgroup\$ Commented Sep 20, 2023 at 11:24
  • 1
    \$\begingroup\$ A CAN transceiver in a true sleep state does not participate in CAN communication (i.e. ACK-ing). What this AUTOSAR manual describes as "emulating a logical sleep state" isn't emulating anything. It is just an instruction for a workaround. \$\endgroup\$
    – Velvet
    Commented Sep 20, 2023 at 11:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.