Enable CAN for MCUs with CAN-FD controller

This commit is contained in:
Martin Jäger
2021-02-04 17:28:52 +01:00
parent a352d6b98c
commit fec60aacbb
5 changed files with 7 additions and 15 deletions
-3
View File
@@ -216,8 +216,6 @@
};
};
/*
// This requires https://github.com/zephyrproject-rtos/zephyr/pull/22832
&can1 {
pinctrl-0 = <&fdcan1_rx_pa11 &fdcan1_tx_pa12>;
bus-speed = <250000>;
@@ -228,4 +226,3 @@
sample-point-data = <875>;
status = "okay";
};
*/
@@ -62,9 +62,8 @@ CONFIG_I2C=y
CONFIG_EEPROM=y
CONFIG_EEPROM_AT24=y
# don't enable CAN by default until PR #22832 is merged to upstream Zephyr
#CONFIG_CAN=y
#CONFIG_THINGSET_CAN=y
CONFIG_CAN=y
CONFIG_THINGSET_CAN=y
CONFIG_ISOTP=y
CONFIG_ISOTP_RX_BUF_COUNT=1
-3
View File
@@ -188,8 +188,6 @@
};
};
/*
// This requires https://github.com/zephyrproject-rtos/zephyr/pull/22832
&can1 {
pinctrl-0 = <&fdcan1_rx_pa11 &fdcan1_tx_pa12>;
bus-speed = <250000>;
@@ -200,4 +198,3 @@
sample-point-data = <875>;
status = "okay";
};
*/
@@ -61,9 +61,8 @@ CONFIG_I2C_1=y
CONFIG_EEPROM=y
CONFIG_EEPROM_AT24=y
# don't enable CAN by default until PR #22832 is merged to upstream Zephyr
#CONFIG_CAN=y
#CONFIG_THINGSET_CAN=y
CONFIG_CAN=y
CONFIG_THINGSET_CAN=y
CONFIG_ISOTP=y
CONFIG_ISOTP_RX_BUF_COUNT=1
+3 -3
View File
@@ -55,7 +55,7 @@ struct isotp_recv_ctx recv_ctx;
void send_complette_cb(int error_nr, void *arg)
{
ARG_UNUSED(arg);
LOG_DBG("TX complete cb [%d]", error_nr);
LOG_DBG("TX complete callback, err: %d", error_nr);
}
void can_rx_thread()
@@ -63,8 +63,8 @@ void can_rx_thread()
int ret, rem_len;
unsigned int received_len;
struct net_buf *buf;
static u8_t rx_buffer[100];
static u8_t tx_buffer[500];
static uint8_t rx_buffer[100];
static uint8_t tx_buffer[500];
// CAN node ID retrieved from EEPROM --> reset necessary after change via ThingSet serial
rx_addr.ext_id = ts_can_node_id << 8;