zephyr/tests/subsys
Henrik Brix Andersen 180cdc105e drivers: can: add start and stop CAN controller API functions
Up until now, the Zephyr CAN controller drivers set a default bitrate (or
timing) specified via devicetree and start the CAN controller in their
respective driver initialization functions.

This is fine for CAN nodes using only one fixed bitrate, but if the bitrate
is set by the user (e.g. via a DIP-switch or other HMI which is very
common), the CAN driver will still initialise with the default
bitrate/timing at boot and use this until the application has determined
the requested bitrate/timing and set it using
can_set_bitrate()/can_set_timing().

During this period, the CAN node will potentially destroy valid CAN frames
on the CAN bus (which is using the soon-to-be-set-by-the-application
bitrate) by sending error frames. This causes interruptions to the ongoing
CAN bus traffic when a Zephyr-based CAN node connected to the bus is
(re-)booted.

Instead, require all configuration (setting bitrate, timing, or mode) to
take place when the CAN controller is stopped. This maps nicely to entering
"reset mode" (called "configuration mode" or "freeze mode" for some CAN
controller implementations) when stopping and exiting this mode when
starting the CAN controller.

Fixes: #45304

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-09-13 16:06:50 +00:00
..
canbus/isotp drivers: can: add start and stop CAN controller API functions 2022-09-13 16:06:50 +00:00
cpp ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
debug includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
dfu tests: dfu: Switch from FIXED_AREA_ to FIXED_PARTITION_ macros 2022-09-06 09:56:37 +02:00
edac includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
emul emul: Add EMUL_DT_GET 2022-08-17 15:47:52 +00:00
fs ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
ipc/ipc_service ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
jwt test: fix more legacy #include paths 2022-08-02 16:41:41 +01:00
logging ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
mgmt tests/subsys/mgmt/mcumgr: Move tests 2022-09-12 14:15:06 +00:00
modbus modbus: add user data for adu callback 2022-09-02 10:51:57 +02:00
openthread ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
pm ztest: improve some tests 2022-09-09 07:05:38 -04:00
portability ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
rtio/rtio_api test: fix more legacy #include paths 2022-08-02 16:41:41 +01:00
sd/sdmmc includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
settings ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
shell tests: shell: add missing assert 2022-09-06 14:12:33 +00:00
storage storage/flash_map: Macros for accessing fixed-partitions 2022-09-06 09:56:37 +02:00
tracing/tracing_api tests: tracing_api: move to new ztest API 2022-09-08 10:39:10 +02:00
usb tests: subsys: usb: device: add zassert to judge whether USB enable 2022-09-02 11:23:31 +00:00