## App name
#
APPLICATION = gtip-test-can
## Target
#
BOARD ?= nucleo-l476rg #nucleo-f413zh #nucleo-l476rg
## This has to be the absolute path to the RIOT base directory:
#
RIOTBASE ?= $(CURDIR)/../../RIOT/
## Chose the debug level: LOG_NONE, LOG_WARNING, LOG_ERROR, LOG_DEBUG, LOG_ALL
CFLAGS += -DLOG_LEVEL=LOG_DEBUG
CFLAGS += -DDEVELHELP
# Change this to 0 show compiler invocation lines by default:
QUIET ?= 1
# Modules to include:
USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += ps
USEMODULE += conn_can
USEMODULE += can_isotp
USEMODULE += conn_can_isotp_multi
USEMODULE += can_pm
USEMODULE += can_trx
FEATURES_REQUIRED += periph_can
FEATURES_REQUIRED += periph_gpio_irq
CFLAGS += -DGNRC_PKTBUF_SIZE=4096
CFLAGS += -DCAN_PKT_BUF_SIZE=64
CFLAGS += -DCAN_ROUTER_MAX_FILTER=32
CFLAGS += -I$(CURDIR)
include $(RIOTBASE)/Makefile.include
Iusse log:
~/mcu/gtip-riotos/test_04 (master) $ make clean all
Building application "gtip-test-can" for "nucleo-l476rg" with MCU "stm32l4".
"make" -C /home/giuseppe/mcu/RIOT/boards/nucleo-l476rg
"make" -C /home/giuseppe/mcu/RIOT/boards/common/nucleo
"make" -C /home/giuseppe/mcu/RIOT/core
"make" -C /home/giuseppe/mcu/RIOT/cpu/stm32l4
"make" -C /home/giuseppe/mcu/RIOT/cpu/cortexm_common
"make" -C /home/giuseppe/mcu/RIOT/cpu/cortexm_common/periph
"make" -C /home/giuseppe/mcu/RIOT/cpu/stm32_common
"make" -C /home/giuseppe/mcu/RIOT/cpu/stm32_common/periph
"make" -C /home/giuseppe/mcu/RIOT/cpu/stm32l4/periph
"make" -C /home/giuseppe/mcu/RIOT/drivers
"make" -C /home/giuseppe/mcu/RIOT/drivers/can_trx
"make" -C /home/giuseppe/mcu/RIOT/drivers/periph_common
"make" -C /home/giuseppe/mcu/RIOT/sys
"make" -C /home/giuseppe/mcu/RIOT/sys/auto_init
"make" -C /home/giuseppe/mcu/RIOT/sys/auto_init/can
In file included from /home/giuseppe/mcu/RIOT/sys/auto_init/can/auto_init_periph_can.c:21:
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:42:21: error: 'RCC_APB1ENR_CAN1EN' undeclared here (not in a function); did you mean 'RCC_APB1ENR1_CAN1EN'?
42 | .rcc_mask = RCC_APB1ENR_CAN1EN,
| ^~~~~~
| RCC_APB1ENR1_CAN1EN
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:43:10: error: 'can_conf_t' {aka 'const struct '} has no member named 'can_master'
43 | .can_master = CAN1,
| ^~~~~~
In file included from /home/giuseppe/mcu/RIOT/cpu/stm32l4/include/cpu_conf.h:31,
from /home/giuseppe/mcu/RIOT/core/include/thread.h:125,
from /home/giuseppe/mcu/RIOT/sys/include/can/common.h:37,
from /home/giuseppe/mcu/RIOT/drivers/include/can/candev.h:35,
from /home/giuseppe/mcu/RIOT/sys/include/can/device.h:27,
from /home/giuseppe/mcu/RIOT/sys/auto_init/can/auto_init_periph_can.c:20:
/home/giuseppe/mcu/RIOT/cpu/stm32l4/include/vendor/stm32l476xx.h:1350:29: error: initialization of 'long unsigned int' from 'CAN_TypeDef ' {aka 'struct '} makes integer from pointer without a cast [-Werror=int-conversion]
1350 | #define CAN1 ((CAN_TypeDef ) CAN1_BASE)
| ^
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:43:23: note: in expansion of macro 'CAN1'
43 | .can_master = CAN1,
| ^~~~
/home/giuseppe/mcu/RIOT/cpu/stm32l4/include/vendor/stm32l476xx.h:1350:29: note: (near initialization for 'candev_conf[0].rx_pin')
1350 | #define CAN1 ((CAN_TypeDef ) CAN1_BASE)
| ^
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:43:23: note: in expansion of macro 'CAN1'
43 | .can_master = CAN1,
| ^~~~
In file included from /home/giuseppe/mcu/RIOT/sys/auto_init/can/auto_init_periph_can.c:21:
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:44:10: error: 'can_conf_t' {aka 'const struct '} has no member named 'master_rcc_mask'
44 | .master_rcc_mask = RCC_APB1ENR_CAN1EN,
| ^~~~~~~
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:45:10: error: 'can_conf_t' {aka 'const struct '} has no member named 'first_filter'
45 | .first_filter = 0,
| ^~~~
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:46:10: error: 'can_conf_t' {aka 'const struct '} has no member named 'nb_filters'
46 | .nb_filters = 14,
| ^~~~~~
In file included from /home/giuseppe/mcu/RIOT/cpu/stm32l4/include/periph_cpu.h:23,
from /home/giuseppe/mcu/RIOT/boards/nucleo-l476rg/include/periph_conf.h:26,
from /home/giuseppe/mcu/RIOT/boards/common/nucleo/include/board_nucleo.h:25,
from /home/giuseppe/mcu/RIOT/boards/common/nucleo64/include/board.h:25,
from /home/giuseppe/mcu/RIOT/sys/include/xtimer.h:41,
from /home/giuseppe/mcu/RIOT/sys/include/can/device.h:31,
from /home/giuseppe/mcu/RIOT/sys/auto_init/can/auto_init_periph_can.c:20:
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/periph_cpu_common.h:161:29: error: initialized field overwritten [-Werror=override-init]
161 | #define GPIO_PIN(x, y) ((GPIOA_BASE + (x << 10)) | y)
| ^
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:48:19: note: in expansion of macro 'GPIO_PIN'
48 | .rx_pin = GPIO_PIN(PORT_D, 0),
| ^~~~
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/periph_cpu_common.h:161:29: note: (near initialization for 'candev_conf[0].rx_pin')
161 | #define GPIO_PIN(x, y) ((GPIOA_BASE + (x << 10)) | y)
| ^
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:48:19: note: in expansion of macro 'GPIO_PIN'
48 | .rx_pin = GPIO_PIN(PORT_D, 0),
| ^~~~
In file included from /home/giuseppe/mcu/RIOT/sys/auto_init/can/auto_init_periph_can.c:21:
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:50:15: error: initialized field overwritten [-Werror=override-init]
50 | .af = GPIO_AF9,
| ^~~~
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:50:15: note: (near initialization for 'candev_conf[0].af')
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:55:20: error: initialized field overwritten [-Werror=override-init]
55 | .tx_irqn = CAN1_TX_IRQn,
| ^~~~
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:55:20: note: (near initialization for 'candev_conf[0].tx_irqn')
cc1: all warnings being treated as errors
make[4]: [/home/giuseppe/mcu/RIOT/Makefile.base:109: /home/giuseppe/mcu/gtip-riotos/test_04/bin/nucleo-l476rg/auto_init_can/auto_init_periph_can.o] Error 1
make[3]: [/home/giuseppe/mcu/RIOT/Makefile.base:29: ALL--/home/giuseppe/mcu/RIOT/sys/auto_init/can] Error 2
make[2]: [/home/giuseppe/mcu/RIOT/Makefile.base:29: ALL--/home/giuseppe/mcu/RIOT/sys/auto_init] Error 2
make[1]: [/home/giuseppe/mcu/RIOT/Makefile.base:29: ALL--/home/giuseppe/mcu/RIOT/sys] Error 2
make: *** [/home/giuseppe/mcu/gtip-riotos/test_04/../../RIOT//Makefile.include:540: /home/giuseppe/mcu/gtip-riotos/test_04/bin/nucleo-l476rg/application_gtip-test-can.a] Error 2
~/mcu/gtip-riotos/test_04 (master) $
5. Issues / missing feature
- the [candev_conf](https://github.com/RIOT-OS/RIOT/blob/master/cpu/stm32_common/include/can_params.h) missing the right setup for my target.
if my hypothesis is right I can try to fix it adding the support for stm32l4 target.
<!--
Example: Cannot build gnrc_networking application for samr21-xpro board.
-->
#### Steps to reproduce the issue
<!--
Try to describe as precisely as possible here the steps required to reproduce
the issue. Here you can also describe your hardware configuration, the network
setup, etc.
-->
#### Expected results
<!--
Example: The gnrc_networking application builds on samr21-xpro.
-->
#### Actual results
<!--
Please paste or specifically describe the actual output.
-->
#### Versions
<!--
Operating system: Mac OSX, Linux, Vagrant VM
Build environment: GCC, CLang versions (you can run the following command from
the RIOT base directory: make print-versions).
-->
<!-- Thanks for contributing! -->
Description
I'm trying to use a Nucleo-l476rg with CAN transceiver MCP2551:
TODO:
Add the missing feature to the board profile:
"make" -C /home/giuseppe/mcu/RIOT/boards/nucleo-l476rg "make" -C /home/giuseppe/mcu/RIOT/boards/common/nucleo "make" -C /home/giuseppe/mcu/RIOT/core "make" -C /home/giuseppe/mcu/RIOT/cpu/stm32l4 "make" -C /home/giuseppe/mcu/RIOT/cpu/cortexm_common "make" -C /home/giuseppe/mcu/RIOT/cpu/cortexm_common/periph "make" -C /home/giuseppe/mcu/RIOT/cpu/stm32_common "make" -C /home/giuseppe/mcu/RIOT/cpu/stm32_common/periph "make" -C /home/giuseppe/mcu/RIOT/cpu/stm32l4/periph "make" -C /home/giuseppe/mcu/RIOT/drivers "make" -C /home/giuseppe/mcu/RIOT/drivers/can_trx "make" -C /home/giuseppe/mcu/RIOT/drivers/periph_common "make" -C /home/giuseppe/mcu/RIOT/sys "make" -C /home/giuseppe/mcu/RIOT/sys/auto_init "make" -C /home/giuseppe/mcu/RIOT/sys/auto_init/can In file included from /home/giuseppe/mcu/RIOT/sys/auto_init/can/auto_init_periph_can.c:21: /home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:42:21: error: 'RCC_APB1ENR_CAN1EN' undeclared here (not in a function); did you mean 'RCC_APB1ENR1_CAN1EN'? 42 | .rcc_mask = RCC_APB1ENR_CAN1EN, | ^'} has no member named 'can_master'
43 | .can_master = CAN1,
| ^ '} makes integer from pointer without a cast [-Werror=int-conversion]
1350 | #define CAN1 ((CAN_TypeDef ) CAN1_BASE)
| ^
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:43:23: note: in expansion of macro 'CAN1'
43 | .can_master = CAN1,
| ^~~~
/home/giuseppe/mcu/RIOT/cpu/stm32l4/include/vendor/stm32l476xx.h:1350:29: note: (near initialization for 'candev_conf[0].rx_pin')
1350 | #define CAN1 ((CAN_TypeDef ) CAN1_BASE)
| ^
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:43:23: note: in expansion of macro 'CAN1'
43 | .can_master = CAN1,
| ^~~~
In file included from /home/giuseppe/mcu/RIOT/sys/auto_init/can/auto_init_periph_can.c:21:
/home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:44:10: error: 'can_conf_t' {aka 'const struct '} has no member named 'master_rcc_mask'
44 | .master_rcc_mask = RCC_APB1ENR_CAN1EN,
| ^'} has no member named 'first_filter'
45 | .first_filter = 0,
| ^'} has no member named 'nb_filters'
46 | .nb_filters = 14,
| ^
~~~~~ | RCC_APB1ENR1_CAN1EN /home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:43:10: error: 'can_conf_t' {aka 'const struct~~~~~ In file included from /home/giuseppe/mcu/RIOT/cpu/stm32l4/include/cpu_conf.h:31, from /home/giuseppe/mcu/RIOT/core/include/thread.h:125, from /home/giuseppe/mcu/RIOT/sys/include/can/common.h:37, from /home/giuseppe/mcu/RIOT/drivers/include/can/candev.h:35, from /home/giuseppe/mcu/RIOT/sys/include/can/device.h:27, from /home/giuseppe/mcu/RIOT/sys/auto_init/can/auto_init_periph_can.c:20: /home/giuseppe/mcu/RIOT/cpu/stm32l4/include/vendor/stm32l476xx.h:1350:29: error: initialization of 'long unsigned int' from 'CAN_TypeDef ' {aka 'struct~~~~~~ /home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:45:10: error: 'can_conf_t' {aka 'const struct~~~ /home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:46:10: error: 'can_conf_t' {aka 'const struct~~~~~ In file included from /home/giuseppe/mcu/RIOT/cpu/stm32l4/include/periph_cpu.h:23, from /home/giuseppe/mcu/RIOT/boards/nucleo-l476rg/include/periph_conf.h:26, from /home/giuseppe/mcu/RIOT/boards/common/nucleo/include/board_nucleo.h:25, from /home/giuseppe/mcu/RIOT/boards/common/nucleo64/include/board.h:25, from /home/giuseppe/mcu/RIOT/sys/include/xtimer.h:41, from /home/giuseppe/mcu/RIOT/sys/include/can/device.h:31, from /home/giuseppe/mcu/RIOT/sys/auto_init/can/auto_init_periph_can.c:20: /home/giuseppe/mcu/RIOT/cpu/stm32_common/include/periph_cpu_common.h:161:29: error: initialized field overwritten [-Werror=override-init] 161 | #define GPIO_PIN(x, y) ((GPIOA_BASE + (x << 10)) | y) | ^ /home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:48:19: note: in expansion of macro 'GPIO_PIN' 48 | .rx_pin = GPIO_PIN(PORT_D, 0), | ^~~~ /home/giuseppe/mcu/RIOT/cpu/stm32_common/include/periph_cpu_common.h:161:29: note: (near initialization for 'candev_conf[0].rx_pin') 161 | #define GPIO_PIN(x, y) ((GPIOA_BASE + (x << 10)) | y) | ^ /home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:48:19: note: in expansion of macro 'GPIO_PIN' 48 | .rx_pin = GPIO_PIN(PORT_D, 0), | ^~~~ In file included from /home/giuseppe/mcu/RIOT/sys/auto_init/can/auto_init_periph_can.c:21: /home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:50:15: error: initialized field overwritten [-Werror=override-init] 50 | .af = GPIO_AF9, | ^~~~ /home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:50:15: note: (near initialization for 'candev_conf[0].af') /home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:55:20: error: initialized field overwritten [-Werror=override-init] 55 | .tx_irqn = CAN1_TX_IRQn, | ^~~~ /home/giuseppe/mcu/RIOT/cpu/stm32_common/include/can_params.h:55:20: note: (near initialization for 'candev_conf[0].tx_irqn') cc1: all warnings being treated as errors make[4]: [/home/giuseppe/mcu/RIOT/Makefile.base:109: /home/giuseppe/mcu/gtip-riotos/test_04/bin/nucleo-l476rg/auto_init_can/auto_init_periph_can.o] Error 1 make[3]: [/home/giuseppe/mcu/RIOT/Makefile.base:29: ALL--/home/giuseppe/mcu/RIOT/sys/auto_init/can] Error 2 make[2]: [/home/giuseppe/mcu/RIOT/Makefile.base:29: ALL--/home/giuseppe/mcu/RIOT/sys/auto_init] Error 2 make[1]: [/home/giuseppe/mcu/RIOT/Makefile.base:29: ALL--/home/giuseppe/mcu/RIOT/sys] Error 2 make: *** [/home/giuseppe/mcu/gtip-riotos/test_04/../../RIOT//Makefile.include:540: /home/giuseppe/mcu/gtip-riotos/test_04/bin/nucleo-l476rg/application_gtip-test-can.a] Error 2 ~/mcu/gtip-riotos/test_04 (master) $