diff --git a/Kconfig b/Kconfig index 8a0289f3d3..56def76b1d 100644 --- a/Kconfig +++ b/Kconfig @@ -980,7 +980,7 @@ config DEBUG_ANALOG default n depends on ANALOG ---help--- - Enable analog devic debug features. + Enable analog device debug features. Enable low level debug features the analog device drivers such as A/D and D/A converters (disabled by default). Support for this debug option is architecture-specific and may not be available for @@ -1007,19 +1007,45 @@ config DEBUG_ANALOG_INFO default n depends on DEBUG_INFO ---help--- - Enable analog device informational output to SYSLOG. + Enable CAN driver informational output to SYSLOG. endif # DEBUG_ANALOG config DEBUG_CAN - bool "CAN Debug Output" + bool "CAN Debug Features" default n depends on CAN ---help--- - Enable CAN driver debug SYSLOG output (disabled by default). + Enable CAN driver debug features. + Support for this debug option is architecture-specific and may not be available for some MCUs. +if DEBUG_CAN + +config DEBUG_CAN_ERROR + bool "CAN Error Output" + default n + depends on DEBUG_ERROR + ---help--- + Enable CAN driver error output to SYSLOG. + +config DEBUG_CAN_WARN + bool "CAN Warnings Output" + default n + depends on DEBUG_WARN + ---help--- + Enable CAN driver warning output to SYSLOG. + +config DEBUG_CAN_INFO + bool "CAN Informational Output" + default n + depends on DEBUG_INFO + ---help--- + Enable CAN driver informational output to SYSLOG. + +endif # DEBUG_CAN + config DEBUG_GPIO bool "GPIO Debug Features" default n diff --git a/arch/arm/src/lpc11xx/Kconfig b/arch/arm/src/lpc11xx/Kconfig index 64badf0dbd..31a9711cf0 100644 --- a/arch/arm/src/lpc11xx/Kconfig +++ b/arch/arm/src/lpc11xx/Kconfig @@ -229,11 +229,11 @@ config CAN_LOOPBACK config CAN_REGDEBUG bool "Register level debug" - depends on DEBUG_FEATURES + depends on DEBUG_CAN_INFO default n ---help--- Output detailed register-level CAN debug information. Requires also - CONFIG_DEBUG_FEATURES and CONFIG_DEBUG_CAN. + CONFIG_DEBUG_CAN_INFO. endmenu diff --git a/arch/arm/src/lpc17xx/Kconfig b/arch/arm/src/lpc17xx/Kconfig index e2315fedd7..7aea897ba0 100644 --- a/arch/arm/src/lpc17xx/Kconfig +++ b/arch/arm/src/lpc17xx/Kconfig @@ -594,13 +594,13 @@ config CAN_LOOPBACK ---help--- Enable CAN loopback mode -config CAN_REGDEBUG +config LPC17_CAN_REGDEBUG bool "Register level debug" - depends on DEBUG_FEATURES + depends on DEBUG_CAN_INFO default n ---help--- Output detailed register-level CAN debug information. Requires also - CONFIG_DEBUG_FEATURES and CONFIG_DEBUG_CAN. + CONFIG_DEBUG_CAN_INFO. endmenu diff --git a/arch/arm/src/lpc17xx/lpc17_can.c b/arch/arm/src/lpc17xx/lpc17_can.c index 725a68332e..d1b66ac3b6 100644 --- a/arch/arm/src/lpc17xx/lpc17_can.c +++ b/arch/arm/src/lpc17xx/lpc17_can.c @@ -160,25 +160,8 @@ /* Debug ********************************************************************/ /* Non-standard debug that may be enabled just for testing CAN */ -#if !defined(CONFIG_DEBUG_FEATURES) || !defined(CONFIG_DEBUG_CAN) -# undef CONFIG_CAN_REGDEBUG -#endif - -#ifdef CONFIG_DEBUG_CAN -# ifdef CONFIG_CAN_REGDEBUG -# define canerr llerr -# define caninfo llinfo -# else -# define canerr err -# define caninfo info -# endif -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) +#ifndef CONFIG_DEBUG_CAN_INFO +# undef CONFIG_LPC17_CAN_REGDEBUG #endif /* Timing *******************************************************************/ @@ -203,14 +186,14 @@ struct up_dev_s ****************************************************************************/ /* CAN Register access */ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_LPC17_CAN_REGDEBUG static void can_printreg(uint32_t addr, uint32_t value); #endif static uint32_t can_getreg(struct up_dev_s *priv, int offset); static void can_putreg(struct up_dev_s *priv, int offset, uint32_t value); -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_LPC17_CAN_REGDEBUG static uint32_t can_getcommon(uint32_t addr); static void can_putcommon(uint32_t addr, uint32_t value); #else @@ -308,7 +291,7 @@ static struct can_dev_s g_can2dev = * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_LPC17_CAN_REGDEBUG static void can_printreg(uint32_t addr, uint32_t value) { static uint32_t prevaddr = 0; @@ -372,7 +355,7 @@ static void can_printreg(uint32_t addr, uint32_t value) * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_LPC17_CAN_REGDEBUG static uint32_t can_getreg(struct up_dev_s *priv, int offset) { uint32_t addr; @@ -408,7 +391,7 @@ static uint32_t can_getreg(struct up_dev_s *priv, int offset) * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_LPC17_CAN_REGDEBUG static void can_putreg(struct up_dev_s *priv, int offset, uint32_t value) { uint32_t addr = priv->base + offset; @@ -442,7 +425,7 @@ static void can_putreg(struct up_dev_s *priv, int offset, uint32_t value) * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_LPC17_CAN_REGDEBUG static uint32_t can_getcommon(uint32_t addr) { uint32_t value; @@ -470,7 +453,7 @@ static uint32_t can_getcommon(uint32_t addr) * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_LPC17_CAN_REGDEBUG static void can_putcommon(uint32_t addr, uint32_t value) { /* Show the register value being written */ @@ -553,7 +536,7 @@ static void can_reset(FAR struct can_dev_s *dev) static int can_setup(FAR struct can_dev_s *dev) { -#ifdef CONFIG_DEBUG_CAN +#ifdef CONFIG_DEBUG_CAN_INFO FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->cd_priv; #endif int ret; @@ -565,6 +548,7 @@ static int can_setup(FAR struct can_dev_s *dev) { up_enable_irq(LPC17_IRQ_CAN); } + return ret; } @@ -585,7 +569,7 @@ static int can_setup(FAR struct can_dev_s *dev) static void can_shutdown(FAR struct can_dev_s *dev) { -#ifdef CONFIG_DEBUG_CAN +#ifdef CONFIG_DEBUG_CAN_INFO FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->cd_priv; caninfo("CAN%d\n", priv->port); diff --git a/arch/arm/src/sama5/Kconfig b/arch/arm/src/sama5/Kconfig index 19ffbf0352..c2850d67e4 100644 --- a/arch/arm/src/sama5/Kconfig +++ b/arch/arm/src/sama5/Kconfig @@ -2323,11 +2323,11 @@ config SAMA5_CAN_AUTOBAUD config SAMA5_CAN_REGDEBUG bool "CAN Register level debug" - depends on DEBUG_FEATURES + depends on DEBUG_CAN_INFO default n ---help--- Output detailed register-level CAN device debug information. - Requires also CONFIG_DEBUG_FEATURES. + Requires also CONFIG_DEBUG_CAN_INFO. endmenu # CAN device driver options endif # SAMA5_CAN0 || SAMA5_CAN1 diff --git a/arch/arm/src/sama5/sam_can.c b/arch/arm/src/sama5/sam_can.c index d563f8d0f3..c09c4fd610 100644 --- a/arch/arm/src/sama5/sam_can.c +++ b/arch/arm/src/sama5/sam_can.c @@ -123,22 +123,7 @@ #define CAN_DEBUG_INTS (CAN_INT_ERRA | CAN_INT_WARN | CAN_INT_CERR | \ CAN_INT_SERR | CAN_INT_FERR | CAN_INT_BERR) -/* Debug ********************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -#if !defined(CONFIG_DEBUG_FEATURES) || !defined(CONFIG_DEBUG_CAN) +#ifndef CONFIG_DEBUG_CAN_INFO # undef CONFIG_SAMA5_CAN_REGDEBUG #endif diff --git a/arch/arm/src/samv7/Kconfig b/arch/arm/src/samv7/Kconfig index 763accea23..bbed32a7b8 100644 --- a/arch/arm/src/samv7/Kconfig +++ b/arch/arm/src/samv7/Kconfig @@ -2615,11 +2615,11 @@ endmenu # MCAN1 device driver options config SAMV7_MCAN_REGDEBUG bool "CAN Register level debug" - depends on DEBUG_FEATURES + depends on DEBUG_CAN_INFO default n ---help--- Output detailed register-level CAN device debug information. - Requires also CONFIG_DEBUG_FEATURES. + Requires also CONFIG_DEBUG_CAN_INFO. endmenu # CAN device driver options endif # SAMV7_MCAN diff --git a/arch/arm/src/samv7/sam_mcan.c b/arch/arm/src/samv7/sam_mcan.c index d02a094bdf..ab169b13af 100644 --- a/arch/arm/src/samv7/sam_mcan.c +++ b/arch/arm/src/samv7/sam_mcan.c @@ -789,28 +789,14 @@ /* Debug ********************************************************************/ /* Debug configurations that may be enabled just for testing MCAN */ -#if !defined(CONFIG_DEBUG_FEATURES) || !defined(CONFIG_DEBUG_CAN) +#ifndef CONFIG_DEBUG_CAN_INFO # undef CONFIG_SAMV7_MCAN_REGDEBUG #endif -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo - -# ifdef CONFIG_SAMV7_MCAN_REGDEBUG -# define canregerr llerr -# else -# define canregerr(x...) -# endif - +#ifdef CONFIG_SAMV7_MCAN_REGDEBUG +# define reginfo caninfo #else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -# define canregerr(x...) +# define reginfo(x...) #endif /**************************************************************************** @@ -2756,7 +2742,7 @@ static int mcan_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) } txbuffer[0] = regval; - canregerr("T0: %08x\n", regval); + reginfo("T0: %08x\n", regval); /* Format word T1: * Data Length Code (DLC) - Value from message structure @@ -2765,7 +2751,7 @@ static int mcan_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) */ txbuffer[1] = BUFFER_R1_DLC(msg->cm_hdr.ch_dlc); - canregerr("T1: %08x\n", txbuffer[1]); + reginfo("T1: %08x\n", txbuffer[1]); /* Followed by the amount of data corresponding to the DLC (T2..) */ @@ -3194,7 +3180,7 @@ static void mcan_receive(FAR struct can_dev_s *dev, FAR uint32_t *rxbuffer, /* Work R0 contains the CAN ID */ regval = *rxbuffer++; - canregerr("R0: %08x\n", regval); + reginfo("R0: %08x\n", regval); #ifdef CONFIG_CAN_ERRORS hdr.ch_error = 0; @@ -3240,7 +3226,7 @@ static void mcan_receive(FAR struct can_dev_s *dev, FAR uint32_t *rxbuffer, /* Word R1 contains the DLC and timestamp */ regval = *rxbuffer++; - canregerr("R1: %08x\n", regval); + reginfo("R1: %08x\n", regval); hdr.ch_dlc = (regval & BUFFER_R1_DLC_MASK) >> BUFFER_R1_DLC_SHIFT; diff --git a/arch/arm/src/stm32/stm32.h b/arch/arm/src/stm32/stm32.h index f52fa2cb4a..af91ea4ea6 100644 --- a/arch/arm/src/stm32/stm32.h +++ b/arch/arm/src/stm32/stm32.h @@ -53,21 +53,6 @@ * Pre-processor Definitions ************************************************************************************/ -/* Additional Configuration *********************************************************/ -/* Custom debug settings used in the STM32 port. These are managed by STM32-specific - * logic and not the common logic in include/debug.h. NOTE: Some of these also - * depend on CONFIG_DEBUG_INFO - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_DMA -# undef CONFIG_DEBUG_RTC -# undef CONFIG_DEBUG_I2C -# undef CONFIG_DEBUG_CAN -# undef CONFIG_DEBUG_PWM -# undef CONFIG_DEBUG_SENSORS -#endif - /* Peripherals **********************************************************************/ #include "chip.h" diff --git a/arch/arm/src/stm32/stm32_can.c b/arch/arm/src/stm32/stm32_can.c index 34c326cfe8..8d9de4f57b 100644 --- a/arch/arm/src/stm32/stm32_can.c +++ b/arch/arm/src/stm32/stm32_can.c @@ -81,23 +81,8 @@ #define CAN_BIT_QUANTA (CONFIG_CAN_TSEG1 + CONFIG_CAN_TSEG2 + 1) -/* Debug ********************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -#if !defined(CONFIG_DEBUG_FEATURES) || !defined(CONFIG_DEBUG_CAN) -# undef CONFIG_CAN_REGDEBUG +#ifndef CONFIG_DEBUG_CAN_INFO +# undef CONFIG_STM32_CAN_REGDEBUG #endif /**************************************************************************** @@ -127,7 +112,7 @@ static void can_putreg(FAR struct stm32_can_s *priv, int offset, uint32_t value); static void can_putfreg(FAR struct stm32_can_s *priv, int offset, uint32_t value); -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_STM32_CAN_REGDEBUG static void can_dumpctrlregs(FAR struct stm32_can_s *priv, FAR const char *msg); static void can_dumpmbregs(FAR struct stm32_can_s *priv, @@ -249,7 +234,7 @@ static struct can_dev_s g_can2dev = * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_STM32_CAN_REGDEBUG static uint32_t can_vgetreg(uint32_t addr) { static uint32_t prevaddr = 0; @@ -270,7 +255,7 @@ static uint32_t can_vgetreg(uint32_t addr) { if (count == 4) { - llerr("...\n"); + caninfo("...\n"); } return val; @@ -287,7 +272,7 @@ static uint32_t can_vgetreg(uint32_t addr) { /* Yes.. then show how many times the value repeated */ - llerr("[repeats %d more times]\n", count-3); + caninfo("[repeats %d more times]\n", count-3); } /* Save the new address, value, and count */ @@ -299,7 +284,7 @@ static uint32_t can_vgetreg(uint32_t addr) /* Show the register value read */ - llerr("%08x->%08x\n", addr, val); + caninfo("%08x->%08x\n", addr, val); return val; } @@ -343,13 +328,13 @@ static uint32_t can_getfreg(FAR struct stm32_can_s *priv, int offset) * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_STM32_CAN_REGDEBUG static void can_vputreg(uint32_t addr, uint32_t value) { /* Show the register value being written */ - llerr("%08x<-%08x\n", addr, value); + caninfo("%08x<-%08x\n", addr, value); /* Write the value */ @@ -396,34 +381,34 @@ static void can_putfreg(FAR struct stm32_can_s *priv, int offset, * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_STM32_CAN_REGDEBUG static void can_dumpctrlregs(FAR struct stm32_can_s *priv, FAR const char *msg) { if (msg) { - canllerr("Control Registers: %s\n", msg); + caninfo("Control Registers: %s\n", msg); } else { - canllerr("Control Registers:\n"); + caninfo("Control Registers:\n"); } /* CAN control and status registers */ - llerr(" MCR: %08x MSR: %08x TSR: %08x\n", - getreg32(priv->base + STM32_CAN_MCR_OFFSET), - getreg32(priv->base + STM32_CAN_MSR_OFFSET), - getreg32(priv->base + STM32_CAN_TSR_OFFSET)); + caninfo(" MCR: %08x MSR: %08x TSR: %08x\n", + getreg32(priv->base + STM32_CAN_MCR_OFFSET), + getreg32(priv->base + STM32_CAN_MSR_OFFSET), + getreg32(priv->base + STM32_CAN_TSR_OFFSET)); - llerr(" RF0R: %08x RF1R: %08x\n", - getreg32(priv->base + STM32_CAN_RF0R_OFFSET), - getreg32(priv->base + STM32_CAN_RF1R_OFFSET)); + caninfo(" RF0R: %08x RF1R: %08x\n", + getreg32(priv->base + STM32_CAN_RF0R_OFFSET), + getreg32(priv->base + STM32_CAN_RF1R_OFFSET)); - llerr(" IER: %08x ESR: %08x BTR: %08x\n", - getreg32(priv->base + STM32_CAN_IER_OFFSET), - getreg32(priv->base + STM32_CAN_ESR_OFFSET), - getreg32(priv->base + STM32_CAN_BTR_OFFSET)); + caninfo(" IER: %08x ESR: %08x BTR: %08x\n", + getreg32(priv->base + STM32_CAN_IER_OFFSET), + getreg32(priv->base + STM32_CAN_ESR_OFFSET), + getreg32(priv->base + STM32_CAN_BTR_OFFSET)); } #endif @@ -441,50 +426,50 @@ static void can_dumpctrlregs(FAR struct stm32_can_s *priv, * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_STM32_CAN_REGDEBUG static void can_dumpmbregs(FAR struct stm32_can_s *priv, FAR const char *msg) { if (msg) { - canllerr("Mailbox Registers: %s\n", msg); + caninfo("Mailbox Registers: %s\n", msg); } else { - canllerr("Mailbox Registers:\n"); + caninfo("Mailbox Registers:\n"); } /* CAN mailbox registers (3 TX and 2 RX) */ - llerr(" TI0R: %08x TDT0R: %08x TDL0R: %08x TDH0R: %08x\n", - getreg32(priv->base + STM32_CAN_TI0R_OFFSET), - getreg32(priv->base + STM32_CAN_TDT0R_OFFSET), - getreg32(priv->base + STM32_CAN_TDL0R_OFFSET), - getreg32(priv->base + STM32_CAN_TDH0R_OFFSET)); + caninfo(" TI0R: %08x TDT0R: %08x TDL0R: %08x TDH0R: %08x\n", + getreg32(priv->base + STM32_CAN_TI0R_OFFSET), + getreg32(priv->base + STM32_CAN_TDT0R_OFFSET), + getreg32(priv->base + STM32_CAN_TDL0R_OFFSET), + getreg32(priv->base + STM32_CAN_TDH0R_OFFSET)); - llerr(" TI1R: %08x TDT1R: %08x TDL1R: %08x TDH1R: %08x\n", - getreg32(priv->base + STM32_CAN_TI1R_OFFSET), - getreg32(priv->base + STM32_CAN_TDT1R_OFFSET), - getreg32(priv->base + STM32_CAN_TDL1R_OFFSET), - getreg32(priv->base + STM32_CAN_TDH1R_OFFSET)); + caninfo(" TI1R: %08x TDT1R: %08x TDL1R: %08x TDH1R: %08x\n", + getreg32(priv->base + STM32_CAN_TI1R_OFFSET), + getreg32(priv->base + STM32_CAN_TDT1R_OFFSET), + getreg32(priv->base + STM32_CAN_TDL1R_OFFSET), + getreg32(priv->base + STM32_CAN_TDH1R_OFFSET)); - llerr(" TI2R: %08x TDT2R: %08x TDL2R: %08x TDH2R: %08x\n", - getreg32(priv->base + STM32_CAN_TI2R_OFFSET), - getreg32(priv->base + STM32_CAN_TDT2R_OFFSET), - getreg32(priv->base + STM32_CAN_TDL2R_OFFSET), - getreg32(priv->base + STM32_CAN_TDH2R_OFFSET)); + caninfo(" TI2R: %08x TDT2R: %08x TDL2R: %08x TDH2R: %08x\n", + getreg32(priv->base + STM32_CAN_TI2R_OFFSET), + getreg32(priv->base + STM32_CAN_TDT2R_OFFSET), + getreg32(priv->base + STM32_CAN_TDL2R_OFFSET), + getreg32(priv->base + STM32_CAN_TDH2R_OFFSET)); - llerr(" RI0R: %08x RDT0R: %08x RDL0R: %08x RDH0R: %08x\n", - getreg32(priv->base + STM32_CAN_RI0R_OFFSET), - getreg32(priv->base + STM32_CAN_RDT0R_OFFSET), - getreg32(priv->base + STM32_CAN_RDL0R_OFFSET), - getreg32(priv->base + STM32_CAN_RDH0R_OFFSET)); + caninfo(" RI0R: %08x RDT0R: %08x RDL0R: %08x RDH0R: %08x\n", + getreg32(priv->base + STM32_CAN_RI0R_OFFSET), + getreg32(priv->base + STM32_CAN_RDT0R_OFFSET), + getreg32(priv->base + STM32_CAN_RDL0R_OFFSET), + getreg32(priv->base + STM32_CAN_RDH0R_OFFSET)); - llerr(" RI1R: %08x RDT1R: %08x RDL1R: %08x RDH1R: %08x\n", - getreg32(priv->base + STM32_CAN_RI1R_OFFSET), - getreg32(priv->base + STM32_CAN_RDT1R_OFFSET), - getreg32(priv->base + STM32_CAN_RDL1R_OFFSET), - getreg32(priv->base + STM32_CAN_RDH1R_OFFSET)); + caninfo(" RI1R: %08x RDT1R: %08x RDL1R: %08x RDH1R: %08x\n", + getreg32(priv->base + STM32_CAN_RI1R_OFFSET), + getreg32(priv->base + STM32_CAN_RDT1R_OFFSET), + getreg32(priv->base + STM32_CAN_RDL1R_OFFSET), + getreg32(priv->base + STM32_CAN_RDH1R_OFFSET)); } #endif @@ -502,7 +487,7 @@ static void can_dumpmbregs(FAR struct stm32_can_s *priv, * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_STM32_CAN_REGDEBUG static void can_dumpfiltregs(FAR struct stm32_can_s *priv, FAR const char *msg) { @@ -510,25 +495,25 @@ static void can_dumpfiltregs(FAR struct stm32_can_s *priv, if (msg) { - canllerr("Filter Registers: %s\n", msg); + caninfo("Filter Registers: %s\n", msg); } else { - canllerr("Filter Registers:\n"); + caninfo("Filter Registers:\n"); } - llerr(" FMR: %08x FM1R: %08x FS1R: %08x FFA1R: %08x FA1R: %08x\n", - getreg32(priv->base + STM32_CAN_FMR_OFFSET), - getreg32(priv->base + STM32_CAN_FM1R_OFFSET), - getreg32(priv->base + STM32_CAN_FS1R_OFFSET), - getreg32(priv->base + STM32_CAN_FFA1R_OFFSET), - getreg32(priv->base + STM32_CAN_FA1R_OFFSET)); + caninfo(" FMR: %08x FM1R: %08x FS1R: %08x FFA1R: %08x FA1R: %08x\n", + getreg32(priv->base + STM32_CAN_FMR_OFFSET), + getreg32(priv->base + STM32_CAN_FM1R_OFFSET), + getreg32(priv->base + STM32_CAN_FS1R_OFFSET), + getreg32(priv->base + STM32_CAN_FFA1R_OFFSET), + getreg32(priv->base + STM32_CAN_FA1R_OFFSET)); for (i = 0; i < CAN_NFILTERS; i++) { - llerr(" F%dR1: %08x F%dR2: %08x\n", - i, getreg32(priv->base + STM32_CAN_FIR_OFFSET(i, 1)), - i, getreg32(priv->base + STM32_CAN_FIR_OFFSET(i, 2))); + caninfo(" F%dR1: %08x F%dR2: %08x\n", + i, getreg32(priv->base + STM32_CAN_FIR_OFFSET(i, 1)), + i, getreg32(priv->base + STM32_CAN_FIR_OFFSET(i, 2))); } } #endif @@ -574,7 +559,7 @@ static void can_reset(FAR struct can_dev_s *dev) else #endif { - canllerr("Unsupported port %d\n", priv->port); + canerr("ERROR: Unsupported port %d\n", priv->port); return; } @@ -625,7 +610,7 @@ static int can_setup(FAR struct can_dev_s *dev) ret = can_cellinit(priv); if (ret < 0) { - canllerr("CAN%d cell initialization failed: %d\n", priv->port, ret); + canerr("ERROR: CAN%d cell initialization failed: %d\n", priv->port, ret); return ret; } @@ -637,7 +622,7 @@ static int can_setup(FAR struct can_dev_s *dev) ret = can_filterinit(priv); if (ret < 0) { - canllerr("CAN%d filter initialization failed: %d\n", priv->port, ret); + canerr("ERROR: CAN%d filter initialization failed: %d\n", priv->port, ret); return ret; } can_dumpfiltregs(priv, "After filter initialization"); @@ -649,24 +634,24 @@ static int can_setup(FAR struct can_dev_s *dev) ret = irq_attach(priv->canrx[0], can_rx0interrupt); if (ret < 0) { - canllerr("Failed to attach CAN%d RX0 IRQ (%d)", - priv->port, priv->canrx[0]); + canerr(ERROR: "Failed to attach CAN%d RX0 IRQ (%d)", + priv->port, priv->canrx[0]); return ret; } ret = irq_attach(priv->canrx[1], can_rx1interrupt); if (ret < 0) { - canllerr("Failed to attach CAN%d RX1 IRQ (%d)", - priv->port, priv->canrx[1]); + canerr("ERROR: Failed to attach CAN%d RX1 IRQ (%d)", + priv->port, priv->canrx[1]); return ret; } ret = irq_attach(priv->cantx, can_txinterrupt); if (ret < 0) { - canllerr("Failed to attach CAN%d TX IRQ (%d)", - priv->port, priv->cantx); + canerr("ERROR: Failed to attach CAN%d TX IRQ (%d)", + priv->port, priv->cantx); return ret; } @@ -878,7 +863,7 @@ static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) } else { - canllerr("ERROR: No available mailbox\n"); + canerr("ERROR: No available mailbox\n"); return -EBUSY; } @@ -1099,7 +1084,7 @@ static int can_rxinterrupt(int irq, FAR void *context, int rxmb) npending = (regval & CAN_RFR_FMP_MASK) >> CAN_RFR_FMP_SHIFT; if (npending < 1) { - canllerr("WARNING: No messages pending\n"); + canwarn("WARNING: No messages pending\n"); return OK; } @@ -1130,7 +1115,7 @@ static int can_rxinterrupt(int irq, FAR void *context, int rxmb) #else if ((regval & CAN_RIR_IDE) != 0) { - canllerr("ERROR: Received message with extended identifier. Dropped\n"); + canerr("ERROR: Received message with extended identifier. Dropped\n"); ret = -ENOSYS; goto errout; } @@ -1520,7 +1505,7 @@ static int can_cellinit(FAR struct stm32_can_s *priv) if (timeout < 1) { - canllerr("ERROR: Timed out waiting to enter initialization mode\n"); + canerr("ERROR: Timed out waiting to enter initialization mode\n"); return -ETIMEDOUT; } @@ -1544,7 +1529,7 @@ static int can_cellinit(FAR struct stm32_can_s *priv) ret = can_bittiming(priv); if (ret < 0) { - canllerr("ERROR: Failed to set bit timing: %d\n", ret); + canerr("ERROR: Failed to set bit timing: %d\n", ret); return ret; } @@ -1571,8 +1556,8 @@ static int can_cellinit(FAR struct stm32_can_s *priv) if (timeout < 1) { - canllerr("ERROR: Timed out waiting to exit initialization mode: %08x\n", - regval); + canerr("ERROR: Timed out waiting to exit initialization mode: %08x\n", + regval); return -ETIMEDOUT; } return OK; diff --git a/arch/arm/src/stm32l4/stm32l4.h b/arch/arm/src/stm32l4/stm32l4.h index 1b0973e891..b19fd62c43 100644 --- a/arch/arm/src/stm32l4/stm32l4.h +++ b/arch/arm/src/stm32l4/stm32l4.h @@ -53,21 +53,6 @@ * Pre-processor Definitions ************************************************************************************/ -/* Additional Configuration *********************************************************/ -/* Custom debug settings used in the STM32L4 port. These are managed by - * STM32L4-specific logic and not the common logic in include/debug.h. - * NOTE: Some of these also depend on CONFIG_DEBUG_INFO - */ - -#ifndef CONFIG_DEBUG_FEATURES -# undef CONFIG_DEBUG_DMA -# undef CONFIG_DEBUG_RTC -# undef CONFIG_DEBUG_I2C -# undef CONFIG_DEBUG_CAN -# undef CONFIG_DEBUG_PWM -# undef CONFIG_DEBUG_SENSORS -#endif - /* Peripherals **********************************************************************/ #include "chip.h" diff --git a/arch/arm/src/stm32l4/stm32l4_can.c b/arch/arm/src/stm32l4/stm32l4_can.c index 5a23b36cbf..cff88f9b93 100644 --- a/arch/arm/src/stm32l4/stm32l4_can.c +++ b/arch/arm/src/stm32l4/stm32l4_can.c @@ -82,23 +82,8 @@ #define CAN_BIT_QUANTA (CONFIG_CAN_TSEG1 + CONFIG_CAN_TSEG2 + 1) -/* Debug ********************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -#if !defined(CONFIG_DEBUG_FEATURES) || !defined(CONFIG_DEBUG_CAN) -# undef CONFIG_CAN_REGDEBUG +#ifndef CONFIG_DEBUG_CAN_INFO +# undef CONFIG_STM32_CAN_REGDEBUG #endif /**************************************************************************** @@ -126,7 +111,7 @@ static uint32_t can_getreg(struct stm32l4_can_s *priv, int offset); static uint32_t can_getfreg(struct stm32l4_can_s *priv, int offset); static void can_putreg(struct stm32l4_can_s *priv, int offset, uint32_t value); static void can_putfreg(struct stm32l4_can_s *priv, int offset, uint32_t value); -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_STM32_CAN_REGDEBUG static void can_dumpctrlregs(struct stm32l4_can_s *priv, FAR const char *msg); static void can_dumpmbregs(struct stm32l4_can_s *priv, FAR const char *msg); static void can_dumpfiltregs(struct stm32l4_can_s *priv, FAR const char *msg); @@ -216,7 +201,7 @@ static struct can_dev_s g_can1dev = * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_STM32_CAN_REGDEBUG static uint32_t can_vgetreg(uint32_t addr) { static uint32_t prevaddr = 0; @@ -237,7 +222,7 @@ static uint32_t can_vgetreg(uint32_t addr) { if (count == 4) { - llerr("...\n"); + caninfo("...\n"); } return val; @@ -254,7 +239,7 @@ static uint32_t can_vgetreg(uint32_t addr) { /* Yes.. then show how many times the value repeated */ - llerr("[repeats %d more times]\n", count-3); + caninfo("[repeats %d more times]\n", count-3); } /* Save the new address, value, and count */ @@ -266,7 +251,7 @@ static uint32_t can_vgetreg(uint32_t addr) /* Show the register value read */ - llerr("%08x->%08x\n", addr, val); + caninfo("%08x->%08x\n", addr, val); return val; } @@ -310,12 +295,12 @@ static uint32_t can_getfreg(struct stm32l4_can_s *priv, int offset) * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_STM32_CAN_REGDEBUG static void can_vputreg(uint32_t addr, uint32_t value) { /* Show the register value being written */ - llerr("%08x<-%08x\n", addr, value); + caninfo("%08x<-%08x\n", addr, value); /* Write the value */ @@ -358,33 +343,33 @@ static void can_putfreg(struct stm32l4_can_s *priv, int offset, uint32_t value) * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_STM32_CAN_REGDEBUG static void can_dumpctrlregs(struct stm32l4_can_s *priv, FAR const char *msg) { if (msg) { - canllerr("Control Registers: %s\n", msg); + caninfo("Control Registers: %s\n", msg); } else { - canllerr("Control Registers:\n"); + caninfo("Control Registers:\n"); } /* CAN control and status registers */ - llerr(" MCR: %08x MSR: %08x TSR: %08x\n", - getreg32(priv->base + STM32L4_CAN_MCR_OFFSET), - getreg32(priv->base + STM32L4_CAN_MSR_OFFSET), - getreg32(priv->base + STM32L4_CAN_TSR_OFFSET)); + caninfo(" MCR: %08x MSR: %08x TSR: %08x\n", + getreg32(priv->base + STM32L4_CAN_MCR_OFFSET), + getreg32(priv->base + STM32L4_CAN_MSR_OFFSET), + getreg32(priv->base + STM32L4_CAN_TSR_OFFSET)); - llerr(" RF0R: %08x RF1R: %08x\n", - getreg32(priv->base + STM32L4_CAN_RF0R_OFFSET), - getreg32(priv->base + STM32L4_CAN_RF1R_OFFSET)); + caninfo(" RF0R: %08x RF1R: %08x\n", + getreg32(priv->base + STM32L4_CAN_RF0R_OFFSET), + getreg32(priv->base + STM32L4_CAN_RF1R_OFFSET)); - llerr(" IER: %08x ESR: %08x BTR: %08x\n", - getreg32(priv->base + STM32L4_CAN_IER_OFFSET), - getreg32(priv->base + STM32L4_CAN_ESR_OFFSET), - getreg32(priv->base + STM32L4_CAN_BTR_OFFSET)); + caninfo(" IER: %08x ESR: %08x BTR: %08x\n", + getreg32(priv->base + STM32L4_CAN_IER_OFFSET), + getreg32(priv->base + STM32L4_CAN_ESR_OFFSET), + getreg32(priv->base + STM32L4_CAN_BTR_OFFSET)); } #endif @@ -402,49 +387,49 @@ static void can_dumpctrlregs(struct stm32l4_can_s *priv, FAR const char *msg) * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_STM32_CAN_REGDEBUG static void can_dumpmbregs(struct stm32l4_can_s *priv, FAR const char *msg) { if (msg) { - canllerr("Mailbox Registers: %s\n", msg); + caninfo("Mailbox Registers: %s\n", msg); } else { - canllerr("Mailbox Registers:\n"); + caninfo("Mailbox Registers:\n"); } /* CAN mailbox registers (3 TX and 2 RX) */ - llerr(" TI0R: %08x TDT0R: %08x TDL0R: %08x TDH0R: %08x\n", - getreg32(priv->base + STM32L4_CAN_TI0R_OFFSET), - getreg32(priv->base + STM32L4_CAN_TDT0R_OFFSET), - getreg32(priv->base + STM32L4_CAN_TDL0R_OFFSET), - getreg32(priv->base + STM32L4_CAN_TDH0R_OFFSET)); + caninfo(" TI0R: %08x TDT0R: %08x TDL0R: %08x TDH0R: %08x\n", + getreg32(priv->base + STM32L4_CAN_TI0R_OFFSET), + getreg32(priv->base + STM32L4_CAN_TDT0R_OFFSET), + getreg32(priv->base + STM32L4_CAN_TDL0R_OFFSET), + getreg32(priv->base + STM32L4_CAN_TDH0R_OFFSET)); - llerr(" TI1R: %08x TDT1R: %08x TDL1R: %08x TDH1R: %08x\n", - getreg32(priv->base + STM32L4_CAN_TI1R_OFFSET), - getreg32(priv->base + STM32L4_CAN_TDT1R_OFFSET), - getreg32(priv->base + STM32L4_CAN_TDL1R_OFFSET), - getreg32(priv->base + STM32L4_CAN_TDH1R_OFFSET)); + caninfo(" TI1R: %08x TDT1R: %08x TDL1R: %08x TDH1R: %08x\n", + getreg32(priv->base + STM32L4_CAN_TI1R_OFFSET), + getreg32(priv->base + STM32L4_CAN_TDT1R_OFFSET), + getreg32(priv->base + STM32L4_CAN_TDL1R_OFFSET), + getreg32(priv->base + STM32L4_CAN_TDH1R_OFFSET)); - llerr(" TI2R: %08x TDT2R: %08x TDL2R: %08x TDH2R: %08x\n", - getreg32(priv->base + STM32L4_CAN_TI2R_OFFSET), - getreg32(priv->base + STM32L4_CAN_TDT2R_OFFSET), - getreg32(priv->base + STM32L4_CAN_TDL2R_OFFSET), - getreg32(priv->base + STM32L4_CAN_TDH2R_OFFSET)); + caninfo(" TI2R: %08x TDT2R: %08x TDL2R: %08x TDH2R: %08x\n", + getreg32(priv->base + STM32L4_CAN_TI2R_OFFSET), + getreg32(priv->base + STM32L4_CAN_TDT2R_OFFSET), + getreg32(priv->base + STM32L4_CAN_TDL2R_OFFSET), + getreg32(priv->base + STM32L4_CAN_TDH2R_OFFSET)); - llerr(" RI0R: %08x RDT0R: %08x RDL0R: %08x RDH0R: %08x\n", - getreg32(priv->base + STM32L4_CAN_RI0R_OFFSET), - getreg32(priv->base + STM32L4_CAN_RDT0R_OFFSET), - getreg32(priv->base + STM32L4_CAN_RDL0R_OFFSET), - getreg32(priv->base + STM32L4_CAN_RDH0R_OFFSET)); + caninfo(" RI0R: %08x RDT0R: %08x RDL0R: %08x RDH0R: %08x\n", + getreg32(priv->base + STM32L4_CAN_RI0R_OFFSET), + getreg32(priv->base + STM32L4_CAN_RDT0R_OFFSET), + getreg32(priv->base + STM32L4_CAN_RDL0R_OFFSET), + getreg32(priv->base + STM32L4_CAN_RDH0R_OFFSET)); - llerr(" RI1R: %08x RDT1R: %08x RDL1R: %08x RDH1R: %08x\n", - getreg32(priv->base + STM32L4_CAN_RI1R_OFFSET), - getreg32(priv->base + STM32L4_CAN_RDT1R_OFFSET), - getreg32(priv->base + STM32L4_CAN_RDL1R_OFFSET), - getreg32(priv->base + STM32L4_CAN_RDH1R_OFFSET)); + caninfo(" RI1R: %08x RDT1R: %08x RDL1R: %08x RDH1R: %08x\n", + getreg32(priv->base + STM32L4_CAN_RI1R_OFFSET), + getreg32(priv->base + STM32L4_CAN_RDT1R_OFFSET), + getreg32(priv->base + STM32L4_CAN_RDL1R_OFFSET), + getreg32(priv->base + STM32L4_CAN_RDH1R_OFFSET)); } #endif @@ -462,32 +447,32 @@ static void can_dumpmbregs(struct stm32l4_can_s *priv, FAR const char *msg) * ****************************************************************************/ -#ifdef CONFIG_CAN_REGDEBUG +#ifdef CONFIG_STM32_CAN_REGDEBUG static void can_dumpfiltregs(struct stm32l4_can_s *priv, FAR const char *msg) { int i; if (msg) { - canllerr("Filter Registers: %s\n", msg); + caninfo("Filter Registers: %s\n", msg); } else { - canllerr("Filter Registers:\n"); + caninfo("Filter Registers:\n"); } - llerr(" FMR: %08x FM1R: %08x FS1R: %08x FFA1R: %08x FA1R: %08x\n", - getreg32(priv->base + STM32L4_CAN_FMR_OFFSET), - getreg32(priv->base + STM32L4_CAN_FM1R_OFFSET), - getreg32(priv->base + STM32L4_CAN_FS1R_OFFSET), - getreg32(priv->base + STM32L4_CAN_FFA1R_OFFSET), - getreg32(priv->base + STM32L4_CAN_FA1R_OFFSET)); + caninfo(" FMR: %08x FM1R: %08x FS1R: %08x FFA1R: %08x FA1R: %08x\n", + getreg32(priv->base + STM32L4_CAN_FMR_OFFSET), + getreg32(priv->base + STM32L4_CAN_FM1R_OFFSET), + getreg32(priv->base + STM32L4_CAN_FS1R_OFFSET), + getreg32(priv->base + STM32L4_CAN_FFA1R_OFFSET), + getreg32(priv->base + STM32L4_CAN_FA1R_OFFSET)); for (i = 0; i < CAN_NFILTERS; i++) { - llerr(" F%dR1: %08x F%dR2: %08x\n", - i, getreg32(priv->base + STM32L4_CAN_FIR_OFFSET(i, 1)), - i, getreg32(priv->base + STM32L4_CAN_FIR_OFFSET(i, 2))); + caninfo(" F%dR1: %08x F%dR2: %08x\n", + i, getreg32(priv->base + STM32L4_CAN_FIR_OFFSET(i, 1)), + i, getreg32(priv->base + STM32L4_CAN_FIR_OFFSET(i, 2))); } } #endif @@ -526,7 +511,7 @@ static void can_reset(FAR struct can_dev_s *dev) else #endif { - canllerr("Unsupported port %d\n", priv->port); + canerr("ERROR: Unsupported port %d\n", priv->port); return; } @@ -576,7 +561,7 @@ static int can_setup(FAR struct can_dev_s *dev) ret = can_cellinit(priv); if (ret < 0) { - canllerr("CAN%d cell initialization failed: %d\n", priv->port, ret); + canerr("ERROR: CAN%d cell initialization failed: %d\n", priv->port, ret); return ret; } @@ -588,7 +573,7 @@ static int can_setup(FAR struct can_dev_s *dev) ret = can_filterinit(priv); if (ret < 0) { - canllerr("CAN%d filter initialization failed: %d\n", priv->port, ret); + canerr("ERROR: CAN%d filter initialization failed: %d\n", priv->port, ret); return ret; } @@ -599,14 +584,14 @@ static int can_setup(FAR struct can_dev_s *dev) ret = irq_attach(priv->canrx0, can_rx0interrupt); if (ret < 0) { - canllerr("Failed to attach CAN%d RX0 IRQ (%d)", priv->port, priv->canrx0); + canerr("ERROR: Failed to attach CAN%d RX0 IRQ (%d)", priv->port, priv->canrx0); return ret; } ret = irq_attach(priv->cantx, can_txinterrupt); if (ret < 0) { - canllerr("Failed to attach CAN%d TX IRQ (%d)", priv->port, priv->cantx); + canerr("ERROR: Failed to attach CAN%d TX IRQ (%d)", priv->port, priv->cantx); return ret; } @@ -815,7 +800,7 @@ static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg) } else { - canllerr("ERROR: No available mailbox\n"); + canerr("ERROR: No available mailbox\n"); return -EBUSY; } @@ -1029,7 +1014,7 @@ static int can_rx0interrupt(int irq, void *context) npending = (regval & CAN_RFR_FMP_MASK) >> CAN_RFR_FMP_SHIFT; if (npending < 1) { - canllerr("WARNING: No messages pending\n"); + canwarn("WARNING: No messages pending\n"); return OK; } @@ -1053,7 +1038,7 @@ static int can_rx0interrupt(int irq, void *context) #else if ((regval & CAN_RIR_IDE) != 0) { - canllerr("ERROR: Received message with extended identifier. Dropped\n"); + canerr("ERROR: Received message with extended identifier. Dropped\n"); ret = -ENOSYS; goto errout; } @@ -1392,7 +1377,7 @@ static int can_cellinit(struct stm32l4_can_s *priv) if (timeout < 1) { - canllerr("ERROR: Timed out waiting to enter initialization mode\n"); + canerr("ERROR: Timed out waiting to enter initialization mode\n"); return -ETIMEDOUT; } @@ -1415,7 +1400,7 @@ static int can_cellinit(struct stm32l4_can_s *priv) ret = can_bittiming(priv); if (ret < 0) { - canllerr("ERROR: Failed to set bit timing: %d\n", ret); + canerr("ERROR: Failed to set bit timing: %d\n", ret); return ret; } @@ -1442,7 +1427,7 @@ static int can_cellinit(struct stm32l4_can_s *priv) if (timeout < 1) { - canllerr("ERROR: Timed out waiting to exit initialization mode: %08x\n", regval); + canerr("ERROR: Timed out waiting to exit initialization mode: %08x\n", regval); return -ETIMEDOUT; } diff --git a/configs/cloudctrl/README.txt b/configs/cloudctrl/README.txt index 853c2e6e9e..adce2658ba 100644 --- a/configs/cloudctrl/README.txt +++ b/configs/cloudctrl/README.txt @@ -651,7 +651,7 @@ Cloudctrl-specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. Cloudctrl LCD Hardware Configuration diff --git a/configs/fire-stm32v2/README.txt b/configs/fire-stm32v2/README.txt index d8da5f1f34..d008446118 100644 --- a/configs/fire-stm32v2/README.txt +++ b/configs/fire-stm32v2/README.txt @@ -758,7 +758,7 @@ M3 Wildfire-specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. M3 Wildfire LCD Hardware Configuration diff --git a/configs/hymini-stm32v/README.txt b/configs/hymini-stm32v/README.txt index 4c7a5f6be7..1afd69b08c 100644 --- a/configs/hymini-stm32v/README.txt +++ b/configs/hymini-stm32v/README.txt @@ -502,7 +502,7 @@ HY-Mini specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. HY-MiniSTM32V LCD Hardware Configuration. The HY-Mini board may be delivered with diff --git a/configs/mikroe-stm32f4/README.txt b/configs/mikroe-stm32f4/README.txt index 59522039a4..667761ba24 100644 --- a/configs/mikroe-stm32f4/README.txt +++ b/configs/mikroe-stm32f4/README.txt @@ -660,7 +660,7 @@ Mikroe-STM32F4-specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. Mikroe-STM32F4 SPI Configuration diff --git a/configs/nucleo-f303re/src/stm32_can.c b/configs/nucleo-f303re/src/stm32_can.c index b89826195e..41eae2ff92 100644 --- a/configs/nucleo-f303re/src/stm32_can.c +++ b/configs/nucleo-f303re/src/stm32_can.c @@ -52,37 +52,6 @@ #if defined(CONFIG_CAN) && defined(CONFIG_STM32_CAN1) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Debug ********************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/olimex-lpc1766stk/src/lpc17_can.c b/configs/olimex-lpc1766stk/src/lpc17_can.c index 3fe2c05cbf..3282587dd4 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_can.c +++ b/configs/olimex-lpc1766stk/src/lpc17_can.c @@ -73,25 +73,6 @@ # define CAN_PORT 2 #endif -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/olimex-stm32-h405/src/stm32_can.c b/configs/olimex-stm32-h405/src/stm32_can.c index 12e08951f5..ed2ee4a069 100644 --- a/configs/olimex-stm32-h405/src/stm32_can.c +++ b/configs/olimex-stm32-h405/src/stm32_can.c @@ -65,25 +65,6 @@ # define CAN_PORT 2 #endif -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/olimex-stm32-h407/src/stm32_can.c b/configs/olimex-stm32-h407/src/stm32_can.c index 2ff1514954..d293ee960c 100644 --- a/configs/olimex-stm32-h407/src/stm32_can.c +++ b/configs/olimex-stm32-h407/src/stm32_can.c @@ -65,21 +65,6 @@ # define CAN_PORT 2 #endif -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/olimex-stm32-p107/src/stm32_can.c b/configs/olimex-stm32-p107/src/stm32_can.c index 84bd103adf..b292036f14 100644 --- a/configs/olimex-stm32-p107/src/stm32_can.c +++ b/configs/olimex-stm32-p107/src/stm32_can.c @@ -61,25 +61,6 @@ #define CAN_PORT 1 -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/olimex-stm32-p207/src/stm32_can.c b/configs/olimex-stm32-p207/src/stm32_can.c index 1c223eb100..16c71ae43e 100644 --- a/configs/olimex-stm32-p207/src/stm32_can.c +++ b/configs/olimex-stm32-p207/src/stm32_can.c @@ -65,25 +65,6 @@ # define CAN_PORT 2 #endif -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/olimexino-stm32/src/stm32_can.c b/configs/olimexino-stm32/src/stm32_can.c index 1433a60dca..483d561f9f 100644 --- a/configs/olimexino-stm32/src/stm32_can.c +++ b/configs/olimexino-stm32/src/stm32_can.c @@ -64,25 +64,6 @@ #define CAN_PORT 1 -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/sama5d3-xplained/src/sam_can.c b/configs/sama5d3-xplained/src/sam_can.c index 8cf06c3b9b..7befbcee65 100644 --- a/configs/sama5d3-xplained/src/sam_can.c +++ b/configs/sama5d3-xplained/src/sam_can.c @@ -69,25 +69,6 @@ # define CAN_PORT 1 #endif -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/sama5d3x-ek/src/sam_can.c b/configs/sama5d3x-ek/src/sam_can.c index 2cdc4a4816..dae9f4e61e 100644 --- a/configs/sama5d3x-ek/src/sam_can.c +++ b/configs/sama5d3x-ek/src/sam_can.c @@ -69,25 +69,6 @@ # define CAN_PORT 1 #endif -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/same70-xplained/README.txt b/configs/same70-xplained/README.txt index b4e882a5f6..6f84f024fa 100644 --- a/configs/same70-xplained/README.txt +++ b/configs/same70-xplained/README.txt @@ -747,7 +747,7 @@ MCAN1 Loopback Test Build Setup -> Debug Options CONFIG_DEBUG_FEATURES=y # Enables general debug features CONFIG_DEBUG_INFO=y # Enables verbose output - CONFIG_DEBUG_CAN=y # Enables debug output from CAN + CONFIG_DEBUG_CAN_INFO=y # Enables debug output from CAN CONFIG_STACK_COLORATION=y # Monitor stack usage CONFIG_DEBUG_SYMBOLS=y # Needed only for use with a debugger diff --git a/configs/same70-xplained/src/sam_mcan.c b/configs/same70-xplained/src/sam_mcan.c index 9ef3afd4e5..722e83c361 100644 --- a/configs/same70-xplained/src/sam_mcan.c +++ b/configs/same70-xplained/src/sam_mcan.c @@ -67,21 +67,6 @@ # define CAN_PORT 1 #endif -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/samv71-xult/README.txt b/configs/samv71-xult/README.txt index c3626d085f..d51f23dfe1 100644 --- a/configs/samv71-xult/README.txt +++ b/configs/samv71-xult/README.txt @@ -1337,7 +1337,7 @@ MCAN1 Loopback Test Build Setup -> Debug Options CONFIG_DEBUG_FEATURES=y # Enables general debug features CONFIG_DEBUG_INFO=y # Enables verbose output - CONFIG_DEBUG_CAN=y # Enables debug output from CAN + CONFIG_DEBUG_CAN_INFO=y # Enables debug output from CAN CONFIG_STACK_COLORATION=y # Monitor stack usage CONFIG_DEBUG_SYMBOLS=y # Needed only for use with a debugger diff --git a/configs/samv71-xult/src/sam_mcan.c b/configs/samv71-xult/src/sam_mcan.c index fa823a7b90..e692eb4013 100644 --- a/configs/samv71-xult/src/sam_mcan.c +++ b/configs/samv71-xult/src/sam_mcan.c @@ -67,21 +67,6 @@ # define CAN_PORT 1 #endif -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/shenzhou/README.txt b/configs/shenzhou/README.txt index cff8b23595..1eeedcd252 100644 --- a/configs/shenzhou/README.txt +++ b/configs/shenzhou/README.txt @@ -668,7 +668,7 @@ Shenzhou-specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. Shenzhou LCD Hardware Configuration diff --git a/configs/shenzhou/src/stm32_can.c b/configs/shenzhou/src/stm32_can.c index 51b6922345..8bfe95ac09 100644 --- a/configs/shenzhou/src/stm32_can.c +++ b/configs/shenzhou/src/stm32_can.c @@ -62,25 +62,6 @@ #define CAN_PORT 1 -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm3210e-eval/README.txt b/configs/stm3210e-eval/README.txt index 9fedf98eff..1e70b125b5 100644 --- a/configs/stm3210e-eval/README.txt +++ b/configs/stm3210e-eval/README.txt @@ -657,7 +657,7 @@ STM3210E-EVAL-specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. STM3210E-EVAL LCD Hardware Configuration diff --git a/configs/stm3210e-eval/src/stm32_can.c b/configs/stm3210e-eval/src/stm32_can.c index 9ff5ebec86..1d296be81c 100644 --- a/configs/stm3210e-eval/src/stm32_can.c +++ b/configs/stm3210e-eval/src/stm32_can.c @@ -62,25 +62,6 @@ #define CAN_PORT 1 -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm3220g-eval/README.txt b/configs/stm3220g-eval/README.txt index d1ceddaca4..d459061684 100644 --- a/configs/stm3220g-eval/README.txt +++ b/configs/stm3220g-eval/README.txt @@ -486,7 +486,7 @@ Configuration Options: CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. FSMC SRAM @@ -817,7 +817,7 @@ STM3220G-EVAL-specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. STM3220G-EVAL LCD Hardware Configuration @@ -1003,8 +1003,8 @@ Where is one of the following: Special CAN-only debug options: - CONFIG_DEBUG_CAN - CONFIG_CAN_REGDEBUG + CONFIG_DEBUG_CAN_INFO + CONFIG_STM32_CAN_REGDEBUG 6. This example can support an FTP client. In order to build in FTP client support simply reconfigure NuttX, adding: diff --git a/configs/stm3220g-eval/src/stm32_can.c b/configs/stm3220g-eval/src/stm32_can.c index c01a0d6df9..a7a7bf2e17 100644 --- a/configs/stm3220g-eval/src/stm32_can.c +++ b/configs/stm3220g-eval/src/stm32_can.c @@ -70,25 +70,6 @@ # define CAN_PORT 2 #endif -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm3240g-eval/README.txt b/configs/stm3240g-eval/README.txt index 560ee32e0b..088564b077 100644 --- a/configs/stm3240g-eval/README.txt +++ b/configs/stm3240g-eval/README.txt @@ -382,7 +382,7 @@ Configuration Options: CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. FPU @@ -810,7 +810,7 @@ STM3240G-EVAL-specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. STM3240G-EVAL LCD Hardware Configuration @@ -1179,8 +1179,8 @@ Where is one of the following: Special CAN-only debug options: - CONFIG_DEBUG_CAN - CONFIG_CAN_REGDEBUG + CONFIG_DEBUG_CAN_INFO + CONFIG_STM32_CAN_REGDEBUG 6. This example can support an FTP client. In order to build in FTP client support simply uncomment the following lines in the defconfig file (before diff --git a/configs/stm3240g-eval/src/stm32_can.c b/configs/stm3240g-eval/src/stm32_can.c index 265ee1b9ec..e5350615d2 100644 --- a/configs/stm3240g-eval/src/stm32_can.c +++ b/configs/stm3240g-eval/src/stm32_can.c @@ -70,25 +70,6 @@ # define CAN_PORT 2 #endif -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/stm32_tiny/README.txt b/configs/stm32_tiny/README.txt index 2e1bc8a294..dcc6181fb9 100644 --- a/configs/stm32_tiny/README.txt +++ b/configs/stm32_tiny/README.txt @@ -493,7 +493,7 @@ STM32 Tiny - specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. STM32Tiny SPI Configuration diff --git a/configs/stm32f103-minimum/README.txt b/configs/stm32f103-minimum/README.txt index 800ce32c47..908a02bc88 100644 --- a/configs/stm32f103-minimum/README.txt +++ b/configs/stm32f103-minimum/README.txt @@ -392,7 +392,7 @@ STM32F103 Minimum - specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. STM32F103 Minimum SPI Configuration diff --git a/configs/stm32f3discovery/README.txt b/configs/stm32f3discovery/README.txt index cf20d38836..7917da3773 100644 --- a/configs/stm32f3discovery/README.txt +++ b/configs/stm32f3discovery/README.txt @@ -637,7 +637,7 @@ STM32F3Discovery-specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. STM32F3Discovery SPI Configuration diff --git a/configs/stm32f429i-disco/README.txt b/configs/stm32f429i-disco/README.txt index 215a837e45..87fa07a37e 100644 --- a/configs/stm32f429i-disco/README.txt +++ b/configs/stm32f429i-disco/README.txt @@ -533,7 +533,7 @@ STM32F429I-DISCO-specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. STM32F429I-DISCO SPI Configuration diff --git a/configs/stm32f4discovery/README.txt b/configs/stm32f4discovery/README.txt index 101607188b..4f7accd205 100644 --- a/configs/stm32f4discovery/README.txt +++ b/configs/stm32f4discovery/README.txt @@ -1024,7 +1024,7 @@ STM32F4Discovery-specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. STM32F4Discovery SPI Configuration diff --git a/configs/stm32f746g-disco/README.txt b/configs/stm32f746g-disco/README.txt index e1a9c2783d..4ae7ac06ac 100644 --- a/configs/stm32f746g-disco/README.txt +++ b/configs/stm32f746g-disco/README.txt @@ -416,7 +416,7 @@ STM32F746G-DISCO-specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32F7_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. STM32F746G-DISCO SPI Configuration diff --git a/configs/stm32ldiscovery/README.txt b/configs/stm32ldiscovery/README.txt index ed8a1b2c7a..4158273b5a 100644 --- a/configs/stm32ldiscovery/README.txt +++ b/configs/stm32ldiscovery/README.txt @@ -707,7 +707,7 @@ STM32L-Discovery-specific Configuration Options CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined. CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6 CONFIG_CAN_TSEG2 - the number of CAN time quanta in segment 2. Default: 7 - CONFIG_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an + CONFIG_STM32_CAN_REGDEBUG - If CONFIG_DEBUG_FEATURES is set, this will generate an dump of all CAN registers. STM32L-Discovery SPI Configuration diff --git a/configs/viewtool-stm32f107/src/stm32_can.c b/configs/viewtool-stm32f107/src/stm32_can.c index a4e4fd5f9f..2aad6dfdf2 100644 --- a/configs/viewtool-stm32f107/src/stm32_can.c +++ b/configs/viewtool-stm32f107/src/stm32_can.c @@ -61,25 +61,6 @@ #define CAN_PORT 1 -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/zkit-arm-1769/src/lpc17_can.c b/configs/zkit-arm-1769/src/lpc17_can.c index 846dcdf009..0bdba84446 100644 --- a/configs/zkit-arm-1769/src/lpc17_can.c +++ b/configs/zkit-arm-1769/src/lpc17_can.c @@ -62,29 +62,10 @@ * Pre-processor Definitions ************************************************************************************/ /* Configuration ********************************************************************/ + #define CAN_PORT1 1 #define CAN_PORT2 2 - -/* Debug ***************************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/drivers/can.c b/drivers/can.c index 17fb75a401..bb1eae795c 100644 --- a/drivers/can.c +++ b/drivers/can.c @@ -96,21 +96,6 @@ # endif #endif -/* Debug ********************************************************************/ -/* Non-standard debug that may be enabled just for testing CAN */ - -#ifdef CONFIG_DEBUG_CAN -# define canerr err -# define caninfo info -# define canllerr llerr -# define canllinfo llinfo -#else -# define canerr(x...) -# define caninfo(x...) -# define canllerr(x...) -# define canllinfo(x...) -#endif - /* Timing Definitions *******************************************************/ #define HALF_SECOND_MSEC 500 diff --git a/include/debug.h b/include/debug.h index 9abe4073ac..8bdd2c260e 100644 --- a/include/debug.h +++ b/include/debug.h @@ -405,6 +405,30 @@ # define allinfo(x...) #endif +#ifdef CONFIG_DEBUG_CAN_ERROR +# define canerr(format, ...) err(format, ##__VA_ARGS__) +# define canllerr(format, ...) llerr(format, ##__VA_ARGS__) +#else +# define canerr(x...) +# define canllerr(x...) +#endif + +#ifdef CONFIG_DEBUG_CAN_WARN +# define canwarn(format, ...) warn(format, ##__VA_ARGS__) +# define canllwarn(format, ...) llwarn(format, ##__VA_ARGS__) +#else +# define canwarn(x...) +# define canllwarn(x...) +#endif + +#ifdef CONFIG_DEBUG_CAN_INFO +# define caninfo(format, ...) info(format, ##__VA_ARGS__) +# define canllinfo(format, ...) llinfo(format, ##__VA_ARGS__) +#else +# define caninfo(x...) +# define canllinfo(x...) +#endif + #ifdef CONFIG_DEBUG_GRAPHICS_ERROR # define gerr(format, ...) err(format, ##__VA_ARGS__) # define gllerr(format, ...) llerr(format, ##__VA_ARGS__) @@ -922,6 +946,30 @@ # define allinfo (void) #endif +#ifdef CONFIG_DEBUG_CAN_ERROR +# define canerr err +# define canllerr llerr +#else +# define canerr (void) +# define canllerr (void) +#endif + +#ifdef CONFIG_DEBUG_CAN_WARN +# define canwarn warn +# define canllwarn llwarn +#else +# define canwarn (void) +# define canllwarn (void) +#endif + +#ifdef CONFIG_DEBUG_CAN_INFO +# define caninfo info +# define canllinfo llinfo +#else +# define caninfo (void) +# define canllinfo (void) +#endif + #ifdef CONFIG_DEBUG_GRAPHICS_ERROR # define gerr err # define gllerr llerr @@ -1260,6 +1308,22 @@ # define iinfodumpbuffer(m,b,n) #endif +#ifdef CONFIG_DEBUG_ANALOG +# define aerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) +# define ainfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) +#else +# define aerrdumpbuffer(m,b,n) +# define ainfodumpbuffer(m,b,n) +#endif + +#ifdef CONFIG_DEBUG_CAN +# define canerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) +# define caninfodumpbuffer(m,b,n) infodumpbuffer(m,b,n) +#else +# define canerrdumpbuffer(m,b,n) +# define caninfodumpbuffer(m,b,n) +#endif + #ifdef CONFIG_DEBUG_GRAPHICS # define gerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n) # define ginfodumpbuffer(m,b,n) infodumpbuffer(m,b,n)