S32G can not send broadcast and can not recvice broadcast

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32G can not send broadcast and can not recvice broadcast

2,896 次查看
liubin123
Contributor I

S32G can not send broadcast and can not recvice broadcast,please help to check network  configure,

liubin123_0-1706603485020.png

 

0 项奖励
回复
10 回复数

2,619 次查看
chenyin_h
NXP Employee
NXP Employee

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

0 项奖励
回复

2,756 次查看
chenyin_h
NXP Employee
NXP Employee

Hello, @liubin123 

I noticed that this is the similar case to the following link:

https://community.nxp.com/t5/S32G/S32G274-PFE1-cannot-send-and-receive-udp-broadcast-messages/td-p/1...

Then I may update the status in that link, which could be also for your reference.

Sorry for any inconvinience.

 

Best Regards

Chenyin

0 项奖励
回复

2,793 次查看
chenyin_h
NXP Employee
NXP Employee

Hello, @liubin123

Thank you for the reply

  1. I tested the broadcast feature with default SDK settings(pfe0 enabled, while pfe1 disabled), directly connected the pfe0 to the network interface on another machine, with the python code from user, the test is running without issues. (The PFE0 could send and receive broadcast packets correctly).

 

  1. I will continue test with the PFE1 by modifying the configurations of the BSP default value, in order to match your testing setup, could you kindly please help to clarify the ethernet settings? It is better to have the uboot env log attached, thanks.

 

Best Regards

Chenyin

0 项奖励
回复

2,624 次查看
liubin123
Contributor I

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:~#

0 项奖励
回复

2,626 次查看
liubin123
Contributor I
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:~#
I had modify 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
hwconfig=pcie0:mode=pcie,clock=ext;pcie1:mode=rc&sgmii,clock=int,fmhz=100,xpcs_mode=1
s32cc_gmac_mode=enable

0 项奖励
回复

2,778 次查看
liubin123
Contributor I
uboot env log
=> printenv
baudrate=115200
board_rev=D
boot_fdt=try
boot_mtd=booti
bootargs=root=/dev/ram rw earlycon loglevel=7
bootcmd=pfeng stop; mmc dev ${mmcdev}; if mmc rescan; then if run loadimage; then run mmcboot; else run netboot; fi; else run netboot;fi
bootdelay=2
bootscript=echo Running bootscript from mmc ...; source
console=ttyLF0
ethact=eth_pfeng
fdt_addr=0x83000000
fdt_enable_hs400es=fdt addr ${fdt_addr}; fdt rm /soc/mmc no-1-8-v; fdt resize;
fdt_file=s32g274a-cicvd.dtb
fdt_high=0xffffffffffffffff
fdt_override=;
fdtcontroladdr=ffa98000
filesize=0
flashboot=echo Booting from flash...; run flashbootargs;mtd read Kernel ${loadaddr};mtd read DTB ${fdt_addr};mtd read Rootfs ${ramdisk_addr};${boot_mtd} ${loadaddr} ${ramdisk_addr} ${fdt_addr};
flashbootargs=setenv bootargs console=${console},${baudrate} root=/dev/ram rw earlycon nohz=off coherent_pool=64M;setenv flashsize FSL_QSPI_FLASH_SIZE;
hwconfig=pcie0:mode=rc,clock=ext;pcie1:mode=sgmii,clock=ext,fmhz=125,xpcs_mode=2G5
image=Image
initrd_high=0xffffffffffffffff
ipaddr=10.0.0.100
jtagboot=echo Booting using jtag...; ${boot_mtd} ${loadaddr} ${ramdisk_addr} ${fdt_addr}
jtagsdboot=echo Booting loading Linux with ramdisk from SD...; run loadimage; run loadramdisk; run loadfdt;${boot_mtd} ${loadaddr} ${ramdisk_addr} ${fdt_addr}
loadaddr=0x80000000
loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}; run fdt_override;
loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
loadtftpfdt=tftp ${fdt_addr} ${fdt_file};
loadtftpimage=tftp ${loadaddr} ${image};
mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot} earlycon nohz=off coherent_pool=64M
mmcboot=echo Booting from mmc ...; run mmcargs; if run loadfdt; then ${boot_mtd} ${loadaddr} - ${fdt_addr}; else echo WARN: Cannot load the DT; fi;
mmcdev=0
mmcpart=2
mmcroot=/dev/mmcblk0p3 rootwait rw
netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp earlycon nohz=off coherent_pool=64M
netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then ${boot_mtd} ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then ${boot_mtd}; else echo WARN: Cannot load the DT; fi; fi; else ${boot_mtd}; fi;
netmask=255.255.255.0
nfsboot=echo Booting from net using tftp and nfs...; run nfsbootargs;run loadtftpimage; run loadtftpfdt;${boot_mtd} ${loadaddr} - ${fdt_addr};
nfsbootargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs rw ip=${ipaddr}:${serverip}::${netmask}::eth0:off nfsroot=${serverip}:/tftpboot/rfs,nolock,v3,tcp earlycon nohz=off coherent_pool=64M
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,sgmii,none,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
script=boot.scr
serverip=10.0.0.1
stderr=serial@401c8000
stdin=serial@401c8000
stdout=serial@401c8000
tftp_memory_option=0
update_sd_firmware=if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; if mmc dev ${mmcdev}; then if ${get_cmd} ${update_sd_firmware_filename}; then setexpr fw_sz ${filesize} / 0x200; setexpr fw_sz ${fw_sz} - 7; setexpr loadaddr ${loadaddr} + 0x1000; mmc write ${loadaddr} 0x8 ${fw_sz}; fi; fi
update_sd_firmware_filename=fip.s32

Environment size: 3596/65532 bytes
=>
0 项奖励
回复

2,847 次查看
liubin123
Contributor I

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

0 项奖励
回复

2,878 次查看
chenyin_h
NXP Employee
NXP Employee

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

0 项奖励
回复

2,872 次查看
liubin123
Contributor I

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):

liubin123_1-1706778521105.png

 

 

 

0 项奖励
回复

2,874 次查看
liubin123
Contributor I

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:~#

0 项奖励
回复