mattmyne / usbnet

USB ethernet network example for Raspberry Pi Pico
2 stars 0 forks source link

Unable to build for Picosdk 2.0.0 on Ubuntu #1

Open spit4520 opened 3 weeks ago

spit4520 commented 3 weeks ago

Hi!

Wonderful repo! The Host OS shouldn't matter, but I can't re-build your example for some reason.

I've pegged my Picosdk to the version 2.0.0 (this commit id efe2103f9b28458a1615ff096054479743ade236, but for some reason CFG_TUD_NET_MTU (found at path $PICO_SDK_PATH/lib/tinyusb/src/class/net/net_device.h isn't defined. I've tried setting CFG_TUD_NCM manually to 1 in tusb_config.h

and I've added these statements to my tusb_config.h:

#ifndef CFG_TUD_NCM
#pragma message ( "warning!! CFG_TUD_NCM 0" )
#else
#pragma message ( "CFG_TUD_NCM 1" )
#ifdef CFG_TUD_NET_MTU
#pragma message("CFG_TUD_NET_MTU is set")
#else
#pragma message("CFG_TUD_NET_MTU is not set")
#endif
#endif

Here are the attached error logs:

/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/tusb_config.h:121:9: note: '#pragma message: CFG_TUD_NCM 1'          
  121 | #pragma message ( "CFG_TUD_NCM 1" )                                                                                                 
      |         ^~~~~~~                                                                                                                     
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/tusb_config.h:125:9: note: '#pragma message: CFG_TUD_NET_MTU is not s
et'                                                                                                                                         
  125 | #pragma message("CFG_TUD_NET_MTU is not set")                                                                                       
      |         ^~~~~~~                                                                                                                     
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c: In function 'tud_output':                             
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:62:10: warning: implicit declaration of function 'tud_r
eady' [-Wimplicit-function-declaration]                                                                                                     
   62 |     if (!tud_ready()) {                                                                                                             
      |          ^~~~~~~~~                                                                                                                  
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:67:9: warning: implicit declaration of function 'tud_ne
twork_can_xmit' [-Wimplicit-function-declaration]                                                                                           
   67 |     if (tud_network_can_xmit(p->tot_len)) {                                                                                         
      |         ^~~~~~~~~~~~~~~~~~~~                                                                                                        
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:68:7: warning: implicit declaration of function 'tud_ne
twork_xmit'; did you mean 'usb_network_init'? [-Wimplicit-function-declaration]                                                             
   68 |       tud_network_xmit(p, 0);                                                                                                       
      |       ^~~~~~~~~~~~~~~~                                                                                                              
      |       usb_network_init                                                                                                              
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:74:5: warning: implicit declaration of function 'tud_task' [-Wimplicit-function-declaration]
   74 |     tud_task();
         |     ^~~~~~~~
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c: In function 'netif_init_cb':
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:81:16: error: 'CFG_TUD_NET_MTU' undeclared (first use i
n this function); did you mean 'CFG_TUD_NCM'?
   81 |   netif->mtu = CFG_TUD_NET_MTU;
      |                ^~~~~~~~~~~~~~~
      |                CFG_TUD_NCM
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:81:16: note: each undeclared identifier is reported onl
y once for each function it appears in
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c: In function 'service_traffic':
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:145:5: warning: implicit declaration of function 'tud_n
etwork_recv_renew'; did you mean 'tud_network_recv_cb'? [-Wimplicit-function-declaration]
  145 |     tud_network_recv_renew();
      |     ^~~~~~~~~~~~~~~~~~~~~~
      |     tud_network_recv_cb
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c: In function 'usb_network_init':
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:157:8: warning: implicit declaration of function 'tud_i
nit'; did you mean 'tusb_init'? [-Wimplicit-function-declaration]
  157 |   if (!tud_init(PICO_TUD_RHPORT)) {
      |        ^~~~~~~~
      |        tusb_init
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c: In function 'usb_network_deinit':
/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:222:3: warning: implicit declaration of function 'tud_d
einit' [-Wimplicit-function-declaration]
  222 |   tud_deinit(PICO_TUD_RHPORT);
      |   ^~~~~~~~~~
make[2]: *** [CMakeFiles/usbnet.dir/build.make:90: CMakeFiles/usbnet.dir/usb_network.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:1745: CMakeFiles/usbnet.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

I don't use VSCode, but I don't think that is a factor in it. Let me know if you can provide any help and maybe if you can upload a working UF2 that would be cool

Thank you,

S.Joseph, EDGE Labs.

mattmyne commented 3 weeks ago

Hello

Thanks for your interest in the repo. Have you tried compiling against the latest Pico SDK? I've not tried compiling against 2.0.0.

Given the number of TinyUSB-related missing declarations, assuming "tinyusb_device" remains in the target_link_libraries of CMakeLists.txt, then perhaps these missing declarations were in a later version of the TinyUSB library than the one linked in your Pico SDK version?

Kind Regards

Matt


From: spit4520 @.> Sent: 30 October 2024 04:13 To: mattmyne/usbnet @.> Cc: Subscribed @.***> Subject: [mattmyne/usbnet] Unable to build for Picosdk 2.0.0 on Ubuntu (Issue #1)

Hi!

Wonderful repo! The Host OS shouldn't matter, but I can't re-build your example for some reason.

I've pegged my Picosdk to the version 2.0.0 (this commit id efe2103f9b28458a1615ff096054479743ade236https://github.com/raspberrypi/pico-sdk/commit/efe2103f9b28458a1615ff096054479743ade236, but for some reason CFG_TUD_NET_MTU (found at path $PICO_SDK_PATH/lib/tinyusb/src/class/net/net_device.h isn't defined. I've tried setting CFG_TUD_NCM manually to 1 in tusb_config.h

and I've added these statements to my tusb_config.h:

ifndef CFG_TUD_NCM #pragma message ( "warning!! CFG_TUD_NCM 0" ) #else #pragma message ( "CFG_TUD_NCM 1" ) #ifdef CFG_TUD_NET_MTU #pragma message("CFG_TUD_NET_MTU is set") #else #pragma message("CFG_TUD_NET_MTU is not set") #endif #endif

Here are the attached error logs:

`/home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/tusb_config.h:121:9: note: '#pragma message: CFG_TUD_NCM 1' 121 | #pragma message ( "CFG_TUD_NCM 1" ) | ^~~ /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/tusb_config.h:125:9: note: '#pragma message: CFG_TUD_NET_MTU is not s et' 125 | #pragma message("CFG_TUD_NET_MTU is not set") | ^~~ /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c: In function 'tud_output': /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:62:10: warning: implicit declaration of function 'tud_r eady' [-Wimplicit-function-declaration] 62 | if (!tud_ready()) { | ^~~~~ /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:67:9: warning: implicit declaration of function 'tud_ne twork_can_xmit' [-Wimplicit-function-declaration] 67 | if (tud_network_can_xmit(p->tot_len)) { | ^~~~~~~~ /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:68:7: warning: implicit declaration of function 'tud_ne twork_xmit'; did you mean 'usb_network_init'? [-Wimplicit-function-declaration] 68 | tud_network_xmit(p, 0); | ^~~~ | usb_network_init /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:74:5: warning: implicit declaration of function 'tud_task' [-Wimplicit-function-declaration] 74 | tud_task(); | ^~~~ /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c: In function 'netif_init_cb': /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:81:16: error: 'CFG_TUD_NET_MTU' undeclared (first use i n this function); did you mean 'CFG_TUD_NCM'? 81 | netif->mtu = CFG_TUD_NET_MTU; | ^~~~~~~ | CFG_TUD_NCM /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:81:16: note: each undeclared identifier is reported onl y once for each function it appears in /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c: In function 'service_traffic': /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:145:5: warning: implicit declaration of function 'tud_n etwork_recv_renew'; did you mean 'tud_network_recv_cb'? [-Wimplicit-function-declaration] 145 | tud_network_recv_renew(); | ^~~~~~ | tud_network_recv_cb /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c: In function 'usb_network_init': /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:157:8: warning: implicit declaration of function 'tud_i nit'; did you mean 'tusb_init'? [-Wimplicit-function-declaration] 157 | if (!tud_init(PICO_TUD_RHPORT)) { | ^~~~ | tusb_init /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c: In function 'usb_network_deinit': /home/sspitler/Developer/firmware/rp2040/eth_over_usb_emulation/usbnet/usb_network.c:222:3: warning: implicit declaration of function 'tud_d einit' [-Wimplicit-function-declaration] 222 | tud_deinit(PICO_TUD_RHPORT); | ^~~~~~ make[2]: [CMakeFiles/usbnet.dir/build.make:90: CMakeFiles/usbnet.dir/usb_network.c.obj] Error 1 make[1]: [CMakeFiles/Makefile2:1745: CMakeFiles/usbnet.dir/all] Error 2 make: *** [Makefile:91: all] Error 2

`

I don't use VSCode, but I don't think that is a factor in it. Let me know if you can provide any help and maybe if you can upload a working UF2 that would be cool

Thank you,

S.Joseph, EDGE Labs.

— Reply to this email directly, view it on GitHubhttps://github.com/mattmyne/usbnet/issues/1, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFUJ7XGDPGXXL5FJ6ONBVFLZ6BMHNAVCNFSM6AAAAABQ3H3E6SVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYZDEOBUGAYDKOI. You are receiving this because you are subscribed to this thread.Message ID: @.***>