aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32f7/src/bin/eth.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stm32f7/src/bin/eth.rs')
-rw-r--r--examples/stm32f7/src/bin/eth.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs
index f0e280c35..93c97c8ee 100644
--- a/examples/stm32f7/src/bin/eth.rs
+++ b/examples/stm32f7/src/bin/eth.rs
@@ -80,7 +80,10 @@ async fn main(spawner: Spawner) -> ! {
80 )); 80 ));
81 81
82 // Launch network task 82 // Launch network task
83 unwrap!(spawner.spawn(net_task(&stack))); 83 unwrap!(spawner.spawn(net_task(stack)));
84
85 // Ensure DHCP configuration is up before trying connect
86 stack.wait_config_up().await;
84 87
85 info!("Network task initialized"); 88 info!("Network task initialized");
86 89
@@ -98,6 +101,7 @@ async fn main(spawner: Spawner) -> ! {
98 let r = socket.connect(remote_endpoint).await; 101 let r = socket.connect(remote_endpoint).await;
99 if let Err(e) = r { 102 if let Err(e) = r {
100 info!("connect error: {:?}", e); 103 info!("connect error: {:?}", e);
104 Timer::after(Duration::from_secs(1)).await;
101 continue; 105 continue;
102 } 106 }
103 info!("connected!"); 107 info!("connected!");
@@ -106,7 +110,7 @@ async fn main(spawner: Spawner) -> ! {
106 let r = socket.write_all(&buf).await; 110 let r = socket.write_all(&buf).await;
107 if let Err(e) = r { 111 if let Err(e) = r {
108 info!("write error: {:?}", e); 112 info!("write error: {:?}", e);
109 continue; 113 break;
110 } 114 }
111 Timer::after(Duration::from_secs(1)).await; 115 Timer::after(Duration::from_secs(1)).await;
112 } 116 }