Giter VIP home page Giter VIP logo

stm32-eth's Introduction

STM32 Peripheral Access Crates

CI crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io Matrix

This repository provides Rust device support crates for all STM32 microcontrollers, providing a safe API to that device's peripherals using svd2rust and a community-built collection of patches to the basic SVD files. There is one crate per device family, and each supported device is a feature-gated module in that crate. These crates are commonly known as peripheral access crates or "PACs".

To view the generated code that makes up each crate, visit the stm32-rs-nightlies repository, which is automatically rebuilt on every commit to stm32-rs master. The stm32-rs repository contains the patches to the underlying SVD files and the tooling to generate the crates.

While these crates are widely used, not every register of every device will have been tested on hardware, and so errors or omissions may remain. We can't make any guarantee of correctness. Please report any bugs you find!

You can see current coverage status for each chip here. Coverage means that individual fields are documented with possible values, but even devices with low coverage should have every register and field available in the API. That page also allows you to drill down into each field on each register on each peripheral.

Using Device Crates In Your Own Project

In your own project's Cargo.toml:

[dependencies.stm32f4]
version = "0.15.1"
features = ["stm32f405", "rt"]

The rt feature is optional but helpful. See svd2rust for details.

Then, in your code:

use stm32f4::stm32f405;

let mut peripherals = stm32f405::Peripherals::take().unwrap();

Refer to svd2rust documentation for further usage.

Replace stm32f4 and stm32f405 with your own device; see the individual crate READMEs for the complete list of supported devices. All current STM32 devices should be supported to some level.

Using Latest "Nightly" Builds

Whenever the master branch of this repository is updated, all device crates are built and deployed to the stm32-rs-nightlies repository. You can use this in your Cargo.toml:

[dependencies.stm32f4]
git = "https://github.com/stm32-rs/stm32-rs-nightlies"
features = ["stm32f405", "rt"]

The nightlies should always build and be as stable as the latest release, but contain the latest patches and updates.

Generating Device Crates / Building Locally

  • Install svd2rust, svdtools, and form:
    • On x86-64 Linux, run make install to download pre-built binaries at the current version used by stm32-rs
    • Otherwise, build using cargo (double check versions against scripts/tool_install.sh):
      • cargo install form --version 0.12.1
      • cargo install svdtools --version 0.3.18
      • cargo install svd2rust --version 0.33.4
  • Install rustfmt: rustup component add rustfmt
  • Generate patched SVD files: make patch (you probably want -j for all make invocations)
    • Alternatively you could install cargo-make runner and then use it instead of make. Works on MS Windows natively:
      • cargo install cargo-make
      • cargo make patch
  • Generate svd2rust device crates: make svd2rust
  • Optional: Format device crates: make form

Motivation and Objectives

This project serves two purposes:

  • Create a source of high-quality STM32 SVD files, with manufacturer errors and inconsistencies fixed. These files could be used with svd2rust or other tools, or in other projects. They should hopefully be useful in their own right.
  • Create and publish svd2rust-generated crates covering all STM32s, using the SVD files.

When this project began, many individual crates existed for specific STM32 devices, typically maintained separately with hand-edited updates to the SVD files. This project hopes to reduce that duplication of effort and centralise the community's STM32 device support in one place.

Helping

This project is still young and there's a lot to do!

  • More peripheral patches need to be written, most of all. See what we've got in peripherals/ and grab a reference manual!
  • Also everything needs testing, and you can't so easily automate finding bugs in the SVD files...

Supported Device Families

crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io crates.io

Please see the individual crate READMEs for the full list of devices each crate supports. All SVDs released by ST for STM32 devices are covered, so probably your device is supported to some extent!

Devices that are nearly identical, like the STM32F405/F415, are supported by ST under a single SVD file STM32F405, so if you can't find your exact device check if its sibling is supported instead. The crate READMEs make this clear.

Many peripherals are not yet patched to provide the type-safe friendly-name interface (enumerated values); please consider helping out with this!

Check out the full list of supported devices here.

Adding New Devices

  • Update SVD zips in svd/vendor to include new SVDs.
  • Run make extract to extract the new zip files.
  • Add new YAML file in devices/ with the new SVD path and include any required SVD patches for this device, such as renaming or merging fields.
  • Add the new devices to stm32_part_table.yaml.
  • Add the new devices to scripts/makecrates.py.
  • You can run scripts/matchperipherals.py script to find out what existing peripherals could be cleanly applied to this new SVD. If they look sensible, you can include them in your device YAML. This requires a Python environment with the pyyaml and svdtools dependencies. Example command: python scripts/matchperipherals.py peripherals/rcc devices/stm32h562.yaml
  • Re-run scripts/makecrates.py devices/ to update the crates with the new devices.
  • Run make to rebuild, which will make a patched SVD and then run svd2rust on it to generate the final library.

If adding a new STM32 family (not just a new device to an existing family), complete these steps as well:

  • Add the new devices to the CRATES field in Makefile.
  • Update this Readme to include the new devices.
  • Add the devices to workflows/ci.yaml and workflows/nightlies.yaml.

Updating Existing Devices/Peripherals

  • Using Linux, run make extract at least once to pull the SVDs out.
  • Edit the device or peripheral YAML (see below for format).
  • Using Linux, run make to rebuild all the crates using svd patch and svd2rust.
  • Test your new stuff compiles: cd stm32f4; cargo build --features stm32f405

If you've added a new peripheral, consider using the matchperipherals.py script to see which devices it would cleanly apply to.

To generate a new peripheral file from scratch, consider using periphtemplate.py, which creates an empty peripheral file based on a single SVD file, with registers and fields ready to be populated. For single bit wide fields with names ending in 'E' or 'D' it additionally generates sample "Enabled"/"Disabled" entries to save time.

Device and Peripheral YAML Format

Please see the svdtools documentation for full details of the patch file format.

Style Guide

  • Enumerated values should be named in the past tense ("enabled", "masked", etc).
  • Descriptions should start with capital letters but do not end with a period

Releasing

Notes for maintainers:

  1. Create PR preparing for new release:
    • Update CHANGELOG.md with changes since last release and new contributors
    • Update README.md to bump version number in example snippet
    • Update scripts/makecrates.py to update version number for generated PACs
  2. Merge PR once CI passes, pull master locally.
  3. make clean
  4. make -j16 form
  5. for f in stm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 stm32h7 stm32l0 stm32l1 stm32l4 stm32l5 stm32g0 stm32g4 stm32mp1 stm32wl stm32wb; cd $f; pwd; cargo publish --allow-dirty --no-default-features; cd ..; end
  6. git tag -a vX.X.X -m vX.X.X
  7. git push vX.X.X

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

stm32-eth's People

Contributors

adamgreig avatar astro avatar birkenfeld avatar bors[bot] avatar datdenkikniet avatar david-sawatzke avatar diondokter avatar dragondev1906 avatar dsgruss avatar dtjones-atse avatar dtjones190 avatar franeklubi avatar jiayihu avatar korken89 avatar laerling avatar lorl0rd avatar mitchmindtree avatar pintariching avatar systec-ms avatar tdittr avatar thalesfragoso avatar therealprof avatar torkeldanielsson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stm32-eth's Issues

Could not get example running on STM32F107RC

Hi,

First of all, many thanks for this awesome project! I am trying to get it running on a STM32F107RCT6 with LAN8720A, but unfortunately without success so far. Although I'm a professional firmware developer, I have no experience with Ethernet yet so I'm still trying to understand how all this works in general. Also I don't know if my custom hardware is fine or not.

It would help me a lot to get some feedback if the examples provided here should actually work out of the box with my hardware or if there's something missing or wrong. Let me quickly explain my situation:

Here's my schematic: d0-reader_v1_Schematic.pdf

What I did:

export DEFMT_LOG=info
export PROBE_RUN_CHIP=STM32F107RC
cargo build --release --example ip --features stm32f107,smoltcp-phy --target thumbv7m-none-eabi
cargo run --release --example ip --features stm32f107,smoltcp-phy --target thumbv7m-none-eabi

The output:

    Finished release [optimized + debuginfo] target(s) in 0.03s
     Running `probe-run target/thumbv7m-none-eabi/release/examples/ip`
(HOST) INFO  flashing program (38 pages / 38.00 KiB)
(HOST) INFO  success!
────────────────────────────────────────────────────────────────────────────────
INFO  Enabling ethernet...
└─ ip::__cortex_m_rt_main @ examples/ip.rs:45
^C────────────────────────────────────────────────────────────────────────────────
(HOST) INFO  program has used at least 9.06/30.92 KiB (29.3%) of stack space
stack backtrace:
   0: stm32_eth::dma::EthernetDMA::new
        at src/dma/mod.rs:69:15
   1: stm32_eth::new
        at src/lib.rs:139:15
   2: ip::__cortex_m_rt_main
        at examples/ip.rs:56:9
   3: main
        at examples/ip.rs:36:1
   4: Reset
(HOST) INFO  device halted by user

(aborted with Ctrl+C after the output stuck at "Enabling ethernet...")

I also tried to debug the firmware and it looks like the CPU hangs forever at waiting for the DMABMR.SR bit.

Do you have any suggestion where the problem might be located? I'd highly appreciate any input.

My general questions are:

  • Is the example really expecting that RMII_REFCLK is provided by the LAN8720, not from the microcontroller? If I understand the LAN8720 correctly, the "clock output"-mode needs to be explicitly enabled, but I don't understand if and where this is done in the examples provided here.
  • As far as I can see with the scope, there's indeed no clock signal on the RMII_REFCLK line at all - should the clock be continuously there or only if there's any data communication?
  • Don't we also need to control the LAN8720 reset line from the microcontroller to ensure proper initialization?
  • What should the LEDs connected to LAN8720 actually do, are they enabled by the example to indicate an active link and communication? Currently my green LED is constantly on, no matter if a cable is connected or not...

Thanks!

Support for any other mode than 100 Mbps/FD

This driver assumes that PHY autonegotiation always results in 100 MBps/FD.

We should poll the PHY at the right moments to set eth_mac maccr fes and dm accordingly. When?

Ethernet MMC counter interrupts should be disabled

The ethernet MMC counter interrupts are enabled by default in most versions of the ETH peripheral IP.

These interrupts can result in a lockup of an application if the application uses the ETH ISR.

These interrupts should be disabled during setup.

See stm32-rs/stm32h7xx-hal#295 for more information on this defect.

The various counters may differ slightly from the H7 revision.

Support for other PHYs

As I can see, apart from standard SMI registers, it uses "phy special control / status register". Will this crate work with DP83848 for example, which doesn't have it?

stm32f429 (nucleo board) no longer working with examples on main branch

Hi!

I updated my code to the current master branch / smoltcp 0.9 and now ethernet is no longer working. Thought it might be a problem with my own code, but now tried the stm32-eth's examples and it is also no longer working. But if I switch back to the 0.4.x branch it starts working again. Primarily tried the rtic-echo example, but to exclude problems with rtic I also tried the ip example which also does not work. In both, rtic-echo and ip on the current master branch it's not only the sockets which seem not to work, the board even does not response to arp requests.

Here is the rtt output (with defmt's log level set to tracing) of the 0.4.x branch of the rtic-echo example:

DEFMT_LOG=trace PROBE_RUN_CHIP=STM32F429AGHx \                                                                                                               *[e6d2dea]
STM32_ETH_EXAMPLE_PINS=nucleo  \
cargo run --release --example rtic-echo \
    --features="stm32f4xx-hal stm32f429 defmt smoltcp-phy" \
    --target thumbv7em-none-eabihf
   Compiling defmt-macros v0.3.3
   Compiling defmt v0.3.2
   Compiling smoltcp v0.8.2
   Compiling panic-probe v0.3.0
   Compiling defmt-rtt v0.4.0
   Compiling stm32-eth v0.4.1 (/Users/alios/src/embedded-rust/stm32-eth)
    Finished release [optimized + debuginfo] target(s) in 3.52s
     Running `probe-run target/thumbv7em-none-eabihf/release/examples/rtic-echo`
(HOST) INFO  flashing program (63 pages / 63.00 KiB)
(HOST) INFO  success!
────────────────────────────────────────────────────────────────────────────────
INFO  Pre-init
└─ rtic_echo::app::init @ examples/rtic-echo.rs:70
INFO  Setting up pins
└─ rtic_echo::app::init @ examples/rtic-echo.rs:80
INFO  Configuring ethernet
└─ rtic_echo::app::init @ examples/rtic-echo.rs:83
INFO  Enabling interrupts
└─ rtic_echo::app::init @ examples/rtic-echo.rs:94
INFO  Setting up smoltcp
└─ rtic_echo::app::init @ examples/rtic-echo.rs:97
TRACE [0]: adding
└─ smoltcp::iface::socket_set::{impl#2}::add::put @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
TRACE tcp:10.23.101.187:1337: state=Closed=>Listen
└─ smoltcp::socket::tcp::{impl#4}::set_state @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
INFO  Resetting PHY as an extra step. Type: LAN8742A
└─ rtic_echo::app::init @ examples/rtic-echo.rs:127
INFO  Waiting for link up.
└─ rtic_echo::app::init @ examples/rtic-echo.rs:134
INFO  Link up.
└─ rtic_echo::app::init @ examples/rtic-echo.rs:138
INFO  Detected link speed: FullDuplexBase100Tx
└─ rtic_echo::app::init @ examples/rtic-echo.rs:147
INFO  Setup done. Listening at (10.23.101.187, 1337)
└─ rtic_echo::app::init @ examples/rtic-echo.rs:155
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG address 10.23.101.82 not in neighbor cache, sending ARP request
└─ smoltcp::iface::interface::{impl#3}::lookup_hardware_addr @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to send response: Unaddressable
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: false, is_tx: true, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
TRACE filled 10.23.101.82 => Ethernet(Address([128, 109, 151, 61, 98, 106])) (was empty)
└─ smoltcp::iface::neighbor::{impl#1}::fill @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
TRACE tcp:10.23.101.187:1337: received SYN
└─ smoltcp::socket::tcp::{impl#4}::process @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
TRACE tcp:10.23.101.187:1337:10.23.101.82:59246: state=Listen=>SynReceived
└─ smoltcp::socket::tcp::{impl#4}::set_state @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
TRACE tcp:10.23.101.187:1337:10.23.101.82:59246: outgoing segment will send data or flags
└─ smoltcp::socket::tcp::{impl#4}::dispatch @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
TRACE tcp:10.23.101.187:1337:10.23.101.82:59246: sending SYN|ACK
└─ smoltcp::socket::tcp::{impl#4}::dispatch @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
TRACE rtte: sampling at seq=SeqNumber(4)
└─ smoltcp::socket::tcp::{impl#2}::on_send @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: false, is_tx: true, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
TRACE rtte: sample=1 rtt=263 dev=141 rto=827
└─ smoltcp::socket::tcp::{impl#2}::sample @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
TRACE tcp:10.23.101.187:1337:10.23.101.82:59246: state=SynReceived=>Established
└─ smoltcp::socket::tcp::{impl#4}::set_state @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
DEBUG cannot process ingress packet: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Failed to consume RX token: Unrecognized
└─ smoltcp::iface::interface::{impl#2}::socket_ingress::{closure#0} @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:18
DEBUG Got an ethernet interrupt! Reason: InterruptReasonSummary { is_rx: true, is_tx: false, is_error: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:172
TRACE tcp:10.23.101.187:1337:10.23.101.82:59246: rx buffer: receiving 7 octets at offset 0
└─ smoltcp::socket::tcp::{impl#4}::process @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
TRACE tcp:10.23.101.187:1337:10.23.101.82:59246: rx buffer: enqueueing 7 octets (now 7)
└─ smoltcp::socket::tcp::{impl#4}::process @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
TRACE tcp:10.23.101.187:1337:10.23.101.82:59246: starting delayed ack timer
└─ smoltcp::socket::tcp::{impl#4}::process @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
INFO  Echoed 7 bytes.
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:180
TRACE tcp:10.23.101.187:1337:10.23.101.82:59246: outgoing segment will send data or flags
└─ smoltcp::socket::tcp::{impl#4}::dispatch @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
TRACE tcp:10.23.101.187:1337:10.23.101.82:59246: tx buffer: sending 7 octets at offset 0
└─ smoltcp::socket::tcp::{impl#4}::dispatch @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
TRACE tcp:10.23.101.187:1337:10.23.101.82:59246: sending PSH|ACK
└─ smoltcp::socket::tcp::{impl#4}::dispatch @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
TRACE tcp:10.23.101.187:1337:10.23.101.82:59246: stop delayed ack timer
└─ smoltcp::socket::tcp::{impl#4}::dispatch @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.8.2/src/macros.rs:17
TRACE rtte: sampling at seq=SeqNumber(11)

But with the current main branch it is no longer working as described above. Noteable (and the same effect with my own code) is, that the ETH interrupt handler is called two times, but then no more

DEFMT_LOG=trace PROBE_RUN_CHIP=STM32F429AGHx \                                                                                                                *[master]
STM32_ETH_EXAMPLE_PINS=nucleo  \
cargo run --release --example rtic-echo \
    --features="stm32f4xx-hal stm32f429 defmt smoltcp-phy" \
    --target thumbv7em-none-eabihf
   Compiling smoltcp v0.9.1
   Compiling atomic-polyfill v1.0.2
   Compiling heapless v0.7.16
   Compiling rtic v2.0.0-alpha.0 (https://github.com/rtic-rs/rtic.git?rev=7c7d6558f6d9c50fbb4d2487c98c9a5be15f2f7b#7c7d6558)
   Compiling rtic-macros v2.0.0-alpha.0 (https://github.com/rtic-rs/rtic.git?rev=7c7d6558f6d9c50fbb4d2487c98c9a5be15f2f7b#7c7d6558)
   Compiling rtic-common v1.0.0-alpha.0 (https://github.com/rtic-rs/rtic.git?rev=7c7d6558f6d9c50fbb4d2487c98c9a5be15f2f7b#7c7d6558)
   Compiling rtic-sync v1.0.0-alpha.0 (https://github.com/rtic-rs/rtic.git?rev=7c7d6558f6d9c50fbb4d2487c98c9a5be15f2f7b#7c7d6558)
   Compiling cortex-m-rtic v1.1.4
   Compiling stm32-eth v0.4.1 (/Users/alios/src/embedded-rust/stm32-eth)
    Finished release [optimized + debuginfo] target(s) in 3.40s
     Running `probe-run target/thumbv7em-none-eabihf/release/examples/rtic-echo`
(HOST) INFO  flashing program (49 pages / 49.00 KiB)
(HOST) INFO  success!
────────────────────────────────────────────────────────────────────────────────
INFO  Pre-init
└─ rtic_echo::app::init @ examples/rtic-echo.rs:68
INFO  Setting up pins
└─ rtic_echo::app::init @ examples/rtic-echo.rs:84
INFO  Configuring ethernet
└─ rtic_echo::app::init @ examples/rtic-echo.rs:87
INFO  Enabling interrupts
└─ rtic_echo::app::init @ examples/rtic-echo.rs:96
INFO  Setting up smoltcp
└─ rtic_echo::app::init @ examples/rtic-echo.rs:99
TRACE [0]: adding
└─ smoltcp::iface::socket_set::{impl#2}::add::put @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.9.1/src/macros.rs:17
TRACE state=Closed=>Listen
└─ smoltcp::socket::tcp::{impl#5}::set_state @ /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/smoltcp-0.9.1/src/macros.rs:17
INFO  Resetting PHY as an extra step. Type: LAN8742A
└─ rtic_echo::app::init @ examples/rtic-echo.rs:130
INFO  Waiting for link up.
└─ rtic_echo::app::init @ examples/rtic-echo.rs:137
INFO  Link up.
└─ rtic_echo::app::init @ examples/rtic-echo.rs:141
INFO  Detected link speed: FullDuplexBase100Tx
└─ rtic_echo::app::init @ examples/rtic-echo.rs:150
INFO  Setup done. Listening at (10.0.0.1, 1337)
└─ rtic_echo::app::init @ examples/rtic-echo.rs:158
DEBUG Got an ethernet interrupt! Reason: InterruptReason { rx: true, tx: false, dma_error: false, time_passed: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:183
DEBUG Got an ethernet interrupt! Reason: InterruptReason { rx: true, tx: false, dma_error: false, time_passed: false }
└─ rtic_echo::app::eth_interrupt @ examples/rtic-echo.rs:183
^C────────────────────────────────────────────────────────────────────────────────
stack backtrace:
   0: cortex_m::asm::nop
        at /Users/alios/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.7/src/call_asm.rs:19:21
   1: main
        at examples/rtic-echo.rs:21:1
   2: Reset
(HOST) WARN  call stack was corrupted; unwinding could not be completed
(HOST) INFO  device halted by user

Did anyone else experience that with a stm32-f4 device?
I'am not deep enough into this project or smoltcp to debug this any further.

error when compiling STM32 on Arduino ID

When I compile the programming given by the manufacturer of the Gravity sensor: Analog EMG SEN024, I get the following programming error:

Arduino:1.8.17 Hourly Build 2021/09/06 02:33 (Windows 10), Tarjeta:"Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STM32duino bootloader, 72Mhz (Normal), Smallest (default)"

C:\Users\Bryam\Downloads\prueba_defecto_2\prueba_defecto\prueba_defecto.ino: In function 'void setup()':

prueba_defecto:38:56: error: invalid conversion from 'int' to 'SAMPLE_FREQUENCY' [-fpermissive]

 myFilter.init(sampleRate, humFreq, true, true, true);

                                                    ^

In file included from C:\Users\Bryam\Downloads\prueba_defecto_2\prueba_defecto\prueba_defecto.ino:9:0:

C:\Users\Bryam\OneDrive\Documentos\Arduino\libraries\EMGFilters/EMGFilters.h:57:10: error: initializing argument 1 of 'void EMGFilters::init(SAMPLE_FREQUENCY, NOTCH_FREQUENCY, bool, bool, bool)' [-fpermissive]

 void init(SAMPLE_FREQUENCY sampleFreq,

      ^

prueba_defecto:38:56: error: invalid conversion from 'int' to 'NOTCH_FREQUENCY' [-fpermissive]

 myFilter.init(sampleRate, humFreq, true, true, true);

                                                    ^

In file included from C:\Users\Bryam\Downloads\prueba_defecto_2\prueba_defecto\prueba_defecto.ino:9:0:

C:\Users\Bryam\OneDrive\Documentos\Arduino\libraries\EMGFilters/EMGFilters.h:57:10: error: initializing argument 2 of 'void EMGFilters::init(SAMPLE_FREQUENCY, NOTCH_FREQUENCY, bool, bool, bool)' [-fpermissive]

 void init(SAMPLE_FREQUENCY sampleFreq,

      ^

Se encontraron varias bibliotecas para "Wire.h"

Usado: C:\Users\Bryam\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2021.5.31\libraries\Wire

No usado: C:\Users\Bryam\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2021.5.31\libraries\WireSlave

exit status 1

invalid conversion from 'int' to 'SAMPLE_FREQUENCY' [-fpermissive]

Remove argument from stm32_eth::eth_interrupt_handler

The function only does an "atomic" write, we could (unsafely) get the peripheral ourselves with ptr().

This will allow us to remove some unsafe from our examples without adding more complexity to them. Besides, the unsafe in the example is only sound because we know the internals of the function, if the function's internals change, they could become unsound, we shouldn't be giving this type of example to our users.

Add 10 Mbit and Half duplex support

Currently, the MAC is always configured for Fast Ethernet Speed and Full duplex. This means, AFAICT, that it will never work with a PHY that is configured differently (manually or though autonegotiation), which isn't great.

We can support such a feature if we decide to merge #45, or decide that adopting the ieee_802_3_miim crate (authored by me) is feasible.

Alternatively, we could add a callback to the new function that allows the user to interact with the MIIM to determine the speed and duplex mode, which can then be used during configuration of the MAC.

Getting started guide

Hi, I'm new into embedded stuff and I have an STM32F4 Disc board. What do I need in order to use this crate? Do you have any starting guide?

I'm currently trying to understand the needed hardware. emcraft suggests to use a WaveShare DP83848, but #8 seems to imply that it's not supported by this crate. Japaric has a blog post about embedded ethernet using ENC28J60, what should I buy?

`smoltcp::Device` implementation can be for `EthernetDMA` instead of `&mut EthernetDMA`

The current implementation still has the following signature:

impl<'a, 'rx, 'tx> smoltcp::Device for &'a mut EthernetDMA<'rx, 'tx> {}

However, the 'a lifetime is completely unused. We could change the impl to

impl<'rx, 'tx> smoltcp::Device for EthernetDMA<'rx, 'tx> {}

We should investigate whether this is still necessary (unlikely), or if it is just an artifact from how the Device trait worked in smoltcp 0.8 and older (likely).

Removing that lifetime and impl-ing directly for EthernetDMA would also remove the current oddness w.r.t. requiring that an &mut &mut EthernetDMA is passed to smoltcp functions.

Please publish version 0.2.0 on crates.io

While trying to use this crate, I copied the following from the readme:
stm32-eth = { version = "0.2.0", features = ["stm32f767"]}
To my surprise, this does not work since that version is not published on crates.io
So can someone publish the new version?

In the meantime, I will use:
stm32-eth = { git = "https://github.com/stm32-rs/stm32-eth.git", branch = "master", features = ["stm32f767"]}

Please let me know if there is something I can help with.

Phystatus with smoltcp

Using this crate with an F2 board (hopefully a PR coming with permission from my employer), working very well so far. One issue problem I've yet to handling is detecting physical disconnects of the ethernet cable, I know its possible with PhyStatus but when using Smoltcp the Eth interface it absorbed.

Just wondering how you have approached this or if you have any suggestions?

Document possible problems when placing buffers on a cacheable region

Quoting @adamgreig

if the dcache was enabled for the region the descriptor (or buffer) is in, it would need cleaning at this point (and the buffers would need invalidating on packet reception). Better to require that the descriptors and buffers are not placed in a dcache-enabled region, I think, and perhaps suggest they're placed in SRAM2 (even on F4) to reduce bus contention during DMA transfers.

Configuration fails in such a way that interrupts are never fired on stm32f4xx

When setting up an STM32F407, the configuration performed by stm32_eth sometimes fails.

We believe that the erratum described in section 2.11.5 of ES0182, Rev 13 (for F40x and F41x), section 2.17.5 of ES0206, Rev 18 (for F42x and F43x), and section 2.18.5 of ES0321, Rev 8 (for F46x and F47x), may be the cause. A fix requires that least 4 cycles of REF_CLK (usually 50 MHz) pass before a register can be written again, or that we re-write all modified (in the form of a read + write) registers after a delay of at least 4 cycles of REF_CLK.

Measures should be taken so that this can be avoided.

Can't compile stm32-eth v0.2.0

When I try to compile stm32-eth it can't compile the cortex-m dependencie. This error comes up three times and nothing else:

error[E0412]: cannot find type `RegisterBlock` in module `mpu`
   --> /home/nathan/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.2/src/peripheral/mod.rs:486:39
    |
486 |     pub const fn ptr() -> *const mpu::RegisterBlock {
    |                                       ^^^^^^^^^^^^^ not found in `mpu`
    |
help: consider importing one of these items
    |
58  | use crate::peripheral::cbp::RegisterBlock;
    |
58  | use crate::peripheral::cpuid::RegisterBlock;
    |
58  | use crate::peripheral::dcb::RegisterBlock;
    |
58  | use crate::peripheral::dwt::RegisterBlock;
    |
      and 7 other candidates

When I try to compile later version, the same error comes up. Is it my compiler? Or do the dependencies need to be updated?

Hardware MAC frame filter

By now stm32-eth crate always uses promiscuous mode on underlying ethernet peripheral. That means packets with all MAC addresses are allowed by hardware, requiring software to filter out packets by which MAC address should we accept. We can make use of STM32's hardware frame filter to allow only given MAC addresses or using its hardware bloom filter. In this way we reduce software overhead of processing network packets. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.