stm32-rs / stm32-eth

Embedded Ethernet driver in Rust
Apache License 2.0
147 stars 47 forks source link

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

Closed alios closed 1 year ago

alios commented 1 year ago

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.

roel0 commented 1 year ago

I can reproduce on stm32f437. 0.4.1 works fine, HEAD of master I don;t receive ANY interrupts

datdenkikniet commented 1 year ago

Hmm, that's... Concerning. Could any of you try it with 9987cbeec90e62aeda0329e7547f29ac3244a074? It still has smoltcp 0.9, but drops the async-await support, which is where I think I've introduced the bug. The async-await PR has been working for me this far on an F7 but I haven't been able to test it on an F4 and I have incorrectly assumed that it would keep working.

alios commented 1 year ago

@datdenkikniet with 9987cbe everything works just fine - so I guess your idea might be correct.

datdenkikniet commented 1 year ago

Thank you for confirming.

Alright, I have absolutely now idea how it got through, or how it ever worked for me, but I may have found the problem.

Please try with https://github.com/stm32-rs/stm32-eth/pull/80 current master and report.

alios commented 1 year ago

@datdenkikniet Tested the rtic-echo example again as well as my own code base and with the new master and the patch from #80 everything seems to work again.

Big thnx

datdenkikniet commented 1 year ago

Awesome! Thanks again for reporting and confirming to both you and @roel0