Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/stm32/periph/stm32_eth: provide confirm_send #18428

Merged

Conversation

maribu
Copy link
Member

@maribu maribu commented Aug 9, 2022

Contribution description

This updates the STM32 Ethernet driver to the new netdev API that includes netdev_driver_t::confirm_send(). It changes the netdev_driver_t::send() function to no longer block.

Testing procedure

Networking with the STM32 Ethernet peripheral should still work correctly.

Issues/PRs references

Depends on and includes:

@github-actions github-actions bot added Area: boards Area: Board ports Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers Area: LoRa Area: LoRa radio support Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System Platform: ARM Platform: This PR/issue effects ARM-based platforms Platform: ESP Platform: This PR/issue effects ESP-based platforms labels Aug 9, 2022
@github-actions github-actions bot added Platform: native Platform: This PR/issue effects the native platform Area: tests Area: tests and testing framework Area: drivers Area: Device drivers Platform: ESP Platform: This PR/issue effects ESP-based platforms Area: examples Area: Example Applications labels Apr 30, 2024
@maribu maribu force-pushed the cpu/stm32/periph/stm32_eth/confirm_send branch 2 times, most recently from c50d7d8 to 035c301 Compare April 30, 2024 07:01
@maribu
Copy link
Member Author

maribu commented Apr 30, 2024

With GNRC

RIOT --> Linux

$ make BOARD=nucleo-f429zi flash term -C examples/gcoap
[...]
> 2024-04-30 09:05:57,462 # gcoap: response Success, code 2.05, 11 bytes
2024-04-30 09:05:57,462 # RIOT rocks!

Linux --> RIOT

coap_cli '[fe80::dc27:7cff:fe18:6576]' -p /.well-known/core
[fe80::2e0:4cff:fe68:888]:40320 ==> [fe80::dc27:7cff:fe18:6576]:5683
--> [fe80::dc27:7cff:fe18:6576]:5683 CON-28377 [ba96c7a6ce09b862] 0.01 GET
<-- [fe80::dc27:7cff:fe18:6576]:5683 ACK-28377 [ba96c7a6ce09b862] 2.05 Content
Content-Format: application/link-format
Payload: 46 bytes

+----------------------------------------------------+---------------------------+--------------------+--------------------+----------+---+
|                        URI                         |      Content Format       |   Resource Type    |     Interface      |   Size   | O |
+----------------------------------------------------+---------------------------+--------------------+--------------------+----------+---+
| /cli/stats                                         | text/plain; charset=utf-8 | count              | -                  |        - | ✓ |
| /riot/board                                        | Unspecified               | -                  | -                  |        - | ✗ |
+----------------------------------------------------+---------------------------+--------------------+--------------------+----------+---+

@maribu
Copy link
Member Author

maribu commented Apr 30, 2024

with lwIP

RIOT --> Linux

make LWIP_IPV4=1 BOARD=nucleo-f429zi flash term
Building application "gcoap_example" for "nucleo-f429zi" with CPU "stm32".

"make" -C /home/maribu/Repos/software/RIOT/master/pkg/cmsis/ 
"make" -C /home/maribu/Repos/software/RIOT/master/pkg/lwip/ 
"make" -C /home/maribu/.cache/RIOT/pkg/lwip/src/api -f /home/maribu/Repos/software/RIOT/master/Makefile.base MODULE=lwip_api
"make" -C /home/maribu/.cache/RIOT/pkg/lwip/src/core -f /home/maribu/Repos/software/RIOT/master/Makefile.base MODULE=lwip_core
"make" -C /home/maribu/.cache/RIOT/pkg/lwip/src/core/ipv4 -f /home/maribu/Repos/software/RIOT/master/Makefile.base MODULE=lwip_ipv4
"make" -C /home/maribu/.cache/RIOT/pkg/lwip/src/netif -f /home/maribu/Repos/software/RIOT/master/Makefile.base MODULE=lwip_netif
"make" -C /home/maribu/.cache/RIOT/pkg/lwip -f /home/maribu/Repos/software/RIOT/master/Makefile.base MODULE=lwip
"make" -C /home/maribu/Repos/software/RIOT/master/boards/common/init
"make" -C /home/maribu/Repos/software/RIOT/master/boards/nucleo-f429zi
"make" -C /home/maribu/Repos/software/RIOT/master/boards/common/nucleo
"make" -C /home/maribu/Repos/software/RIOT/master/core
"make" -C /home/maribu/Repos/software/RIOT/master/core/lib
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/stm32
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/cortexm_common
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/cortexm_common/periph
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/stm32/periph
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/stm32/stmclk
"make" -C /home/maribu/Repos/software/RIOT/master/cpu/stm32/vectors
"make" -C /home/maribu/Repos/software/RIOT/master/drivers
"make" -C /home/maribu/Repos/software/RIOT/master/drivers/netdev
"make" -C /home/maribu/Repos/software/RIOT/master/drivers/periph_common
"make" -C /home/maribu/Repos/software/RIOT/master/pkg/lwip/contrib
"make" -C /home/maribu/Repos/software/RIOT/master/pkg/lwip/contrib/netdev
"make" -C /home/maribu/Repos/software/RIOT/master/pkg/lwip/contrib/sock
"make" -C /home/maribu/Repos/software/RIOT/master/pkg/lwip/contrib/sock/udp
"make" -C /home/maribu/Repos/software/RIOT/master/pkg/lwip/init_devs
"make" -C /home/maribu/Repos/software/RIOT/master/sys
"make" -C /home/maribu/Repos/software/RIOT/master/sys/auto_init
"make" -C /home/maribu/Repos/software/RIOT/master/sys/div
"make" -C /home/maribu/Repos/software/RIOT/master/sys/event
"make" -C /home/maribu/Repos/software/RIOT/master/sys/fmt
"make" -C /home/maribu/Repos/software/RIOT/master/sys/frac
"make" -C /home/maribu/Repos/software/RIOT/master/sys/iolist
"make" -C /home/maribu/Repos/software/RIOT/master/sys/isrpipe
"make" -C /home/maribu/Repos/software/RIOT/master/sys/libc
"make" -C /home/maribu/Repos/software/RIOT/master/sys/luid
"make" -C /home/maribu/Repos/software/RIOT/master/sys/malloc_thread_safe
"make" -C /home/maribu/Repos/software/RIOT/master/sys/net/application_layer/gcoap
"make" -C /home/maribu/Repos/software/RIOT/master/sys/net/application_layer/nanocoap
"make" -C /home/maribu/Repos/software/RIOT/master/sys/net/link_layer/eui_provider
"make" -C /home/maribu/Repos/software/RIOT/master/sys/net/link_layer/l2util
"make" -C /home/maribu/Repos/software/RIOT/master/sys/net/netif
"make" -C /home/maribu/Repos/software/RIOT/master/sys/net/netutils
"make" -C /home/maribu/Repos/software/RIOT/master/sys/net/network_layer/ipv4/addr
"make" -C /home/maribu/Repos/software/RIOT/master/sys/net/network_layer/ipv6/addr
"make" -C /home/maribu/Repos/software/RIOT/master/sys/net/sock
"make" -C /home/maribu/Repos/software/RIOT/master/sys/net/sock/async/event
"make" -C /home/maribu/Repos/software/RIOT/master/sys/newlib_syscalls_default
"make" -C /home/maribu/Repos/software/RIOT/master/sys/od
"make" -C /home/maribu/Repos/software/RIOT/master/sys/pm_layered
"make" -C /home/maribu/Repos/software/RIOT/master/sys/posix/inet
"make" -C /home/maribu/Repos/software/RIOT/master/sys/preprocessor
"make" -C /home/maribu/Repos/software/RIOT/master/sys/ps
"make" -C /home/maribu/Repos/software/RIOT/master/sys/random
"make" -C /home/maribu/Repos/software/RIOT/master/sys/sema
"make" -C /home/maribu/Repos/software/RIOT/master/sys/shell
"make" -C /home/maribu/Repos/software/RIOT/master/sys/shell/cmds
"make" -C /home/maribu/Repos/software/RIOT/master/sys/stdio
"make" -C /home/maribu/Repos/software/RIOT/master/sys/stdio_uart
"make" -C /home/maribu/Repos/software/RIOT/master/sys/tsrb
"make" -C /home/maribu/Repos/software/RIOT/master/sys/ztimer
   text	  data	   bss	   dec	   hex	filename
  62460	   768	 16612	 79840	 137e0	/home/maribu/Repos/software/RIOT/master/examples/gcoap/bin/nucleo-f429zi/gcoap_example.elf
/home/maribu/Repos/software/RIOT/master/dist/tools/openocd/openocd.sh flash /home/maribu/Repos/software/RIOT/master/examples/gcoap/bin/nucleo-f429zi/gcoap_example.elf
### Flashing Target ###
Open On-Chip Debugger 0.12.0+dev-snapshot (2024-01-17-08:38)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'adapter serial' not 'hla_serial'
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : clock speed 2000 kHz
Info : STLINK V2J29M18 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.246873
Info : [stm32f4x.cpu] Cortex-M4 r0p1 processor detected
Info : [stm32f4x.cpu] target has 6 breakpoints, 4 watchpoints
Info : [stm32f4x.cpu] Examination succeed
Info : starting gdb server for stm32f4x.cpu on 0
Info : Listening on port 34613 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32f4x.cpu       hla_target little stm32f4x.cpu       unknown
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
[stm32f4x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x080013e0 msp: 0x20000200
Info : device id = 0x20016419
Info : flash size = 2048 KiB
Info : Dual Bank 2048 kiB STM32F42x/43x/469/479 found
auto erase enabled
wrote 65536 bytes from file /home/maribu/Repos/software/RIOT/master/examples/gcoap/bin/nucleo-f429zi/gcoap_example.elf in 2.058088s (31.097 KiB/s)
verified 63228 bytes in 0.512662s (120.442 KiB/s)
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
shutdown command invoked
Done flashing
/home/maribu/Repos/software/RIOT/master/dist/tools/pyterm/pyterm -p "/dev/ttyACM1" -b "115200"  
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2024-04-30 09:50:46,731 # Connect to serial port /dev/ttyACM1
Welcome to pyterm!
Type '/exit' to exit.
ifconfig
2024-04-30 09:52:30,870 # ifconfig
2024-04-30 09:52:30,875 # Iface ET0 HWaddr: de:27:7c:18:65:76 Link: up State: up
2024-04-30 09:52:30,877 #         Link type: wired
2024-04-30 09:52:30,883 #         inet addr: 192.168.0.70 mask: 255.255.255.0 gw: 192.168.0.1
coap get 192.168.0.1 /msg
2024-04-30 09:52:33,691 # coap get 192.168.0.1 /msg
2024-04-30 09:52:33,695 # gcoap_cli: sending msg ID 45267, 10 bytes
> 2024-04-30 09:52:33,700 # gcoap: response Success, code 2.05, 11 bytes
2024-04-30 09:52:33,701 # RIOT rocks!

Linux --> RIOT

$ coap_cli 192.168.0.70 -p /riot/board          
192.168.0.1:3876 ==> 192.168.0.70:5683
--> 192.168.0.70:5683 CON-18985 [174e1edce29c0f45] 0.01 GET
<-- 192.168.0.70:5683 ACK-18985 [174e1edce29c0f45] 2.05 Content
Content-Format: text/plain; charset=utf-8
Payload: 13 bytes

nucleo-f429zi

@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: waiting for other PR State: The PR requires another PR to be merged first labels May 6, 2024
@riot-ci
Copy link

riot-ci commented May 6, 2024

Murdock results

✔️ PASSED

14795d4 cpu/stm32/periph/eth: update to new API

Success Failures Total Runtime
10082 0 10083 13m:12s

Artifacts

@benpicco
Copy link
Contributor

benpicco commented May 8, 2024

This needs a rebase

@maribu maribu force-pushed the cpu/stm32/periph/stm32_eth/confirm_send branch from 035c301 to 14795d4 Compare May 8, 2024 19:06
@github-actions github-actions bot removed Platform: native Platform: This PR/issue effects the native platform Area: tests Area: tests and testing framework Area: pkg Area: External package ports Area: drivers Area: Device drivers Platform: ESP Platform: This PR/issue effects ESP-based platforms Area: examples Area: Example Applications labels May 8, 2024
@benpicco benpicco enabled auto-merge May 9, 2024 08:20
@benpicco benpicco added this pull request to the merge queue May 9, 2024
Merged via the queue into RIOT-OS:master with commit 1b9716c May 9, 2024
26 checks passed
@maribu maribu deleted the cpu/stm32/periph/stm32_eth/confirm_send branch May 9, 2024 11:48
@maribu
Copy link
Member Author

maribu commented May 9, 2024

Thx a lot :)

Now everything is in place to add PTP support upstream 🎉

@mguetschow mguetschow added this to the Release 2024.07 milestone Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports Area: network Area: Networking Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants