S32G can not send broadcast and can not recvice broadcast,please help to check network configure,
Hello, @liubin123
Thanks for the reply.
Since I cannot reproduce your issue from local S32GRDB2 with default images of BSP34.2, and it was mentioned previously that the RDB is used from your side, May I know have you ever tested the default pre-built images on your RDB?(you may directly download it from the www.NXP.com under your account) Are there any issues found either?
From my opinion, this apple to apple comparison could help us to narrow the scope of root cause.
Best Regards
Chenyin
Hello, @liubin123
I noticed that this is the similar case to the following link:
Then I may update the status in that link, which could be also for your reference.
Sorry for any inconvinience.
Best Regards
Chenyin
Hello, @liubin123
Thank you for the reply
Best Regards
Chenyin
I had uploaded s32g firmware and uboot ,please check firmware and uboot,
uboot env :
pfe1_phy_addr=8
pfe1addr=00:01:be:be:ef:22
pfe2addr=00:01:be:be:ef:33
pfeaddr=00:01:be:be:ef:11
pfeng_mode=enable,none,sgmii,rgmii
pfengemac=0
pfengfw=mmc@0:3:/lib/firmware/s32g_pfe_class.fw
preboot=sf probe 6:1; sf mark;
ramdisk_addr=0x90000000
s32cc_gmac_mode=enable
hwconfig=pcie0:mode=pcie,clock=ext;pcie1:mode=rc&sgmii,clock=int,fmhz=100,xpcs_mode=1
pfe1 config:
root@s32g274acicvd2:~# ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 557774 bytes 58349060 (55.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 557774 bytes 58349060 (55.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
pfe1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::9a:cdff:fe00:1 prefixlen 64 scopeid 0x20<link>
ether 02:9a:cd:00:00:01 txqueuelen 1000 (Ethernet)
RX packets 54125 bytes 25997549 (24.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 77032 bytes 26437355 (25.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0x46000000-46ffffff
root@s32g274acicvd2:~# cat /etc/systemd/network/10-pfe1.network
[Match]
Name=pfe1
KernelCommandLine=!root=/dev/nfs
[Network]
DHCP=no
Address=192.168.1.1/24
[Route]
Gateway=192.168.1.2
root@s32g274acicvd2:~#
root@s32g274acicvd2:~# dmesg | grep pfe1
[ 8.326490] pfeng 46000000.pfe: netif name: pfe1
[ 8.326507] pfeng 46000000.pfe: netif(pfe1) mode: std
[ 8.326516] pfeng 46000000.pfe: netif(pfe1) EMAC: 1
[ 8.326523] pfeng 46000000.pfe: netif(pfe1) HIFs: count 1 map 02
[ 8.488650] pfeng 46000000.pfe pfe1: registered
[ 8.488680] pfeng 46000000.pfe pfe1: Subscribe to HIF1
[ 8.489112] pfeng 46000000.pfe pfe1: Enable HIF1
[ 8.489277] pfeng 46000000.pfe pfe1: setting MAC addr: 00:01:be:be:ef:22
[ 8.489311] pfeng 46000000.pfe pfe1: PTP HW addend 0x80000000, max_adj configured to 46566128 ppb
[ 8.490181] pfeng 46000000.pfe pfe1: Registered PTP HW clock successfully on EMAC1
[ 8.510437] pfeng 46000000.pfe: Logical interface s8.pfe1 created in emac1
[ 8.515525] pfeng 46000000.pfe: New match rules 0x40000400 set to s8.pfe1
[ 11.666608] pfeng 46000000.pfe pfe1: configuring for fixed/rgmii-id link mode
[ 11.666866] pfeng 46000000.pfe pfe1: Link is Up - 1Gbps/Full - flow control off
[ 11.668180] IPv6: ADDRCONF(NETDEV_CHANGE): pfe1: link becomes ready
[ 12.876068] device pfe1 entered promiscuous mode
[ 17.428231] pfeng 46000000.pfe pfe1: Link is Down
[ 17.439709] pfeng 46000000.pfe pfe1: setting MAC addr: 02:9a:cd:00:00:01
[ 17.443037] pfeng 46000000.pfe pfe1: configuring for fixed/rgmii-id link mode
[ 17.443389] pfeng 46000000.pfe pfe1: Link is Up - 1Gbps/Full - flow control off
[ 18.443631] IPv6: ADDRCONF(NETDEV_CHANGE): pfe1: link becomes ready
Hello, @liubin123
Thanks for the question.
May I know if you are using a RDB board or custom board? and which version BSP used when met the issue? Have you done any modifications from the software view?
Best Regards
Chenyin
pc window IP:192.168.1.166
testudp.py:
import socket
# 创建 UDP Socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# 设置 SO_BROADCAST 选项为 True,表示开启广播功能
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
# 定义目标 IP 地址和端口号
#target_ip = '255.255.255.255' # 这里使用了默认的广播地址
target_ip = '255.255.255.255' # 这里使用了默认的广播地址
port = 5432
# 构造要发送的数据
message = b"Hello, World!"
try:
# 发送广播消息
sock.sendto(message, (target_ip, port))
except Exception as e:
print("Error occurred while sending broadcast message:", str(e))
finally:
# 关闭 Socket
print("sending broadcast message successful and close")
sock.close()
python testudp.py
sending broadcast message successful and close
on s32g:
root@s32g274acicvd2:~# tcpdump udp port 5432
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on pfe1, link-type EN10MB (Ethernet), capture size 262144 bytes
there is no any message achieved
but on other device(192.168.1.3):
I am using a RDB board, version BSP is s32g-bsp34
add a pfe1 network Iface
root@s32g274acicvd2:~# cat /etc/systemd/network/10-pfe1.network
[Match]
Name=pfe1
KernelCommandLine=!root=/dev/nfs
[Network]
DHCP=no
Address=192.168.1.1/24
[Route]
Gateway=192.168.1.2
root@s32g274acicvd2:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.2 0.0.0.0 UG 0 0 0 pfe1
0.0.0.0 192.168.1.2 0.0.0.0 UG 0 0 0 pfe1
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 pfe1
root@s32g274acicvd2:~# ping 192.168.1.166
PING 192.168.1.166 (192.168.1.166) 56(84) bytes of data.
64 bytes from 192.168.1.166: icmp_seq=1 ttl=128 time=0.849 ms
64 bytes from 192.168.1.166: icmp_seq=2 ttl=128 time=0.736 ms
64 bytes from 192.168.1.166: icmp_seq=3 ttl=128 time=0.665 ms
64 bytes from 192.168.1.166: icmp_seq=4 ttl=128 time=0.555 ms
^C
--- 192.168.1.166 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 0.555/0.701/0.849/0.106 ms
root@s32g274acicvd2:~#
root@s32g274acicvd2:~# ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 11427861 bytes 1336328242 (1.2 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 11427861 bytes 1336328242 (1.2 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
pfe1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::9a:cdff:fe00:1 prefixlen 64 scopeid 0x20<link>
ether 02:9a:cd:00:00:01 txqueuelen 1000 (Ethernet)
RX packets 1022172 bytes 600321839 (572.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2167118 bytes 1146522890 (1.0 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0x46000000-46ffffff
root@s32g274acicvd2:~#