From 3a17a5dbf6da14ed835f7014d26ad145872483f1 Mon Sep 17 00:00:00 2001 From: Roman PASSLER Date: Thu, 13 Jun 2024 10:06:15 +0200 Subject: [PATCH] bms-c1 v0.4: Fix CAN sending by deactivating RS485 transceiver When using CAN, it is necessary to deactivate the RS485 transceiver. This commit sets the DE and RE_NOT pins to the correct states to deactivate the transceiver as described in chapter "9.4 Device Functional Modes" in the "SN65HVD7x 3.3-V Supply RS-485 With IEC ESD protection" datasheet. --- boards/riscv/bms_c1/bms_c1_0_4_0.overlay | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/boards/riscv/bms_c1/bms_c1_0_4_0.overlay b/boards/riscv/bms_c1/bms_c1_0_4_0.overlay index 37c2077a..dca810e0 100644 --- a/boards/riscv/bms_c1/bms_c1_0_4_0.overlay +++ b/boards/riscv/bms_c1/bms_c1_0_4_0.overlay @@ -11,6 +11,14 @@ }; }; +&gpio0 { + deactivate-rs485 { + gpio-hog; + gpios = <6 GPIO_ACTIVE_HIGH>, <7 GPIO_ACTIVE_LOW>; + output-low; + }; +}; + &pinctrl { i2c0_default: i2c0_default { group1 {