stm32 lwip - unable to respond to ping - stm32

I am trying to configure the minimum I can to get my Nucleo-F429ZI to respond to a ping
Using CubeMX, I enable ethernet in MII mode and assign a unique MAC address.
In Middleware I enable LwIP (no RTOS, no DHCP) I set an IP of 192.168.1.55, 255.255.255.0, 192.168.1.1.
I enable ICMP, UDP and TCP.
I build in TrueStudio and run, but no response to a ping from my linux box on the same network.
In main.c I see
MX_LWIP_Init(); which call lwip_init() with the address mask and gw I configured.
In lwip.c
I see my IP, mask and gw initialized correctly followed by lwip_init();
I try to ping from my linux box (same network) but get "host not found"
What am I missing???

in Nucleo-F429ZI the Ethernet physical chips is LAN8742A-CZ-TR that you should configure Ethernet media (your micro mac) in RMII mode, FOR MII interface you need RXD[3:0] and TXD[3:0] between your media level and physical level , but if you look at LAN8742A-CZ-TR datasheet or Nucleo-F429ZI schematic you found that between your physical and media you just have RXD[1:0] and TXD[1:0] pins that is RMII standard interface
your problem can occur according several reasons,
check your media config
check connection and look at links led on your eth connector
check auto negotiation process between your Linux box and phy

CubeMX default RMII pinout and Nucleo-F429ZI pinouts are different. You must change the following pins for achieving communication via ethernet.
PB11 -> PG11 (RMII_TX_EN)
PB12 -> PG13 (RMII_TX_D1)
Also, PHY address is should set to 0 in ETH settings.

Related

Is it possible to connect to Modbus TCP via Ethernet?

Is it possible to connect the Ethernet port (of a Raspberry Pi) directly to a Modbus TCP RJ45 port (such that the devices can talk to each other)? Or is this not possible without a converter?
I am unsure if this is the correct forum, but I believe this should not be specific to the Raspberry pi.
Short answer - Yes... But....
As per the comments this is possible but there are a few things you will need to do (i.e. some configuration will be needed).
I think it's worth nothing that "Modbus TCP RJ45 port" is not really a meaningful term. Modbus is an application layer protocol; this depends upon a number of underlying layers:
Transport layer - TCP
Network layer - IP
Datalink Layer - Ethernet
Physical Layer - Ethernet cable with RJ45 connectors
You don't need to understand this in detail; the point is that before ModbusTCP will work you need to have a working TCP network (which all Modbus-TCP devices will support; generally via an RJ45 Ethernet connection). As such a better question probably is "If I run a CAT-5 cable between a Raspberry Pi and another device (Modbus TCP unit) will I be able to connect via TCP?" (a lot more people know about TCP/IP networking than Modbus!).
The first thing to consider is Ethernet. Running a cable directly between two older devices will often not work because they needed a crossover cable. Almost all modern equipment (including the Pi) supports Auto MDI-X which means the cable will just work. You can also connect the units via a switch (and doing this removes the need for Auto MDI-X).
Next you need to consider the IP layer. When you connect your Pi to your home network it will (usually!) be given an IP address by a DHCP service (usually running on your router). If you are connecting the Pi directly to the device then there will be no DHCP service so you will need to manually assign IP addresses to the devices (and ensure the subnet is correctly configured). A common way to check if an IP connection is working is to use the ping command.
With the lower layers working ModbusTCP will generally 'just work'. Many ModbusTCP devices also offer a browser based configuration and checking that you can access that is a good way to confirm that the network link is working.
One further question is probably "should I do this"; it's OK to hook things up this way to make some quick changes. However generally you will want the Pi to access other network resources so connecting everything to a router (home router will work; for remote devices a cell router is often used). You can either give the Modbus unit a static IP manually or use the routers configuration pages to assign it a static DHCP lease (otherwise it's IP might change from time to time).

Forward packets between SR-IOV Virtual Function (VF) NICs

I have an Intel 82599ES 10G NIC which supports Intel SR-IOV. I have successfully created 8 virtual functions (VF) of it and assigned to 2 qemu/kvm VMs (2 VFs per each VM). Both of the VMs run DPDK applications (warp17 on one and my custom application on other) using assigned VFs. What I need to do is test my custom DPDK application by sending traffic through it using warp17. My test setup looks like this,
The red arrow represents the traffic path.
My Physical NIC (PF) use dpdk poll mode driver (igb_uio). What I need to do is route traffic between VFs as shown by the red arrows. I think https://doc.dpdk.org/guides/prog_guide/switch_representation.html has explained switching behavior but I cannot understand it. warp17 and my custom dpdk application both works perfectly on physical hardware. What I trying to do is virtualize my test setup to preserve resources. Has anyone tried to do such configuration?
neither X710 fortville and Ninatic 82599ES ASIC does not have internal Bridging or forwarding VERBor feature. The best option is to have software virtual switch like SPP, OVS-DPDK or custom application to forward packets via virtio or tap.
if you still want to use physical NIC or x710 or 82599ES you will need to have connection at other end and run the logic to direct packets to relevant VF (modifying dst mac).
Edit-1: (as per DPDK 20.11) VEB virtual ethernet Bridging is an option, but specific NIC firmware and driver is required to create VEB on PF then propagate to VF. Once done the NIC can not receive packets from the Outside world

Enabling Ethernet in CANoe

I have installed ethernet driver but Ethernet is not showing up in Measurement set up. Also when I load blf files with ethernet log, software prompts for register bus Ethernet
You need to set ethernet in Hardware-> channel usage
Add Eth network in simulation setup
Configure eth in Simulation-> TCP/Ip stack
Configure ETH hardware
In measurement setup you can add for example ETH trace

No internet through GSM connection, possible interface issue

I have a problem with getting GSM connection to work.
Currently used:
Advantech UNO-2272G device
Ubuntu 18.04
NetworkManager/nmcli package
The card works when put in a mobile phone.
*Note: following screenshots are made over SSH and remotely, as the device is currently plugged in ethernet until this issue is resolved.
This is current state of "nmcli" command:
nmcli print
The system connection for GSM is called "radi". My guess is that somehow the interface of that connection is trying to work with the other interface (underlined in red), which in turn is trying to get its DNS conf from router (to which it currently is connected with ethernet, but nothing changes if device is plugged out from router and NetworkManager and network is restarted, it still tries to get to router for its DNS).
This is current state of "ip addr" command:
ip addr
This is current state of /etc/network/interfaces file:
interfaces
This is current state of /etc/NetworkManager/system-connections/radi file:
systemconnection
So, the question is, what am I missing here? Is it the interface issue as written above, or something else entirely?
Disclaimer: I am not that proficient in the stuff presented here, most if not all of it was configured following guidelines on the internet.
Hey I'm not expert in this but I do have a different cellular modem connected to a linux system (RPI) and working with NetworkManager (and ModemManager). My modem was connected by a serial UART port (ttyACM0) so that seems similar to what you have done.
When I configured my cellular connection profile in NM I had to setup the ppp section of the connection profile on top of the gsm part. I also went into my ppp options (on the host) and configured those to match a chat script that came from my modem manufacturer. WHen NetworkManager runs a ppp interface it expects the ppp options for the pppd (daemon) to be configured properly.
Here is the ppp section of my NetworkManager cellular connection settings file. Most are defaults and in my case I only added the baud rate for my modem (since it was connected to a UART).
ppp.noauth: yes
ppp.refuse-eap: no
ppp.refuse-pap: no
ppp.refuse-chap: no
ppp.refuse-mschap: no
ppp.refuse-mschapv2: no
ppp.nobsdcomp: no
ppp.nodeflate: no
ppp.no-vj-comp: no
ppp.require-mppe: no
ppp.require-mppe-128: no
ppp.mppe-stateful: no
ppp.crtscts: no
ppp.baud: 115200
ppp.mru: 0
ppp.mtu: auto
ppp.lcp-echo-failure: 0
ppp.lcp-echo-interval: 0
If this is not helpful then have a look at this thread on NM and routing. In their case eth0 was a local network interface and eth1 was their cellular interface
Now to save you 10 hours of troubleshooting - note that the route
metric is independent of the DNS priority! So if you still have
connectivity issues, make sure it's not a DNS resolution issue (eg.
your DHCP server is providing a dummy resolution service). If it is,
then increase the ipv4.dns-priority of your eth0 connection to make it
lower priority, and/or make sure the ipv4.dns-search of your eth1 is
set to "~" to make it the go-to option.

How to set the PC/PG interface in Step7?

My question is how to set the pc/pg interface in Step 7? I know the PLC's IP but it seems that the program is unavailable to find the PLC in the list of available devices. I am using TCP/IP connection so it would be ideal if I could receive some steps in configuring the interface the right way.
Double­click on "Setting PG/PC Interface" in the "Control Panel" of Windows.
Set the "Access Point of Application" to "S7ONLINE."
In the list "Interface parameter set used", select the required interface parameter set. If the required interface parameter set is not displayed, you must first install a module or protocol via the "Select" button. The interface parameter set is then generated automatically. On plug-and-play systems, you can not install plug and play CPs manually (CP 5611 and CP 5511). They are integrated automatically in "Setting PG/PC Interface" after you have installed the hardware in your PG/PC.
If you are using TIA Portal, you might want to look into Control Panel / Communication Settings.
If you want to connect with a LAN cable to the PLC's Ethernet/Profinet port you must select your Network Card in the PG/PC Interface (or Communication Settings).
After that you should use a fixed IP address on your Network Card.
If the PLC has IP 192.168.0.1 and subnet mask 255.255.255.0 you should set 192.168.0.2 and the same subnet mask.
For this, go to your Network Adapters list. In Windows10 it's Control Panel\Network and Internet\Network Connections
Then right click your Network Card -> Properties
Go to Internet Protocol Version 4 (TCP/IPv4) Properties and enter manually your IP address.
To test the communication open Command Prompt and ping the PLC (eg. "ping 192.168.0.1").
Then probably you will be able to connect to the PLC.