Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ DEFINES=$(MBEDTLSFLAGS) CY_RTOS_AWARE CYBSP_ETHERNET_CAPABLE CY_RETARGET_IO_CONV
# Disable the data cache for XMC7000 devices
DEFINES+=CY_DISABLE_XMC7000_DATA_CACHE PRINT_HEAP_USAGE

# Enable lwIP netif broadcast
DEFINES+=ETH_BROADCAST_EN

# Enable littlefs lock/unlock callbacks
DEFINES+=LFS_THREADSAFE

Expand Down Expand Up @@ -138,13 +141,19 @@ LDLIBS=
# Path to the linker script to use (if empty, use the default linker script).
LINKER_SCRIPT=uphy-linker-script.ld

PATCH1 = ${CURDIR}/patches/0001-Workaround-for-DMA-null-pointer-crash.patch

# Custom pre-build commands to run.
# Touch demo application to refresh build date in serial shell banner
# Install lwip snmp patch from rtlabs-uphy-lib middleware
# Patch mtb-pdl-cat1 ethernet driver
PREBUILD=touch source/uphy_demo_app.c && \
if [ ! -f uphy-lwip-patch-installed ]; then \
touch uphy-lwip-patch-installed; \
cp -rf $(SEARCH_rtlabs-uphy-lib)/src/lwip/src $(SEARCH_lwip); \
pushd $(SEARCH_mtb-pdl-cat1); \
git -c user.name="${APPNAME}" -c user.email="${APPNAME}@rt-labs.com" am ${PATCH1}; \
popd; \
fi


Expand Down
53 changes: 31 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# U-Phy Industrial Ethernet Connectivity Example

This user example shows how to implement Industrial Ethernet connectivity using the U-Phy Middleware.
Currently, Profinet and EtherNet/IP are supported.
Currently, Profinet, EtherNet/IP, CC-Link IE Field Basic and Modbus TCP are supported.

The application implements a basic I/O device connecting inputs and outputs to the EVK buttons and LEDs.
Profinet GSDML and EtherNet/IP EDS files for integration in an engineering tool are found in the `generated/` folder.
Profinet GSDML, EtherNet/IP EDS and CC-Link CSP+ files for integration in an engineering tool are found in the `generated/` folder.

After building and programming the example, the EVK can be connected to a Profinet, EtherNet/IP or ModBus TCP network for evaluation.
After building and programming the example, the EVK can be connected to a Profinet, EtherNet/IP, CC-Link or ModBus TCP network for evaluation.

Using U-Phy, the process data of the sample application can easily be redefined.
The inputs, outputs, and configuration parameters of the device are modeled using the U-Phy Device Builder.
Device description files such as Profinet GSDML and EtherNet/IP EDS are generated from the model.
Device description files such as Profinet GSDML, EtherNet/IP EDS and CC-Link CSP+ are generated from the model.
See the advanced section below for a step-by-step guide.

## About U-Phy
Expand All @@ -27,7 +27,8 @@ Industrial Ethernet devices using U-Phy. Other resources:
- Industrial Ethernet
- Profinet Device
- EtherNet/IP Adapter
- Modbus TCP Adapter
- Modbus TCP Server
- CC-Link IE Field Basic (CCIEFB) Slave
- Command Line Interface (CLI)
- Configuration of active protocol
- Get/Set I/O data
Expand All @@ -38,7 +39,7 @@ Industrial Ethernet devices using U-Phy. Other resources:
- U-Phy Middleware (Advanced)
- Device Design
- Redefine Device I/O data using U-Phy Device Builder
- Regenerate description files (GSDML, EDS) and code using U-Phy Generator (upgen)
- Regenerate description files (GSDML, EDS, CSP+) and code using U-Phy Generator (upgen)

**Note** : The runtime of U-Phy stack is limited to 2 hours. To obtain the full version, please contact your regional sales representative of Infineon Technologies AG.

Expand All @@ -56,7 +57,7 @@ Industrial Ethernet devices using U-Phy. Other resources:
USER_LED3 indicates the current mode of operation and is referred to as the Mode LED.

- When the application starts, the Mode LED flashes at 0.5 Hz.
- When connected to a PLC (Profinet or EtherNet/IP), the Mode LED is steady ON.
- When connected to a PLC, the Mode LED is steady ON.

The Profinet LED signaling feature is also mapped to the Mode LED. For Profinet users, a natural first step of evaluation is to flash the LED using Proneta or your favorite engineering tool.

Expand All @@ -78,42 +79,48 @@ A list of supported commands are displayed using the help command:
Industrial Ethernet Demo
Configure communication protocol using this shell. Usage:
'help' - list of available commands
'help <cmd>' - show command details
'help <cmd>' - detailed help
'about' - for information on this application

Built Oct 8 2024 at 10:07:02
Built : Feb 19 2026 at 11:00:02
U-Phy : v1.0.1-25-g03233787
----------------------------------------------------------------------

Autostart disabled, start U-Phy using console command 'up_start'
> Autostart disabled, start U-Phy using console command 'up_start'

> help
about - about this application
up_alarm - up_alarm <add/remove> <slot_ix> <level> <error_type>
alarm - alarm <add/remove> <slot_ix> <level> <error_type>
up_autostart - configure u-phy device autostart
format_fs - format the filesystem
help - show help
ip_set - Set network interface parameters
ip_show - Show network interface parameters
mbus_show - Show mbus registers
reboot - reboot the device
up_device - show static device configuration
up_signal - get or set signal value and status
up_start - start u-phy protocol
up_status - show device status and signal values
up_show - show uphy state
netcfg - configure network parameters

show_heap - Dump heap usage
> about

Industrial Ethernet Demo

This user example shows how to implement Industrial Ethernet
connectivity using the U-Phy Middleware. Currently Profinet and
Ethernet/IP is supported.
connectivity using the U-Phy Middleware. Currently Profinet,
Ethernet/IP, CC-Link and ModBus TCP are supported.

The application implements a basic I/O device connecting inputs
and outputs to the EVK buttons and LEDs.

Profinet GSDML and EtherNet/IP EDS files for integration in an
engineering tool are found in the `generated/` folder.
Profinet GSDML, EtherNet/IP EDS files, or CC-Link CSP+ files for
integration in an engineering tool are found in the `generated/`
folder.

Start communication using 'up_start' command.

```

### Device I/O Data
Expand All @@ -129,7 +136,7 @@ The default device supports the following I/O data modules:
- **IO8** - 8 Bits Input/Output
- Not used

In the U-Phy concept, devices are defined by a model in JSON format. Device description files (Profinet GSDML, EtherNet/IP EDS) and device-specific code are generated using the device generator tool. The default device model is found in the `model/model.json` file, and the device-specific files are located in the `generated/` folder.
In the U-Phy concept, devices are defined by a model in JSON format. Device description files (Profinet GSDML, EtherNet/IP EDS, CC-Link CSP+) and device-specific code are generated using the device generator tool. The default device model is found in the `model/model.json` file, and the device-specific files are located in the `generated/` folder.

Note that the CLI can be used to watch or set the I/O data.

Expand All @@ -152,7 +159,7 @@ IP address may also be shown via shell command 'netcfg'

### Configuring network

Out of the box, this sample app will configure DHCP for Ethernet/IP and static ip address when selecting Profinet.
Out of the box, this sample app will configure DHCP for Ethernet/IP, CC-Link and Modbus, and static ip address when selecting Profinet.
Network configuration may be set in runtime using the 'netcfg' console command.

The default static IP is configured in mtb_shared/rtlabs-uphy-lib/latest-v0.X/src/network/network.h
Expand All @@ -164,8 +171,9 @@ The default static IP is configured in mtb_shared/rtlabs-uphy-lib/latest-v0.X/sr
```

### Connect to PLC
Device description files are available in the ``generated\`` folder
If you are new to the protocol you want to evaluate information on how to get started is found in the the U-Phy Middleware documentation.
Device description files are available in the ``generated\`` folder.

If you are new to the protocol you want to evaluate, information on how to get started is found in the the U-Phy Middleware documentation.

## Advanced

Expand All @@ -181,7 +189,7 @@ The device I/O data is defined using the [U-Phy Device Builder](https://devicebu
### Regenerating Device-Specific Artifacts
The U-Phy Device Generator (upgen) is part of the U-Phy Middleware. The executables are located in the `bin` folder, with versions available for both Linux and Windows.

The script `run-uphy-device-generator.sh` in the project root folder is a helper utility for running the upgen tool. It can be run using the Modus shell. Pass your device model as an argument to the script to generate its artifacts.
The script `uphy-device-generator.sh` in the project root folder is a helper utility for running the upgen tool. It can be run using the Modus shell. Pass your device model as an argument to the script to generate its artifacts.


```
Expand All @@ -190,6 +198,7 @@ The script `run-uphy-device-generator.sh` in the project root folder is a helper
+++ ../mtb_shared/rtlabs-uphy-lib/latest-v1.x/bin/upgen.exe export -d generated --generator Code model/digio.json
+++ ../mtb_shared/rtlabs-uphy-lib/latest-v1.x/bin/upgen.exe export -d generated --generator Profinet model/digio.json
+++ ../mtb_shared/rtlabs-uphy-lib/latest-v1.x/bin/upgen.exe export -d generated --generator EtherNetIP model/digio.json
+++ ../mtb_shared/rtlabs-uphy-lib/latest-v1.x/bin/upgen.exe export -d generated --generator CC-Link model/digio.json
```

Note the content in the generated folder is overwritten. The script itself contains some comments that may be useful.
Expand Down
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# U-Phy Sample Application

#### v0.8.0
* Added CC-Link CCIEFB adapter
* Moved filesystem to internal flash. QSPI flash is no longer required.
- The filesystem must be formatted on first boot. The contents of the old QSPI filesytem, if any, are not preserved.
* Upgrade to latest U-Phy core library (v1.0.4)
- https://docs.rt-labs.com/u-phy/reference/release-notes.html

#### v0.7.2
* Added Modbus TCP adapter
* Added console command 'show_heap' to show current heap usage
Expand Down
Loading