You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "acassis (via GitHub)" <gi...@apache.org> on 2023/01/28 13:45:51 UTC
[GitHub] [nuttx] acassis commented on issue #8325: RNDIS/CDC-ECM/CDC-NCM
acassis commented on issue #8325:
URL: https://github.com/apache/nuttx/issues/8325#issuecomment-1407402516
I posted in the mailing list how to get it working, I will duplicate the steps here for future reference:
```
Configure your board:
=====================
$ ./tools/configure.sh stm32f4discovery:rndis
Compile NuttX to your board:
============================
$ make -j
Flash to your board:
====================
$ sudo openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000"
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 2000 kHz
Info : STLINK V2J14S0 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.203144
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f4x.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000188 msp: 0x20003f24
Info : device id = 0x10036413
Info : flash size = 1024 kbytes
auto erase enabled
wrote 262144 bytes from file nuttx.bin in 11.043253s (23.182 KiB/s)
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Reset your board
================
Run dmesg to confirm that USB RNDIS device was detected:
========================================================
[ 1099.821480] usb 3-3: new full-speed USB device number 12 using xhci_hcd
[ 1099.972379] usb 3-3: New USB device found, idVendor=584e, idProduct=5342, bcdDevice= 0.01
[ 1099.972389] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1099.972393] usb 3-3: Product: RNDIS gadget
[ 1099.972396] usb 3-3: Manufacturer: NuttX
[ 1099.972398] usb 3-3: SerialNumber: 1234
[ 1099.988952] usbcore: registered new interface driver cdc_ether
[ 1099.990144] rndis_host 3-3:1.0: skipping garbage
[ 1099.990641] rndis_host 3-3:1.0: dev can't take 1558 byte packets (max 660), adjusting MTU to 602
[ 1099.992089] rndis_host 3-3:1.0 eth0: register 'rndis_host' at usb-0000:00:14.0-3, RNDIS device, a0:e0:de:ad:ca:fe
[ 1099.992102] usbcore: registered new interface driver rndis_host
[ 1099.994026] usbcore: registered new interface driver rndis_wlan
[ 1099.997001] rndis_host 3-3:1.0 enxa0e0deadcafe: renamed from eth0
Configure your Ubuntu or other Linux distro to share network:
=============================================================
Click in the top right corner of your Ubuntu and go to:
NuttX Ethernet -> Wired Settings
Click in the 'Gear icon' and in the tab "IPv4" select: "Shared to other computers"
Click on "Apply"
Disconect and connect the USB cable to force it to get IP.
Verify which IP your board got:
===============================
$ tail -f /var/log/syslog
...
Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPDISCOVER(enxa0e0deadcafe) 00:e0:de:ad:ca:fe
Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPOFFER(enxa0e0deadcafe) 10.42.0.86 00:e0:de:ad:ca:fe
Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPREQUEST(enxa0e0deadcafe) 10.42.0.86 00:e0:de:ad:ca:fe
Jan 28 10:30:24 dev dnsmasq-dhcp[35526]: DHCPACK(enxa0e0deadcafe) 10.42.0.86 00:e0:de:ad:ca:fe nuttx
Jan 28 10:30:29 dev systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
^C
Ping this IP to confirm it is working:
======================================
alan@dev:~/nuttxspace/nuttx$ ping 10.42.0.86
PING 10.42.0.86 (10.42.0.86) 56(84) bytes of data.
64 bytes from 10.42.0.86: icmp_seq=1 ttl=64 time=0.809 ms
64 bytes from 10.42.0.86: icmp_seq=2 ttl=64 time=0.849 ms
^C
--- 10.42.0.86 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1027ms
rtt min/avg/max/mdev = 0.809/0.829/0.849/0.020 ms
Connect to your board over telnet:
==================================
alan@dev:~/nuttxspace/nuttx$ telnet 10.42.0.86
Trying 10.42.0.86...
Connected to 10.42.0.86.
Escape character is '^]'.
NuttShell (NSH) NuttX-12.0.0
nsh>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org