Centralize definitions associated with CONFIG_DEBUG_CAN
This commit is contained in:
parent
6d9a0511ad
commit
63b1eb09e6
34
Kconfig
34
Kconfig
@ -980,7 +980,7 @@ config DEBUG_ANALOG
|
|||||||
default n
|
default n
|
||||||
depends on ANALOG
|
depends on ANALOG
|
||||||
---help---
|
---help---
|
||||||
Enable analog devic debug features.
|
Enable analog device debug features.
|
||||||
Enable low level debug features the analog device drivers such as
|
Enable low level debug features the analog device drivers such as
|
||||||
A/D and D/A converters (disabled by default). Support for this
|
A/D and D/A converters (disabled by default). Support for this
|
||||||
debug option is architecture-specific and may not be available for
|
debug option is architecture-specific and may not be available for
|
||||||
@ -1007,19 +1007,45 @@ config DEBUG_ANALOG_INFO
|
|||||||
default n
|
default n
|
||||||
depends on DEBUG_INFO
|
depends on DEBUG_INFO
|
||||||
---help---
|
---help---
|
||||||
Enable analog device informational output to SYSLOG.
|
Enable CAN driver informational output to SYSLOG.
|
||||||
|
|
||||||
endif # DEBUG_ANALOG
|
endif # DEBUG_ANALOG
|
||||||
|
|
||||||
config DEBUG_CAN
|
config DEBUG_CAN
|
||||||
bool "CAN Debug Output"
|
bool "CAN Debug Features"
|
||||||
default n
|
default n
|
||||||
depends on CAN
|
depends on CAN
|
||||||
---help---
|
---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
|
Support for this debug option is architecture-specific and may not
|
||||||
be available for some MCUs.
|
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
|
config DEBUG_GPIO
|
||||||
bool "GPIO Debug Features"
|
bool "GPIO Debug Features"
|
||||||
default n
|
default n
|
||||||
|
@ -229,11 +229,11 @@ config CAN_LOOPBACK
|
|||||||
|
|
||||||
config CAN_REGDEBUG
|
config CAN_REGDEBUG
|
||||||
bool "Register level debug"
|
bool "Register level debug"
|
||||||
depends on DEBUG_FEATURES
|
depends on DEBUG_CAN_INFO
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Output detailed register-level CAN debug information. Requires also
|
Output detailed register-level CAN debug information. Requires also
|
||||||
CONFIG_DEBUG_FEATURES and CONFIG_DEBUG_CAN.
|
CONFIG_DEBUG_CAN_INFO.
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
|
@ -594,13 +594,13 @@ config CAN_LOOPBACK
|
|||||||
---help---
|
---help---
|
||||||
Enable CAN loopback mode
|
Enable CAN loopback mode
|
||||||
|
|
||||||
config CAN_REGDEBUG
|
config LPC17_CAN_REGDEBUG
|
||||||
bool "Register level debug"
|
bool "Register level debug"
|
||||||
depends on DEBUG_FEATURES
|
depends on DEBUG_CAN_INFO
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Output detailed register-level CAN debug information. Requires also
|
Output detailed register-level CAN debug information. Requires also
|
||||||
CONFIG_DEBUG_FEATURES and CONFIG_DEBUG_CAN.
|
CONFIG_DEBUG_CAN_INFO.
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
|
@ -160,25 +160,8 @@
|
|||||||
/* Debug ********************************************************************/
|
/* Debug ********************************************************************/
|
||||||
/* Non-standard debug that may be enabled just for testing CAN */
|
/* Non-standard debug that may be enabled just for testing CAN */
|
||||||
|
|
||||||
#if !defined(CONFIG_DEBUG_FEATURES) || !defined(CONFIG_DEBUG_CAN)
|
#ifndef CONFIG_DEBUG_CAN_INFO
|
||||||
# undef CONFIG_CAN_REGDEBUG
|
# undef CONFIG_LPC17_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...)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Timing *******************************************************************/
|
/* Timing *******************************************************************/
|
||||||
@ -203,14 +186,14 @@ struct up_dev_s
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
/* CAN Register access */
|
/* CAN Register access */
|
||||||
|
|
||||||
#ifdef CONFIG_CAN_REGDEBUG
|
#ifdef CONFIG_LPC17_CAN_REGDEBUG
|
||||||
static void can_printreg(uint32_t addr, uint32_t value);
|
static void can_printreg(uint32_t addr, uint32_t value);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static uint32_t can_getreg(struct up_dev_s *priv, int offset);
|
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);
|
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 uint32_t can_getcommon(uint32_t addr);
|
||||||
static void can_putcommon(uint32_t addr, uint32_t value);
|
static void can_putcommon(uint32_t addr, uint32_t value);
|
||||||
#else
|
#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 void can_printreg(uint32_t addr, uint32_t value)
|
||||||
{
|
{
|
||||||
static uint32_t prevaddr = 0;
|
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)
|
static uint32_t can_getreg(struct up_dev_s *priv, int offset)
|
||||||
{
|
{
|
||||||
uint32_t addr;
|
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)
|
static void can_putreg(struct up_dev_s *priv, int offset, uint32_t value)
|
||||||
{
|
{
|
||||||
uint32_t addr = priv->base + offset;
|
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)
|
static uint32_t can_getcommon(uint32_t addr)
|
||||||
{
|
{
|
||||||
uint32_t value;
|
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)
|
static void can_putcommon(uint32_t addr, uint32_t value)
|
||||||
{
|
{
|
||||||
/* Show the register value being written */
|
/* 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)
|
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;
|
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->cd_priv;
|
||||||
#endif
|
#endif
|
||||||
int ret;
|
int ret;
|
||||||
@ -565,6 +548,7 @@ static int can_setup(FAR struct can_dev_s *dev)
|
|||||||
{
|
{
|
||||||
up_enable_irq(LPC17_IRQ_CAN);
|
up_enable_irq(LPC17_IRQ_CAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
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)
|
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;
|
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)dev->cd_priv;
|
||||||
|
|
||||||
caninfo("CAN%d\n", priv->port);
|
caninfo("CAN%d\n", priv->port);
|
||||||
|
@ -2323,11 +2323,11 @@ config SAMA5_CAN_AUTOBAUD
|
|||||||
|
|
||||||
config SAMA5_CAN_REGDEBUG
|
config SAMA5_CAN_REGDEBUG
|
||||||
bool "CAN Register level debug"
|
bool "CAN Register level debug"
|
||||||
depends on DEBUG_FEATURES
|
depends on DEBUG_CAN_INFO
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Output detailed register-level CAN device debug information.
|
Output detailed register-level CAN device debug information.
|
||||||
Requires also CONFIG_DEBUG_FEATURES.
|
Requires also CONFIG_DEBUG_CAN_INFO.
|
||||||
|
|
||||||
endmenu # CAN device driver options
|
endmenu # CAN device driver options
|
||||||
endif # SAMA5_CAN0 || SAMA5_CAN1
|
endif # SAMA5_CAN0 || SAMA5_CAN1
|
||||||
|
@ -123,22 +123,7 @@
|
|||||||
#define CAN_DEBUG_INTS (CAN_INT_ERRA | CAN_INT_WARN | CAN_INT_CERR | \
|
#define CAN_DEBUG_INTS (CAN_INT_ERRA | CAN_INT_WARN | CAN_INT_CERR | \
|
||||||
CAN_INT_SERR | CAN_INT_FERR | CAN_INT_BERR)
|
CAN_INT_SERR | CAN_INT_FERR | CAN_INT_BERR)
|
||||||
|
|
||||||
/* Debug ********************************************************************/
|
#ifndef CONFIG_DEBUG_CAN_INFO
|
||||||
/* 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_SAMA5_CAN_REGDEBUG
|
# undef CONFIG_SAMA5_CAN_REGDEBUG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2615,11 +2615,11 @@ endmenu # MCAN1 device driver options
|
|||||||
|
|
||||||
config SAMV7_MCAN_REGDEBUG
|
config SAMV7_MCAN_REGDEBUG
|
||||||
bool "CAN Register level debug"
|
bool "CAN Register level debug"
|
||||||
depends on DEBUG_FEATURES
|
depends on DEBUG_CAN_INFO
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Output detailed register-level CAN device debug information.
|
Output detailed register-level CAN device debug information.
|
||||||
Requires also CONFIG_DEBUG_FEATURES.
|
Requires also CONFIG_DEBUG_CAN_INFO.
|
||||||
|
|
||||||
endmenu # CAN device driver options
|
endmenu # CAN device driver options
|
||||||
endif # SAMV7_MCAN
|
endif # SAMV7_MCAN
|
||||||
|
@ -789,28 +789,14 @@
|
|||||||
/* Debug ********************************************************************/
|
/* Debug ********************************************************************/
|
||||||
/* Debug configurations that may be enabled just for testing MCAN */
|
/* 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
|
# undef CONFIG_SAMV7_MCAN_REGDEBUG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_CAN
|
#ifdef CONFIG_SAMV7_MCAN_REGDEBUG
|
||||||
# define canerr err
|
# define reginfo caninfo
|
||||||
# define caninfo info
|
|
||||||
# define canllerr llerr
|
|
||||||
# define canllinfo llinfo
|
|
||||||
|
|
||||||
# ifdef CONFIG_SAMV7_MCAN_REGDEBUG
|
|
||||||
# define canregerr llerr
|
|
||||||
# else
|
|
||||||
# define canregerr(x...)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
# define canerr(x...)
|
# define reginfo(x...)
|
||||||
# define caninfo(x...)
|
|
||||||
# define canllerr(x...)
|
|
||||||
# define canllinfo(x...)
|
|
||||||
# define canregerr(x...)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -2756,7 +2742,7 @@ static int mcan_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
txbuffer[0] = regval;
|
txbuffer[0] = regval;
|
||||||
canregerr("T0: %08x\n", regval);
|
reginfo("T0: %08x\n", regval);
|
||||||
|
|
||||||
/* Format word T1:
|
/* Format word T1:
|
||||||
* Data Length Code (DLC) - Value from message structure
|
* 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);
|
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..) */
|
/* 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 */
|
/* Work R0 contains the CAN ID */
|
||||||
|
|
||||||
regval = *rxbuffer++;
|
regval = *rxbuffer++;
|
||||||
canregerr("R0: %08x\n", regval);
|
reginfo("R0: %08x\n", regval);
|
||||||
|
|
||||||
#ifdef CONFIG_CAN_ERRORS
|
#ifdef CONFIG_CAN_ERRORS
|
||||||
hdr.ch_error = 0;
|
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 */
|
/* Word R1 contains the DLC and timestamp */
|
||||||
|
|
||||||
regval = *rxbuffer++;
|
regval = *rxbuffer++;
|
||||||
canregerr("R1: %08x\n", regval);
|
reginfo("R1: %08x\n", regval);
|
||||||
|
|
||||||
hdr.ch_dlc = (regval & BUFFER_R1_DLC_MASK) >> BUFFER_R1_DLC_SHIFT;
|
hdr.ch_dlc = (regval & BUFFER_R1_DLC_MASK) >> BUFFER_R1_DLC_SHIFT;
|
||||||
|
|
||||||
|
@ -53,21 +53,6 @@
|
|||||||
* Pre-processor Definitions
|
* 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 **********************************************************************/
|
/* Peripherals **********************************************************************/
|
||||||
|
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
|
@ -81,23 +81,8 @@
|
|||||||
|
|
||||||
#define CAN_BIT_QUANTA (CONFIG_CAN_TSEG1 + CONFIG_CAN_TSEG2 + 1)
|
#define CAN_BIT_QUANTA (CONFIG_CAN_TSEG1 + CONFIG_CAN_TSEG2 + 1)
|
||||||
|
|
||||||
/* Debug ********************************************************************/
|
#ifndef CONFIG_DEBUG_CAN_INFO
|
||||||
/* Non-standard debug that may be enabled just for testing CAN */
|
# undef CONFIG_STM32_CAN_REGDEBUG
|
||||||
|
|
||||||
#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
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -127,7 +112,7 @@ static void can_putreg(FAR struct stm32_can_s *priv, int offset,
|
|||||||
uint32_t value);
|
uint32_t value);
|
||||||
static void can_putfreg(FAR struct stm32_can_s *priv, int offset,
|
static void can_putfreg(FAR struct stm32_can_s *priv, int offset,
|
||||||
uint32_t value);
|
uint32_t value);
|
||||||
#ifdef CONFIG_CAN_REGDEBUG
|
#ifdef CONFIG_STM32_CAN_REGDEBUG
|
||||||
static void can_dumpctrlregs(FAR struct stm32_can_s *priv,
|
static void can_dumpctrlregs(FAR struct stm32_can_s *priv,
|
||||||
FAR const char *msg);
|
FAR const char *msg);
|
||||||
static void can_dumpmbregs(FAR struct stm32_can_s *priv,
|
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 can_vgetreg(uint32_t addr)
|
||||||
{
|
{
|
||||||
static uint32_t prevaddr = 0;
|
static uint32_t prevaddr = 0;
|
||||||
@ -270,7 +255,7 @@ static uint32_t can_vgetreg(uint32_t addr)
|
|||||||
{
|
{
|
||||||
if (count == 4)
|
if (count == 4)
|
||||||
{
|
{
|
||||||
llerr("...\n");
|
caninfo("...\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
@ -287,7 +272,7 @@ static uint32_t can_vgetreg(uint32_t addr)
|
|||||||
{
|
{
|
||||||
/* Yes.. then show how many times the value repeated */
|
/* 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 */
|
/* Save the new address, value, and count */
|
||||||
@ -299,7 +284,7 @@ static uint32_t can_vgetreg(uint32_t addr)
|
|||||||
|
|
||||||
/* Show the register value read */
|
/* Show the register value read */
|
||||||
|
|
||||||
llerr("%08x->%08x\n", addr, val);
|
caninfo("%08x->%08x\n", addr, val);
|
||||||
return 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)
|
static void can_vputreg(uint32_t addr, uint32_t value)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Show the register value being written */
|
/* Show the register value being written */
|
||||||
|
|
||||||
llerr("%08x<-%08x\n", addr, value);
|
caninfo("%08x<-%08x\n", addr, value);
|
||||||
|
|
||||||
/* Write the 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,
|
static void can_dumpctrlregs(FAR struct stm32_can_s *priv,
|
||||||
FAR const char *msg)
|
FAR const char *msg)
|
||||||
{
|
{
|
||||||
if (msg)
|
if (msg)
|
||||||
{
|
{
|
||||||
canllerr("Control Registers: %s\n", msg);
|
caninfo("Control Registers: %s\n", msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
canllerr("Control Registers:\n");
|
caninfo("Control Registers:\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CAN control and status registers */
|
/* CAN control and status registers */
|
||||||
|
|
||||||
llerr(" MCR: %08x MSR: %08x TSR: %08x\n",
|
caninfo(" MCR: %08x MSR: %08x TSR: %08x\n",
|
||||||
getreg32(priv->base + STM32_CAN_MCR_OFFSET),
|
getreg32(priv->base + STM32_CAN_MCR_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_MSR_OFFSET),
|
getreg32(priv->base + STM32_CAN_MSR_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_TSR_OFFSET));
|
getreg32(priv->base + STM32_CAN_TSR_OFFSET));
|
||||||
|
|
||||||
llerr(" RF0R: %08x RF1R: %08x\n",
|
caninfo(" RF0R: %08x RF1R: %08x\n",
|
||||||
getreg32(priv->base + STM32_CAN_RF0R_OFFSET),
|
getreg32(priv->base + STM32_CAN_RF0R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_RF1R_OFFSET));
|
getreg32(priv->base + STM32_CAN_RF1R_OFFSET));
|
||||||
|
|
||||||
llerr(" IER: %08x ESR: %08x BTR: %08x\n",
|
caninfo(" IER: %08x ESR: %08x BTR: %08x\n",
|
||||||
getreg32(priv->base + STM32_CAN_IER_OFFSET),
|
getreg32(priv->base + STM32_CAN_IER_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_ESR_OFFSET),
|
getreg32(priv->base + STM32_CAN_ESR_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_BTR_OFFSET));
|
getreg32(priv->base + STM32_CAN_BTR_OFFSET));
|
||||||
}
|
}
|
||||||
#endif
|
#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,
|
static void can_dumpmbregs(FAR struct stm32_can_s *priv,
|
||||||
FAR const char *msg)
|
FAR const char *msg)
|
||||||
{
|
{
|
||||||
if (msg)
|
if (msg)
|
||||||
{
|
{
|
||||||
canllerr("Mailbox Registers: %s\n", msg);
|
caninfo("Mailbox Registers: %s\n", msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
canllerr("Mailbox Registers:\n");
|
caninfo("Mailbox Registers:\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CAN mailbox registers (3 TX and 2 RX) */
|
/* CAN mailbox registers (3 TX and 2 RX) */
|
||||||
|
|
||||||
llerr(" TI0R: %08x TDT0R: %08x TDL0R: %08x TDH0R: %08x\n",
|
caninfo(" TI0R: %08x TDT0R: %08x TDL0R: %08x TDH0R: %08x\n",
|
||||||
getreg32(priv->base + STM32_CAN_TI0R_OFFSET),
|
getreg32(priv->base + STM32_CAN_TI0R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_TDT0R_OFFSET),
|
getreg32(priv->base + STM32_CAN_TDT0R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_TDL0R_OFFSET),
|
getreg32(priv->base + STM32_CAN_TDL0R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_TDH0R_OFFSET));
|
getreg32(priv->base + STM32_CAN_TDH0R_OFFSET));
|
||||||
|
|
||||||
llerr(" TI1R: %08x TDT1R: %08x TDL1R: %08x TDH1R: %08x\n",
|
caninfo(" TI1R: %08x TDT1R: %08x TDL1R: %08x TDH1R: %08x\n",
|
||||||
getreg32(priv->base + STM32_CAN_TI1R_OFFSET),
|
getreg32(priv->base + STM32_CAN_TI1R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_TDT1R_OFFSET),
|
getreg32(priv->base + STM32_CAN_TDT1R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_TDL1R_OFFSET),
|
getreg32(priv->base + STM32_CAN_TDL1R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_TDH1R_OFFSET));
|
getreg32(priv->base + STM32_CAN_TDH1R_OFFSET));
|
||||||
|
|
||||||
llerr(" TI2R: %08x TDT2R: %08x TDL2R: %08x TDH2R: %08x\n",
|
caninfo(" TI2R: %08x TDT2R: %08x TDL2R: %08x TDH2R: %08x\n",
|
||||||
getreg32(priv->base + STM32_CAN_TI2R_OFFSET),
|
getreg32(priv->base + STM32_CAN_TI2R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_TDT2R_OFFSET),
|
getreg32(priv->base + STM32_CAN_TDT2R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_TDL2R_OFFSET),
|
getreg32(priv->base + STM32_CAN_TDL2R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_TDH2R_OFFSET));
|
getreg32(priv->base + STM32_CAN_TDH2R_OFFSET));
|
||||||
|
|
||||||
llerr(" RI0R: %08x RDT0R: %08x RDL0R: %08x RDH0R: %08x\n",
|
caninfo(" RI0R: %08x RDT0R: %08x RDL0R: %08x RDH0R: %08x\n",
|
||||||
getreg32(priv->base + STM32_CAN_RI0R_OFFSET),
|
getreg32(priv->base + STM32_CAN_RI0R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_RDT0R_OFFSET),
|
getreg32(priv->base + STM32_CAN_RDT0R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_RDL0R_OFFSET),
|
getreg32(priv->base + STM32_CAN_RDL0R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_RDH0R_OFFSET));
|
getreg32(priv->base + STM32_CAN_RDH0R_OFFSET));
|
||||||
|
|
||||||
llerr(" RI1R: %08x RDT1R: %08x RDL1R: %08x RDH1R: %08x\n",
|
caninfo(" RI1R: %08x RDT1R: %08x RDL1R: %08x RDH1R: %08x\n",
|
||||||
getreg32(priv->base + STM32_CAN_RI1R_OFFSET),
|
getreg32(priv->base + STM32_CAN_RI1R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_RDT1R_OFFSET),
|
getreg32(priv->base + STM32_CAN_RDT1R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_RDL1R_OFFSET),
|
getreg32(priv->base + STM32_CAN_RDL1R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_RDH1R_OFFSET));
|
getreg32(priv->base + STM32_CAN_RDH1R_OFFSET));
|
||||||
}
|
}
|
||||||
#endif
|
#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,
|
static void can_dumpfiltregs(FAR struct stm32_can_s *priv,
|
||||||
FAR const char *msg)
|
FAR const char *msg)
|
||||||
{
|
{
|
||||||
@ -510,25 +495,25 @@ static void can_dumpfiltregs(FAR struct stm32_can_s *priv,
|
|||||||
|
|
||||||
if (msg)
|
if (msg)
|
||||||
{
|
{
|
||||||
canllerr("Filter Registers: %s\n", msg);
|
caninfo("Filter Registers: %s\n", msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
canllerr("Filter Registers:\n");
|
caninfo("Filter Registers:\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
llerr(" FMR: %08x FM1R: %08x FS1R: %08x FFA1R: %08x FA1R: %08x\n",
|
caninfo(" FMR: %08x FM1R: %08x FS1R: %08x FFA1R: %08x FA1R: %08x\n",
|
||||||
getreg32(priv->base + STM32_CAN_FMR_OFFSET),
|
getreg32(priv->base + STM32_CAN_FMR_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_FM1R_OFFSET),
|
getreg32(priv->base + STM32_CAN_FM1R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_FS1R_OFFSET),
|
getreg32(priv->base + STM32_CAN_FS1R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_FFA1R_OFFSET),
|
getreg32(priv->base + STM32_CAN_FFA1R_OFFSET),
|
||||||
getreg32(priv->base + STM32_CAN_FA1R_OFFSET));
|
getreg32(priv->base + STM32_CAN_FA1R_OFFSET));
|
||||||
|
|
||||||
for (i = 0; i < CAN_NFILTERS; i++)
|
for (i = 0; i < CAN_NFILTERS; i++)
|
||||||
{
|
{
|
||||||
llerr(" F%dR1: %08x F%dR2: %08x\n",
|
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, 1)),
|
||||||
i, getreg32(priv->base + STM32_CAN_FIR_OFFSET(i, 2)));
|
i, getreg32(priv->base + STM32_CAN_FIR_OFFSET(i, 2)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -574,7 +559,7 @@ static void can_reset(FAR struct can_dev_s *dev)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
canllerr("Unsupported port %d\n", priv->port);
|
canerr("ERROR: Unsupported port %d\n", priv->port);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -625,7 +610,7 @@ static int can_setup(FAR struct can_dev_s *dev)
|
|||||||
ret = can_cellinit(priv);
|
ret = can_cellinit(priv);
|
||||||
if (ret < 0)
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -637,7 +622,7 @@ static int can_setup(FAR struct can_dev_s *dev)
|
|||||||
ret = can_filterinit(priv);
|
ret = can_filterinit(priv);
|
||||||
if (ret < 0)
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
can_dumpfiltregs(priv, "After filter initialization");
|
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);
|
ret = irq_attach(priv->canrx[0], can_rx0interrupt);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
canllerr("Failed to attach CAN%d RX0 IRQ (%d)",
|
canerr(ERROR: "Failed to attach CAN%d RX0 IRQ (%d)",
|
||||||
priv->port, priv->canrx[0]);
|
priv->port, priv->canrx[0]);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = irq_attach(priv->canrx[1], can_rx1interrupt);
|
ret = irq_attach(priv->canrx[1], can_rx1interrupt);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
canllerr("Failed to attach CAN%d RX1 IRQ (%d)",
|
canerr("ERROR: Failed to attach CAN%d RX1 IRQ (%d)",
|
||||||
priv->port, priv->canrx[1]);
|
priv->port, priv->canrx[1]);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = irq_attach(priv->cantx, can_txinterrupt);
|
ret = irq_attach(priv->cantx, can_txinterrupt);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
canllerr("Failed to attach CAN%d TX IRQ (%d)",
|
canerr("ERROR: Failed to attach CAN%d TX IRQ (%d)",
|
||||||
priv->port, priv->cantx);
|
priv->port, priv->cantx);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -878,7 +863,7 @@ static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
canllerr("ERROR: No available mailbox\n");
|
canerr("ERROR: No available mailbox\n");
|
||||||
return -EBUSY;
|
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;
|
npending = (regval & CAN_RFR_FMP_MASK) >> CAN_RFR_FMP_SHIFT;
|
||||||
if (npending < 1)
|
if (npending < 1)
|
||||||
{
|
{
|
||||||
canllerr("WARNING: No messages pending\n");
|
canwarn("WARNING: No messages pending\n");
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1130,7 +1115,7 @@ static int can_rxinterrupt(int irq, FAR void *context, int rxmb)
|
|||||||
#else
|
#else
|
||||||
if ((regval & CAN_RIR_IDE) != 0)
|
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;
|
ret = -ENOSYS;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
@ -1520,7 +1505,7 @@ static int can_cellinit(FAR struct stm32_can_s *priv)
|
|||||||
|
|
||||||
if (timeout < 1)
|
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;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1544,7 +1529,7 @@ static int can_cellinit(FAR struct stm32_can_s *priv)
|
|||||||
ret = can_bittiming(priv);
|
ret = can_bittiming(priv);
|
||||||
if (ret < 0)
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1571,8 +1556,8 @@ static int can_cellinit(FAR struct stm32_can_s *priv)
|
|||||||
|
|
||||||
if (timeout < 1)
|
if (timeout < 1)
|
||||||
{
|
{
|
||||||
canllerr("ERROR: Timed out waiting to exit initialization mode: %08x\n",
|
canerr("ERROR: Timed out waiting to exit initialization mode: %08x\n",
|
||||||
regval);
|
regval);
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
|
@ -53,21 +53,6 @@
|
|||||||
* Pre-processor Definitions
|
* 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 **********************************************************************/
|
/* Peripherals **********************************************************************/
|
||||||
|
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
|
@ -82,23 +82,8 @@
|
|||||||
|
|
||||||
#define CAN_BIT_QUANTA (CONFIG_CAN_TSEG1 + CONFIG_CAN_TSEG2 + 1)
|
#define CAN_BIT_QUANTA (CONFIG_CAN_TSEG1 + CONFIG_CAN_TSEG2 + 1)
|
||||||
|
|
||||||
/* Debug ********************************************************************/
|
#ifndef CONFIG_DEBUG_CAN_INFO
|
||||||
/* Non-standard debug that may be enabled just for testing CAN */
|
# undef CONFIG_STM32_CAN_REGDEBUG
|
||||||
|
|
||||||
#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
|
|
||||||
#endif
|
#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 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_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);
|
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_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_dumpmbregs(struct stm32l4_can_s *priv, FAR const char *msg);
|
||||||
static void can_dumpfiltregs(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 can_vgetreg(uint32_t addr)
|
||||||
{
|
{
|
||||||
static uint32_t prevaddr = 0;
|
static uint32_t prevaddr = 0;
|
||||||
@ -237,7 +222,7 @@ static uint32_t can_vgetreg(uint32_t addr)
|
|||||||
{
|
{
|
||||||
if (count == 4)
|
if (count == 4)
|
||||||
{
|
{
|
||||||
llerr("...\n");
|
caninfo("...\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
@ -254,7 +239,7 @@ static uint32_t can_vgetreg(uint32_t addr)
|
|||||||
{
|
{
|
||||||
/* Yes.. then show how many times the value repeated */
|
/* 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 */
|
/* Save the new address, value, and count */
|
||||||
@ -266,7 +251,7 @@ static uint32_t can_vgetreg(uint32_t addr)
|
|||||||
|
|
||||||
/* Show the register value read */
|
/* Show the register value read */
|
||||||
|
|
||||||
llerr("%08x->%08x\n", addr, val);
|
caninfo("%08x->%08x\n", addr, val);
|
||||||
return 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)
|
static void can_vputreg(uint32_t addr, uint32_t value)
|
||||||
{
|
{
|
||||||
/* Show the register value being written */
|
/* Show the register value being written */
|
||||||
|
|
||||||
llerr("%08x<-%08x\n", addr, value);
|
caninfo("%08x<-%08x\n", addr, value);
|
||||||
|
|
||||||
/* Write the 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)
|
static void can_dumpctrlregs(struct stm32l4_can_s *priv, FAR const char *msg)
|
||||||
{
|
{
|
||||||
if (msg)
|
if (msg)
|
||||||
{
|
{
|
||||||
canllerr("Control Registers: %s\n", msg);
|
caninfo("Control Registers: %s\n", msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
canllerr("Control Registers:\n");
|
caninfo("Control Registers:\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CAN control and status registers */
|
/* CAN control and status registers */
|
||||||
|
|
||||||
llerr(" MCR: %08x MSR: %08x TSR: %08x\n",
|
caninfo(" MCR: %08x MSR: %08x TSR: %08x\n",
|
||||||
getreg32(priv->base + STM32L4_CAN_MCR_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_MCR_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_MSR_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_MSR_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_TSR_OFFSET));
|
getreg32(priv->base + STM32L4_CAN_TSR_OFFSET));
|
||||||
|
|
||||||
llerr(" RF0R: %08x RF1R: %08x\n",
|
caninfo(" RF0R: %08x RF1R: %08x\n",
|
||||||
getreg32(priv->base + STM32L4_CAN_RF0R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_RF0R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_RF1R_OFFSET));
|
getreg32(priv->base + STM32L4_CAN_RF1R_OFFSET));
|
||||||
|
|
||||||
llerr(" IER: %08x ESR: %08x BTR: %08x\n",
|
caninfo(" IER: %08x ESR: %08x BTR: %08x\n",
|
||||||
getreg32(priv->base + STM32L4_CAN_IER_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_IER_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_ESR_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_ESR_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_BTR_OFFSET));
|
getreg32(priv->base + STM32L4_CAN_BTR_OFFSET));
|
||||||
}
|
}
|
||||||
#endif
|
#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)
|
static void can_dumpmbregs(struct stm32l4_can_s *priv, FAR const char *msg)
|
||||||
{
|
{
|
||||||
if (msg)
|
if (msg)
|
||||||
{
|
{
|
||||||
canllerr("Mailbox Registers: %s\n", msg);
|
caninfo("Mailbox Registers: %s\n", msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
canllerr("Mailbox Registers:\n");
|
caninfo("Mailbox Registers:\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CAN mailbox registers (3 TX and 2 RX) */
|
/* CAN mailbox registers (3 TX and 2 RX) */
|
||||||
|
|
||||||
llerr(" TI0R: %08x TDT0R: %08x TDL0R: %08x TDH0R: %08x\n",
|
caninfo(" TI0R: %08x TDT0R: %08x TDL0R: %08x TDH0R: %08x\n",
|
||||||
getreg32(priv->base + STM32L4_CAN_TI0R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_TI0R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_TDT0R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_TDT0R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_TDL0R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_TDL0R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_TDH0R_OFFSET));
|
getreg32(priv->base + STM32L4_CAN_TDH0R_OFFSET));
|
||||||
|
|
||||||
llerr(" TI1R: %08x TDT1R: %08x TDL1R: %08x TDH1R: %08x\n",
|
caninfo(" TI1R: %08x TDT1R: %08x TDL1R: %08x TDH1R: %08x\n",
|
||||||
getreg32(priv->base + STM32L4_CAN_TI1R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_TI1R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_TDT1R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_TDT1R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_TDL1R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_TDL1R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_TDH1R_OFFSET));
|
getreg32(priv->base + STM32L4_CAN_TDH1R_OFFSET));
|
||||||
|
|
||||||
llerr(" TI2R: %08x TDT2R: %08x TDL2R: %08x TDH2R: %08x\n",
|
caninfo(" TI2R: %08x TDT2R: %08x TDL2R: %08x TDH2R: %08x\n",
|
||||||
getreg32(priv->base + STM32L4_CAN_TI2R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_TI2R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_TDT2R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_TDT2R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_TDL2R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_TDL2R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_TDH2R_OFFSET));
|
getreg32(priv->base + STM32L4_CAN_TDH2R_OFFSET));
|
||||||
|
|
||||||
llerr(" RI0R: %08x RDT0R: %08x RDL0R: %08x RDH0R: %08x\n",
|
caninfo(" RI0R: %08x RDT0R: %08x RDL0R: %08x RDH0R: %08x\n",
|
||||||
getreg32(priv->base + STM32L4_CAN_RI0R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_RI0R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_RDT0R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_RDT0R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_RDL0R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_RDL0R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_RDH0R_OFFSET));
|
getreg32(priv->base + STM32L4_CAN_RDH0R_OFFSET));
|
||||||
|
|
||||||
llerr(" RI1R: %08x RDT1R: %08x RDL1R: %08x RDH1R: %08x\n",
|
caninfo(" RI1R: %08x RDT1R: %08x RDL1R: %08x RDH1R: %08x\n",
|
||||||
getreg32(priv->base + STM32L4_CAN_RI1R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_RI1R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_RDT1R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_RDT1R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_RDL1R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_RDL1R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_RDH1R_OFFSET));
|
getreg32(priv->base + STM32L4_CAN_RDH1R_OFFSET));
|
||||||
}
|
}
|
||||||
#endif
|
#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)
|
static void can_dumpfiltregs(struct stm32l4_can_s *priv, FAR const char *msg)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (msg)
|
if (msg)
|
||||||
{
|
{
|
||||||
canllerr("Filter Registers: %s\n", msg);
|
caninfo("Filter Registers: %s\n", msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
canllerr("Filter Registers:\n");
|
caninfo("Filter Registers:\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
llerr(" FMR: %08x FM1R: %08x FS1R: %08x FFA1R: %08x FA1R: %08x\n",
|
caninfo(" FMR: %08x FM1R: %08x FS1R: %08x FFA1R: %08x FA1R: %08x\n",
|
||||||
getreg32(priv->base + STM32L4_CAN_FMR_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_FMR_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_FM1R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_FM1R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_FS1R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_FS1R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_FFA1R_OFFSET),
|
getreg32(priv->base + STM32L4_CAN_FFA1R_OFFSET),
|
||||||
getreg32(priv->base + STM32L4_CAN_FA1R_OFFSET));
|
getreg32(priv->base + STM32L4_CAN_FA1R_OFFSET));
|
||||||
|
|
||||||
for (i = 0; i < CAN_NFILTERS; i++)
|
for (i = 0; i < CAN_NFILTERS; i++)
|
||||||
{
|
{
|
||||||
llerr(" F%dR1: %08x F%dR2: %08x\n",
|
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, 1)),
|
||||||
i, getreg32(priv->base + STM32L4_CAN_FIR_OFFSET(i, 2)));
|
i, getreg32(priv->base + STM32L4_CAN_FIR_OFFSET(i, 2)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -526,7 +511,7 @@ static void can_reset(FAR struct can_dev_s *dev)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
canllerr("Unsupported port %d\n", priv->port);
|
canerr("ERROR: Unsupported port %d\n", priv->port);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -576,7 +561,7 @@ static int can_setup(FAR struct can_dev_s *dev)
|
|||||||
ret = can_cellinit(priv);
|
ret = can_cellinit(priv);
|
||||||
if (ret < 0)
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -588,7 +573,7 @@ static int can_setup(FAR struct can_dev_s *dev)
|
|||||||
ret = can_filterinit(priv);
|
ret = can_filterinit(priv);
|
||||||
if (ret < 0)
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -599,14 +584,14 @@ static int can_setup(FAR struct can_dev_s *dev)
|
|||||||
ret = irq_attach(priv->canrx0, can_rx0interrupt);
|
ret = irq_attach(priv->canrx0, can_rx0interrupt);
|
||||||
if (ret < 0)
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = irq_attach(priv->cantx, can_txinterrupt);
|
ret = irq_attach(priv->cantx, can_txinterrupt);
|
||||||
if (ret < 0)
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -815,7 +800,7 @@ static int can_send(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
canllerr("ERROR: No available mailbox\n");
|
canerr("ERROR: No available mailbox\n");
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1029,7 +1014,7 @@ static int can_rx0interrupt(int irq, void *context)
|
|||||||
npending = (regval & CAN_RFR_FMP_MASK) >> CAN_RFR_FMP_SHIFT;
|
npending = (regval & CAN_RFR_FMP_MASK) >> CAN_RFR_FMP_SHIFT;
|
||||||
if (npending < 1)
|
if (npending < 1)
|
||||||
{
|
{
|
||||||
canllerr("WARNING: No messages pending\n");
|
canwarn("WARNING: No messages pending\n");
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1053,7 +1038,7 @@ static int can_rx0interrupt(int irq, void *context)
|
|||||||
#else
|
#else
|
||||||
if ((regval & CAN_RIR_IDE) != 0)
|
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;
|
ret = -ENOSYS;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
@ -1392,7 +1377,7 @@ static int can_cellinit(struct stm32l4_can_s *priv)
|
|||||||
|
|
||||||
if (timeout < 1)
|
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;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1415,7 +1400,7 @@ static int can_cellinit(struct stm32l4_can_s *priv)
|
|||||||
ret = can_bittiming(priv);
|
ret = can_bittiming(priv);
|
||||||
if (ret < 0)
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1442,7 +1427,7 @@ static int can_cellinit(struct stm32l4_can_s *priv)
|
|||||||
|
|
||||||
if (timeout < 1)
|
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 -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -651,7 +651,7 @@ Cloudctrl-specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
Cloudctrl LCD Hardware Configuration
|
Cloudctrl LCD Hardware Configuration
|
||||||
|
@ -758,7 +758,7 @@ M3 Wildfire-specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
M3 Wildfire LCD Hardware Configuration
|
M3 Wildfire LCD Hardware Configuration
|
||||||
|
@ -502,7 +502,7 @@ HY-Mini specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
HY-MiniSTM32V LCD Hardware Configuration. The HY-Mini board may be delivered with
|
HY-MiniSTM32V LCD Hardware Configuration. The HY-Mini board may be delivered with
|
||||||
|
@ -660,7 +660,7 @@ Mikroe-STM32F4-specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
Mikroe-STM32F4 SPI Configuration
|
Mikroe-STM32F4 SPI Configuration
|
||||||
|
@ -52,37 +52,6 @@
|
|||||||
|
|
||||||
#if defined(CONFIG_CAN) && defined(CONFIG_STM32_CAN1)
|
#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
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -73,25 +73,6 @@
|
|||||||
# define CAN_PORT 2
|
# define CAN_PORT 2
|
||||||
#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
|
|
||||||
|
|
||||||
/************************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
************************************************************************************/
|
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -65,25 +65,6 @@
|
|||||||
# define CAN_PORT 2
|
# define CAN_PORT 2
|
||||||
#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
|
|
||||||
|
|
||||||
/************************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
************************************************************************************/
|
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -65,21 +65,6 @@
|
|||||||
# define CAN_PORT 2
|
# define CAN_PORT 2
|
||||||
#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
|
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -61,25 +61,6 @@
|
|||||||
|
|
||||||
#define CAN_PORT 1
|
#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
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -65,25 +65,6 @@
|
|||||||
# define CAN_PORT 2
|
# define CAN_PORT 2
|
||||||
#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
|
|
||||||
|
|
||||||
/************************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
************************************************************************************/
|
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -64,25 +64,6 @@
|
|||||||
|
|
||||||
#define CAN_PORT 1
|
#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
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -69,25 +69,6 @@
|
|||||||
# define CAN_PORT 1
|
# define CAN_PORT 1
|
||||||
#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
|
|
||||||
|
|
||||||
/************************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
************************************************************************************/
|
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -69,25 +69,6 @@
|
|||||||
# define CAN_PORT 1
|
# define CAN_PORT 1
|
||||||
#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
|
|
||||||
|
|
||||||
/************************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
************************************************************************************/
|
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -747,7 +747,7 @@ MCAN1 Loopback Test
|
|||||||
Build Setup -> Debug Options
|
Build Setup -> Debug Options
|
||||||
CONFIG_DEBUG_FEATURES=y # Enables general debug features
|
CONFIG_DEBUG_FEATURES=y # Enables general debug features
|
||||||
CONFIG_DEBUG_INFO=y # Enables verbose output
|
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_STACK_COLORATION=y # Monitor stack usage
|
||||||
CONFIG_DEBUG_SYMBOLS=y # Needed only for use with a debugger
|
CONFIG_DEBUG_SYMBOLS=y # Needed only for use with a debugger
|
||||||
|
@ -67,21 +67,6 @@
|
|||||||
# define CAN_PORT 1
|
# define CAN_PORT 1
|
||||||
#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
|
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -1337,7 +1337,7 @@ MCAN1 Loopback Test
|
|||||||
Build Setup -> Debug Options
|
Build Setup -> Debug Options
|
||||||
CONFIG_DEBUG_FEATURES=y # Enables general debug features
|
CONFIG_DEBUG_FEATURES=y # Enables general debug features
|
||||||
CONFIG_DEBUG_INFO=y # Enables verbose output
|
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_STACK_COLORATION=y # Monitor stack usage
|
||||||
CONFIG_DEBUG_SYMBOLS=y # Needed only for use with a debugger
|
CONFIG_DEBUG_SYMBOLS=y # Needed only for use with a debugger
|
||||||
|
@ -67,21 +67,6 @@
|
|||||||
# define CAN_PORT 1
|
# define CAN_PORT 1
|
||||||
#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
|
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -668,7 +668,7 @@ Shenzhou-specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
Shenzhou LCD Hardware Configuration
|
Shenzhou LCD Hardware Configuration
|
||||||
|
@ -62,25 +62,6 @@
|
|||||||
|
|
||||||
#define CAN_PORT 1
|
#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
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -657,7 +657,7 @@ STM3210E-EVAL-specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
STM3210E-EVAL LCD Hardware Configuration
|
STM3210E-EVAL LCD Hardware Configuration
|
||||||
|
@ -62,25 +62,6 @@
|
|||||||
|
|
||||||
#define CAN_PORT 1
|
#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
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -486,7 +486,7 @@ Configuration Options:
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
FSMC SRAM
|
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_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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
STM3220G-EVAL LCD Hardware Configuration
|
STM3220G-EVAL LCD Hardware Configuration
|
||||||
@ -1003,8 +1003,8 @@ Where <subdir> is one of the following:
|
|||||||
|
|
||||||
Special CAN-only debug options:
|
Special CAN-only debug options:
|
||||||
|
|
||||||
CONFIG_DEBUG_CAN
|
CONFIG_DEBUG_CAN_INFO
|
||||||
CONFIG_CAN_REGDEBUG
|
CONFIG_STM32_CAN_REGDEBUG
|
||||||
|
|
||||||
6. This example can support an FTP client. In order to build in FTP client
|
6. This example can support an FTP client. In order to build in FTP client
|
||||||
support simply reconfigure NuttX, adding:
|
support simply reconfigure NuttX, adding:
|
||||||
|
@ -70,25 +70,6 @@
|
|||||||
# define CAN_PORT 2
|
# define CAN_PORT 2
|
||||||
#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
|
|
||||||
|
|
||||||
/************************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
************************************************************************************/
|
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -382,7 +382,7 @@ Configuration Options:
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
FPU
|
FPU
|
||||||
@ -810,7 +810,7 @@ STM3240G-EVAL-specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
STM3240G-EVAL LCD Hardware Configuration
|
STM3240G-EVAL LCD Hardware Configuration
|
||||||
@ -1179,8 +1179,8 @@ Where <subdir> is one of the following:
|
|||||||
|
|
||||||
Special CAN-only debug options:
|
Special CAN-only debug options:
|
||||||
|
|
||||||
CONFIG_DEBUG_CAN
|
CONFIG_DEBUG_CAN_INFO
|
||||||
CONFIG_CAN_REGDEBUG
|
CONFIG_STM32_CAN_REGDEBUG
|
||||||
|
|
||||||
6. This example can support an FTP client. In order to build in FTP client
|
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
|
support simply uncomment the following lines in the defconfig file (before
|
||||||
|
@ -70,25 +70,6 @@
|
|||||||
# define CAN_PORT 2
|
# define CAN_PORT 2
|
||||||
#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
|
|
||||||
|
|
||||||
/************************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
************************************************************************************/
|
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -493,7 +493,7 @@ STM32 Tiny - specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
STM32Tiny SPI Configuration
|
STM32Tiny SPI Configuration
|
||||||
|
@ -392,7 +392,7 @@ STM32F103 Minimum - specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
STM32F103 Minimum SPI Configuration
|
STM32F103 Minimum SPI Configuration
|
||||||
|
@ -637,7 +637,7 @@ STM32F3Discovery-specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
STM32F3Discovery SPI Configuration
|
STM32F3Discovery SPI Configuration
|
||||||
|
@ -533,7 +533,7 @@ STM32F429I-DISCO-specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
STM32F429I-DISCO SPI Configuration
|
STM32F429I-DISCO SPI Configuration
|
||||||
|
@ -1024,7 +1024,7 @@ STM32F4Discovery-specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
STM32F4Discovery SPI Configuration
|
STM32F4Discovery SPI Configuration
|
||||||
|
@ -416,7 +416,7 @@ STM32F746G-DISCO-specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32F7_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
STM32F746G-DISCO SPI Configuration
|
STM32F746G-DISCO SPI Configuration
|
||||||
|
@ -707,7 +707,7 @@ STM32L-Discovery-specific Configuration Options
|
|||||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_STM32_CAN2 is defined.
|
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_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_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.
|
dump of all CAN registers.
|
||||||
|
|
||||||
STM32L-Discovery SPI Configuration
|
STM32L-Discovery SPI Configuration
|
||||||
|
@ -61,25 +61,6 @@
|
|||||||
|
|
||||||
#define CAN_PORT 1
|
#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
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -62,29 +62,10 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
/* Configuration ********************************************************************/
|
/* Configuration ********************************************************************/
|
||||||
|
|
||||||
#define CAN_PORT1 1
|
#define CAN_PORT1 1
|
||||||
#define CAN_PORT2 2
|
#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
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
@ -96,21 +96,6 @@
|
|||||||
# endif
|
# endif
|
||||||
#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 *******************************************************/
|
/* Timing Definitions *******************************************************/
|
||||||
|
|
||||||
#define HALF_SECOND_MSEC 500
|
#define HALF_SECOND_MSEC 500
|
||||||
|
@ -405,6 +405,30 @@
|
|||||||
# define allinfo(x...)
|
# define allinfo(x...)
|
||||||
#endif
|
#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
|
#ifdef CONFIG_DEBUG_GRAPHICS_ERROR
|
||||||
# define gerr(format, ...) err(format, ##__VA_ARGS__)
|
# define gerr(format, ...) err(format, ##__VA_ARGS__)
|
||||||
# define gllerr(format, ...) llerr(format, ##__VA_ARGS__)
|
# define gllerr(format, ...) llerr(format, ##__VA_ARGS__)
|
||||||
@ -922,6 +946,30 @@
|
|||||||
# define allinfo (void)
|
# define allinfo (void)
|
||||||
#endif
|
#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
|
#ifdef CONFIG_DEBUG_GRAPHICS_ERROR
|
||||||
# define gerr err
|
# define gerr err
|
||||||
# define gllerr llerr
|
# define gllerr llerr
|
||||||
@ -1260,6 +1308,22 @@
|
|||||||
# define iinfodumpbuffer(m,b,n)
|
# define iinfodumpbuffer(m,b,n)
|
||||||
#endif
|
#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
|
#ifdef CONFIG_DEBUG_GRAPHICS
|
||||||
# define gerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n)
|
# define gerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n)
|
||||||
# define ginfodumpbuffer(m,b,n) infodumpbuffer(m,b,n)
|
# define ginfodumpbuffer(m,b,n) infodumpbuffer(m,b,n)
|
||||||
|
Loading…
Reference in New Issue
Block a user