diff --git a/arch/arm/src/stm32l4/Kconfig b/arch/arm/src/stm32l4/Kconfig index d43d96475d..366fe539a1 100644 --- a/arch/arm/src/stm32l4/Kconfig +++ b/arch/arm/src/stm32l4/Kconfig @@ -886,5 +886,4 @@ config CAN_TSEG2 The number of CAN time quanta in segment 2. Default: 7 endmenu - endif # ARCH_CHIP_STM32L4 diff --git a/arch/arm/src/stm32l4/stm32l4_can.c b/arch/arm/src/stm32l4/stm32l4_can.c index b199525fcb..81efb677d2 100644 --- a/arch/arm/src/stm32l4/stm32l4_can.c +++ b/arch/arm/src/stm32l4/stm32l4_can.c @@ -59,7 +59,6 @@ #include "up_internal.h" #include "up_arch.h" - #include "chip.h" #include "stm32l4.h" #include "stm32l4_can.h" @@ -69,6 +68,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Delays *******************************************************************/ /* Time out for INAK bit */ @@ -313,7 +313,6 @@ static uint32_t can_getfreg(struct stm32l4_can_s *priv, int offset) #ifdef CONFIG_CAN_REGDEBUG static void can_vputreg(uint32_t addr, uint32_t value) { - /* Show the register value being written */ lldbg("%08x<-%08x\n", addr, value); @@ -592,6 +591,7 @@ static int can_setup(FAR struct can_dev_s *dev) canlldbg("CAN%d filter initialization failed: %d\n", priv->port, ret); return ret; } + can_dumpfiltregs(priv, "After filter initialization"); /* Attach the CAN RX FIFO 0 interrupt and TX interrupts. The others are not used */ @@ -688,6 +688,7 @@ static void can_rxint(FAR struct can_dev_s *dev, bool enable) { regval &= ~CAN_IER_FMPIE0; } + can_putreg(priv, STM32L4_CAN_IER_OFFSET, regval); } @@ -880,6 +881,7 @@ static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) } } } + can_putreg(priv, STM32L4_CAN_TDLR_OFFSET(txmb), regval); regval = 0; @@ -906,6 +908,7 @@ static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) } } } + can_putreg(priv, STM32L4_CAN_TDHR_OFFSET(txmb), regval); /* Enable the transmit mailbox empty interrupt (may already be enabled) */ @@ -952,6 +955,7 @@ static bool can_txready(FAR struct can_dev_s *dev) { return true; } + return false; } @@ -987,6 +991,7 @@ static bool can_txempty(FAR struct can_dev_s *dev) { return true; } + return false; } @@ -1288,6 +1293,7 @@ static int can_bittiming(struct stm32l4_can_s *priv) ts1 = (tmp - 1) >> 1; ts2 = tmp - ts1 - 1; + if (ts1 == ts2 && ts1 > 1 && ts2 < CAN_BTR_TSEG2_MAX) { ts1--; @@ -1439,6 +1445,7 @@ static int can_cellinit(struct stm32l4_can_s *priv) canlldbg("ERROR: Timed out waiting to exit initialization mode: %08x\n", regval); return -ETIMEDOUT; } + return OK; } @@ -1589,4 +1596,3 @@ FAR struct can_dev_s *stm32l4_caninitialize(int port) } #endif /* CONFIG_CAN && (CONFIG_STM32L4_CAN1 || CONFIG_STM32L4_CAN2) */ - diff --git a/arch/arm/src/stm32l4/stm32l4_can.h b/arch/arm/src/stm32l4/stm32l4_can.h index 740913f2a5..f9dad5d89f 100644 --- a/arch/arm/src/stm32l4/stm32l4_can.h +++ b/arch/arm/src/stm32l4/stm32l4_can.h @@ -54,6 +54,7 @@ /************************************************************************************ * Pre-processor Definitions ************************************************************************************/ + /* Configuration ********************************************************************/ /* Up to 1 CAN interfaces are supported */ diff --git a/configs/nucleo-144/README.txt b/configs/nucleo-144/README.txt index f87f421a75..2e08a08469 100644 --- a/configs/nucleo-144/README.txt +++ b/configs/nucleo-144/README.txt @@ -58,7 +58,7 @@ Common Board Features: provide a ST-Link for programming, debug similar to the OpenOcd FTDI function - USB to JTAG front-end. - Expansion I/F ST Zio and Extended Ardino and Morpho Headers + Expansion I/F: ST Zio and Extended Ardino and Morpho Headers Nucleo F746ZG =============