-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boards/nucleo-g431rb: add SocketCAN example
- Loading branch information
1 parent
d530842
commit 69372b7
Showing
5 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# | ||
# This file is autogenerated: PLEASE DO NOT EDIT IT. | ||
# | ||
# You can use "make menuconfig" to make any modifications to the installed .config file. | ||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your | ||
# modifications. | ||
# | ||
# CONFIG_NET_ETHERNET is not set | ||
# CONFIG_NET_IPv4 is not set | ||
CONFIG_ARCH="arm" | ||
CONFIG_ARCH_BOARD="nucleo-g431rb" | ||
CONFIG_ARCH_BOARD_NUCLEO_G431RB=y | ||
CONFIG_ARCH_BUTTONS=y | ||
CONFIG_ARCH_CHIP="stm32" | ||
CONFIG_ARCH_CHIP_STM32=y | ||
CONFIG_ARCH_CHIP_STM32G431R=y | ||
CONFIG_ARCH_INTERRUPTSTACK=1024 | ||
CONFIG_ARCH_STACKDUMP=y | ||
CONFIG_BOARD_LATE_INITIALIZE=y | ||
CONFIG_BOARD_LOOPSPERMSEC=8499 | ||
CONFIG_BOARD_NUCLEO_G431RB_USE_HSE=y | ||
CONFIG_BUILTIN=y | ||
CONFIG_DEFAULT_TASK_STACKSIZE=1024 | ||
CONFIG_FS_PROCFS=y | ||
CONFIG_INIT_ENTRYPOINT="nsh_main" | ||
CONFIG_INIT_STACKSIZE=2048 | ||
CONFIG_INTELHEX_BINARY=y | ||
CONFIG_IOB_BUFSIZE=128 | ||
CONFIG_IOB_NBUFFERS=10 | ||
CONFIG_NET=y | ||
CONFIG_NETDEVICES=y | ||
CONFIG_NETDEV_IFINDEX=y | ||
CONFIG_NETDEV_LATEINIT=y | ||
CONFIG_NET_CAN=y | ||
CONFIG_NET_SOCKOPTS=y | ||
CONFIG_NET_STATISTICS=y | ||
CONFIG_NSH_BUILTIN_APPS=y | ||
CONFIG_NSH_FILEIOSIZE=512 | ||
CONFIG_NSH_LINELEN=64 | ||
CONFIG_NSH_READLINE=y | ||
CONFIG_RAM_SIZE=22528 | ||
CONFIG_RAM_START=0x20000000 | ||
CONFIG_RAW_BINARY=y | ||
CONFIG_RR_INTERVAL=200 | ||
CONFIG_SCHED_LPWORK=y | ||
CONFIG_SCHED_WAITPID=y | ||
CONFIG_START_DAY=14 | ||
CONFIG_START_MONTH=10 | ||
CONFIG_START_YEAR=2014 | ||
CONFIG_STM32_FDCAN1=y | ||
CONFIG_STM32_FDCAN_SOCKET=y | ||
CONFIG_STM32_JTAG_SW_ENABLE=y | ||
CONFIG_STM32_USART2=y | ||
CONFIG_SYSTEM_NSH=y | ||
CONFIG_TASK_NAME_SIZE=0 | ||
CONFIG_USART2_SERIAL_CONSOLE=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/**************************************************************************** | ||
* boards/arm/stm32/nucleo-g431rb/src/stm32_cansock.c | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. The | ||
* ASF licenses this file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
****************************************************************************/ | ||
|
||
/**************************************************************************** | ||
* Included Files | ||
****************************************************************************/ | ||
|
||
#include <nuttx/config.h> | ||
|
||
#include <debug.h> | ||
|
||
#include "stm32_fdcan.h" | ||
|
||
/**************************************************************************** | ||
* Public Functions | ||
****************************************************************************/ | ||
|
||
/**************************************************************************** | ||
* Name: stm32_cansock_setup | ||
* | ||
* Description: | ||
* Initialize CAN socket interface | ||
* | ||
****************************************************************************/ | ||
|
||
int stm32_cansock_setup(void) | ||
{ | ||
int ret; | ||
|
||
/* Call stm32_fdcaninitialize() to get an instance of the FDCAN interface */ | ||
|
||
ret = stm32_fdcansockinitialize(1); | ||
if (ret < 0) | ||
{ | ||
canerr("ERROR: Failed to get FDCAN interface %d\n", ret); | ||
return ret; | ||
} | ||
|
||
return OK; | ||
} |