Comments (5)
Hi,
currently no, but the stm32F0xx hardware does have a "silent mode" that does exactly that :
In Silent mode, the bxCAN is able to receive valid data frames and valid remote frames, but it sends only recessive bits on the CAN bus and it cannot start a transmission. [...] Silent mode can be used to analyze the traffic on a CAN bus without affecting it by the transmission of dominant bits (Acknowledge Bits, Error Frames).
And there is a "listen-only" flag at the kernel level :
$ ip link set can0 help
Usage: ip link set DEVICE type can
[ bitrate BITRATE [ sample-point SAMPLE-POINT] ] |
....
[ loopback { on | off } ]
[ listen-only { on | off } ]
[ triple-sampling { on | off } ]
[ one-shot { on | off } ]
[ berr-reporting { on | off } ]
[ fd { on | off } ]
[ fd-non-iso { on | off } ]
[ presume-ack { on | off } ]
...
So :
- no, firmware currently can't do it
- yes, firmware should be able to do it
from candlelight_fw.
Actually I think I was partly wrong, firmware definitely should already support silent mode :
usbd_gs_can.c:393
case GS_USB_BREQ_MODE:
..........
can_enable(ch,
(mode->flags & GS_CAN_MODE_LOOP_BACK) != 0,
(mode->flags & GS_CAN_MODE_LISTEN_ONLY) != 0,
(mode->flags & GS_CAN_MODE_ONE_SHOT) != 0
So I guess one would have to enable listen-only just before bringing interface up . Has anyone tried ?
from candlelight_fw.
I happen to have a test setup handy to try this. Seems like it's working to me FWIW.
I'm using a candleLight on one Linux machine attached to another CAN interface on another Linux machine. The bus just has those 2 devices and a terminator, nothing else.
My test sequence:
- Other CAN interface is sending things happily:
candump any,0:0,#FFFFFFFF
shows frames and no ERRORFRAMEs - Bring the candleLight device down:
sudo ip link set brtcan2 down
- Now the other device shows lots of ERRORFRAMEs in
candump any,0:0,#FFFFFFFF
- Put the candleLight device up in listen-only mode:
sudo ip link set brtcan2 type can listen-only on && sudo ip link set brtcan2 up
- Still lots of ERRORFRAMEs on the other device
- Take the candleLight device out of listen-only mode:
sudo ip link set brtcan2 down && sudo ip link set brtcan2 type can listen-only off && sudo ip link set brtcan2 up
- No more ERRORFRAMEs on the other device
from candlelight_fw.
@brian-brt awesome, thanks for testing! Do I understand correctly that with brtcan2 (candleLight) in listen-only mode, it receives the error frames ? (I'm not sure if both ends are seeing the ERRORFRAMEs or just the sender)
from candlelight_fw.
No, I didn't actually try reading frames from the candleLight device originally. Testing again, the candleLight device does not see any ERRORFRAMEs. When it's not in listen-only mode, it sees all the frames (as expected). In listen-only mode, it sees a single frame being sent repeatedly.
Receiving the non-ACKed frames is what I mentioned in #55 (comment) about listen-only implying presume-ack. I think on a "correct" listen-only device those would all be no-ACK ERRORFRAMEs.
from candlelight_fw.
Related Issues (20)
- RFC: cmake-presets to select included toolchain file by default ?
- tweak `atexit` to get rid of malloc HOT 2
- RFC : empty fifos + hardware mailboxes when re-enabling CAN ? HOT 6
- startup.c is broken - hardfault with large BSS HOT 8
- While loops in USB ISR HOT 7
- Feature: add support for `GS_CAN_FEATURE_GET_STATE` and `GS_CAN_FEATURE_BERR_REPORTING` HOT 5
- build warning: "_close is not implemented and will always fail" HOT 2
- Canable device hangs after desktop application crash (= stop without disonnecting) HOT 25
- cansequence tool shows wrong telegram order HOT 19
- Clear internal data structures holding unsent frames HOT 1
- Openmoko firmware upgrade , no jumper to enter DFU mode or button HOT 21
- About candlelight and Cangaroo HOT 2
- version for stm32F042C4xx? HOT 7
- No Can Frames recieved after device reset without a power cycle. candleLight Firmware. HOT 7
- CandleLight FD at 8 Mbps HOT 3
- CPU_FAMILY STM32G0B1XK vs. CPU_FAMILY STM32G0B1XE (not comprehensible for rookies) HOT 4
- Potential firmware / driver issue HOT 21
- Problem building firmware for STM32G0B1 HOT 11
- Problem ACK on tx error HOT 1
- CANable-MKS problem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from candlelight_fw.