-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples: net: Add nucleo_g431rb specific files to run echo with T1S ETH
This development board - i.e. nucleo_g431rb (STM32G491) with MicroE's T1S LAN8651 module are used to test the eth_lan865x driver. Test HW: - nucleo_g491re development board from STM - Microe LAN8651 module (GPIO reset used) - LAN8670-USB dongle with debian12 as host Build: west build -p always -b nucleo_g431rb samples/net/sockets/echo_server/ \ -- -DCONF_FILE=boards/nucleo_g431rb.conf Test on host PC (one needs to first build echo-client program from net-tools): while :; do ./echo-client -r -i enx001ec0d1cc4d 192.168.3.3; sleep 1; \ ping -c3 192.168.3.3; done Signed-off-by: Lukasz Majewski <lukma@denx.de>
- Loading branch information
Lukasz Majewski
committed
Oct 6, 2023
1 parent
4099ded
commit c043401
Showing
2 changed files
with
81 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,52 @@ | ||
# Generic networking options | ||
CONFIG_NETWORKING=y | ||
CONFIG_NET_UDP=y | ||
CONFIG_NET_TCP=n | ||
CONFIG_NET_IPV6=n | ||
CONFIG_NET_IPV4=y | ||
CONFIG_NET_SOCKETS=y | ||
CONFIG_NET_SOCKETS_POSIX_NAMES=y | ||
CONFIG_POSIX_MAX_FDS=4 | ||
CONFIG_NET_CONNECTION_MANAGER=y | ||
|
||
# Kernel options | ||
CONFIG_MAIN_STACK_SIZE=2048 | ||
CONFIG_ENTROPY_GENERATOR=y | ||
CONFIG_TEST_RANDOM_GENERATOR=y | ||
CONFIG_INIT_STACKS=y | ||
|
||
# Logging | ||
CONFIG_NET_LOG=n | ||
CONFIG_LOG=n | ||
CONFIG_NET_STATISTICS=n | ||
CONFIG_PRINTK=n | ||
|
||
# Network buffers | ||
CONFIG_NET_PKT_RX_COUNT=4 | ||
CONFIG_NET_PKT_TX_COUNT=4 | ||
CONFIG_NET_BUF_RX_COUNT=24 | ||
CONFIG_NET_BUF_TX_COUNT=24 | ||
CONFIG_NET_CONTEXT_NET_PKT_POOL=y | ||
|
||
# IP address options | ||
CONFIG_NET_MAX_CONTEXTS=2 | ||
CONFIG_NET_MAX_CONN=2 | ||
|
||
# Network shell | ||
CONFIG_NET_SHELL=n | ||
CONFIG_SHELL=n | ||
|
||
# Network application options and configuration | ||
CONFIG_NET_CONFIG_SETTINGS=y | ||
CONFIG_NET_CONFIG_NEED_IPV4=y | ||
CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.168.3.3" | ||
CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.168.3.1" | ||
|
||
# How many client can connect to echo-server simultaneously | ||
CONFIG_NET_SAMPLE_NUM_HANDLERS=1 | ||
|
||
# LAN865x T1S driver specific | ||
CONFIG_NET_L2_ETHERNET=y | ||
# CONFIG_NET_PROMISCUOUS_MODE=y | ||
CONFIG_ETH_LAN865X=y | ||
CONFIG_NET_BUF_DATA_SIZE=64 |
29 changes: 29 additions & 0 deletions
29
samples/net/sockets/echo_server/boards/nucleo_g431rb.overlay
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,29 @@ | ||
/* | ||
* Copyright (c) 2023 DENX Software Engineering GmbH | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
&spi1 { | ||
eth0: lan865x@0{ | ||
compatible = "microchip,lan865x"; | ||
reg = <0>; | ||
|
||
int-gpios = <&arduino_header 13 GPIO_ACTIVE_LOW>; /* D7 */ | ||
rst-gpios = <&arduino_header 14 GPIO_ACTIVE_LOW>; /* D8 */ | ||
|
||
local-mac-address = [00 19 05 00 00 01]; | ||
|
||
spi-max-frequency = <25000000>; | ||
|
||
/* PLCA settings */ | ||
plca-enable; | ||
plca-node-id = <1>; | ||
plca-node-count = <8>; | ||
plca-burst-count = <0x0>; | ||
plca-burst-timer = <0x80>; | ||
plca-to-timer = <0x20>; | ||
|
||
status = "okay"; | ||
}; | ||
}; |