You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "laoniaokkk (via GitHub)" <gi...@apache.org> on 2023/08/04 04:20:48 UTC

[GitHub] [nuttx] laoniaokkk opened a new issue, #8833: w5500 ethernet can not work well

laoniaokkk opened a new issue, #8833:
URL: https://github.com/apache/nuttx/issues/8833

   When i use w5500 as a eth device,i found that when eth bring up, it only write the mac register, and ip netmask gateway is configured but not write into it's register. Then i wirte the config into ip register(netmask gateway etc.), i can ping my board by PC,but can not ping PC by my board. And in the driver of w5500, there is only socket0 is supported,in fact the w5500 is supported as much as 8 sockets. hope to fix this problem,thanks.


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] michi-jung commented on issue #8833: w5500 ethernet can not work well

Posted by "michi-jung (via GitHub)" <gi...@apache.org>.
michi-jung commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1474744785

   At the moment I only have board profile for one of my customer's proprietary boards, which I can not share.  I am planning to provide a profile for the `b-u585i-iot02a` board, but can't give a date at this point.


-- 
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


[GitHub] [nuttx] laoniaokkk commented on issue #8833: w5500 ethernet can not work well

Posted by "laoniaokkk (via GitHub)" <gi...@apache.org>.
laoniaokkk commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1475092844

   I use this pins for w5500:
   PB12 ---> ETH_INT
   PB13 ---> SPI_CLK
   PB14 ---> SPI_MISO
   PB15 ---> SPI_MOSI
   PD8 ---> ETH_CS
   PE14 ---> EHT_RST
   
   and this is my pin configs:
   #define GPIO_SPI2_MISO    GPIO_SPI2_MISO_1
   #define GPIO_SPI2_MOSI    GPIO_SPI2_MOSI_1
   #define GPIO_SPI2_SCK     GPIO_SPI2_SCK_2
   #define GPIO_W5500_CS      (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
                                GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN8)
   
   #define GPIO_W5500_RESET   (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
                                GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN14)
   
   #define GPIO_W5500_INTR     (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|\
                                GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN12)
   
   and this is the ifconfig show on console:
   nsh> ifconfig
   eth0    Link encap:Ethernet HWaddr 00:e0:de:ad:be:ef at UP
           inet addr:192.168.1.100 DRaddr:192.168.1.1 Mask:255.255.255.0
   
                IPv4   TCP   UDP  ICMP
   Received     0000  0000  0000  0000
   Dropped      0000  0000  0000  0000
     IPv4        VHL: 0000   Frg: 0000
     Checksum   0000  0000  0000  ----
     TCP         ACK: 0000   SYN: 0000
                 RST: 0000  0000
     Type       0000  ----  ----  0000
   Sent         0000  0000  0000  0000
     Rexmit     ----  0000  ----  ----
   nsh> ping 192.168.1.3
   PING 192.168.1.3 56 bytes of data
   No response from 192.168.1.3: icmp_seq=0 time=1000 ms
   No response from 192.168.1.3: icmp_seq=1 time=1000 ms
   No response from 192.168.1.3: icmp_seq=2 time=1000 ms
   
   I can not ping PC by board or ping board by PC.
   Only when i write the registers(ip netmask gateway) in function "w5500_unfence(FAR struct w5500_driver_s *self)",i can ping board by PC,but can not ping PC by board
   


-- 
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


[GitHub] [nuttx] michi-jung commented on issue #8833: w5500 ethernet can not work well

Posted by "michi-jung (via GitHub)" <gi...@apache.org>.
michi-jung commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1633744341

   [stm32_exti.h.diff.txt](https://github.com/apache/nuttx/files/12036753/stm32_exti.h.diff.txt)
   [stm32_exti_gpio.c.diff.txt](https://github.com/apache/nuttx/files/12036754/stm32_exti_gpio.c.diff.txt)
   [stm32_w5500.c.txt](https://github.com/apache/nuttx/files/12036761/stm32_w5500.c.txt)
   ![Untitled](https://github.com/apache/nuttx/assets/17204329/0bbefe35-8129-4117-8077-827f95d7d6b4)
   


-- 
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


[GitHub] [nuttx] laoniaokkk commented on issue #8833: w5500 ethernet can not work well

Posted by "laoniaokkk (via GitHub)" <gi...@apache.org>.
laoniaokkk commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1474762874

   I just test it on stm32f407,and use the config of boards/arm/stm32/stm32f4discovery/ether_w5500 but change some pins of spi


-- 
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


[GitHub] [nuttx] laoniaokkk commented on issue #8833: w5500 ethernet can not work well

Posted by "laoniaokkk (via GitHub)" <gi...@apache.org>.
laoniaokkk commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1665218103

   @michi-jung Hi, the w5500.c was just used from nuttx 12.0.0
   [config.txt](https://github.com/apache/nuttx/files/12258764/config.txt)
   [stm32_exti_gpio.txt](https://github.com/apache/nuttx/files/12258767/stm32_exti_gpio.txt)
   [stm32_w5500.txt](https://github.com/apache/nuttx/files/12258768/stm32_w5500.txt)
   [w5500.txt](https://github.com/apache/nuttx/files/12258769/w5500.txt)
   


-- 
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


[GitHub] [nuttx] michi-jung commented on issue #8833: w5500 ethernet can not work well

Posted by "michi-jung (via GitHub)" <gi...@apache.org>.
michi-jung commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1633606840

   @laoniaokkk I believe you are loosing interrupte because of the issue described [here](https://github.com/apache/nuttx/blob/0ee304954a327394e493703ea78b8f6c221d2868/boards/arm/stm32/stm32f4discovery/src/stm32_w5500.c#L141).
   
   In the w5500_lower implementation of my custom board the enable method looks as follows:
   
   ```
   static void w5500_enable(const struct w5500_lower_s *lower,
                            bool enable)
   {     
     struct stm32_w5500_lower_s *self = (struct stm32_w5500_lower_s *)lower;
   
     stm32_gpiosetevent(self->gpio_intn,
                        false, /* rising edge  */
                        true,  /* falling edge */
                        false, /* event        */
                        enable ? self->handler : NULL,
                        enable ? self->arg : NULL);
         
     /* If interrupt is still pending trigger interrupt handler. */
         
     if (enable && !stm32_gpioread(self->gpio_intn))
       {
         stm32_gpioswirq(self->gpio_intn);
       }   
   }
   ```
   
   I think stm32_w5500.c should be modified accordingly.


-- 
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


[GitHub] [nuttx] laoniaokkk commented on issue #8833: w5500 ethernet can not work well

Posted by "laoniaokkk (via GitHub)" <gi...@apache.org>.
laoniaokkk commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1634055172

   @michi-jung Thank you very much! The net is work well now.


-- 
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


[GitHub] [nuttx] acassis commented on issue #8833: w5500 ethernet can not work well

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1473913936

   Thank you @michi-jung !!! BTW, do you have a board profile example that uses this w5500 that we could use as reference?


-- 
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


[GitHub] [nuttx] laoniaokkk commented on issue #8833: w5500 ethernet can not work well

Posted by "laoniaokkk (via GitHub)" <gi...@apache.org>.
laoniaokkk commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1664947744

   @michi-jung     I tested the network with examples/Simple TCP echo server, when sending data to the server in a period of 50ms, after a period of time the w5500 will reset, the network is not available, and then manually restart the network card with the 'ifdown eth0', 'ifup eth0' commands, the network is still unavailable. The same test environment and methodology, using LAN8720 did not cause similar problems.


-- 
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


[GitHub] [nuttx] acassis commented on issue #8833: w5500 ethernet can not work well

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1475395063

   Thank you very much!


-- 
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


[GitHub] [nuttx] michi-jung commented on issue #8833: w5500 ethernet can not work well

Posted by "michi-jung (via GitHub)" <gi...@apache.org>.
michi-jung commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1472477103

   The w5500 driver uses the chip in MACRAW mode, i.e. only at the Ethernet level.  All IP processing is done by NuttX's networking stack.  This is why only the MAC is written to a chip register and why only 'socket0' is used to exchange raw Ethernet frames.
   
   You wrote
   > Then i wirte the config into ip register(netmask gateway etc.) [...]
   
   Do you mean that you extended the code to write the e.g. the netmask gateway into the W5500's registers?  This does not make sense for the MACRAW mode.


-- 
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


[GitHub] [nuttx] laoniaokkk commented on issue #8833: w5500 ethernet can not work well

Posted by "laoniaokkk (via GitHub)" <gi...@apache.org>.
laoniaokkk commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1633718120

   @michi-jung  Yes, i used "stm32f4discovery/stm32_w5500.c " file to config w5500.
   But i don't find "stm32_gpioswirq" method in nuttx, do you means disable and enable interrupt pin? Can you show your “stm32_w5500.c” file?


-- 
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


[GitHub] [nuttx] laoniaokkk closed issue #8833: w5500 ethernet can not work well

Posted by "laoniaokkk (via GitHub)" <gi...@apache.org>.
laoniaokkk closed issue #8833: w5500 ethernet can not work well
URL: https://github.com/apache/nuttx/issues/8833


-- 
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


[GitHub] [nuttx] laoniaokkk commented on issue #8833: w5500 ethernet can not work well

Posted by "laoniaokkk (via GitHub)" <gi...@apache.org>.
laoniaokkk commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1634200870

   > 
   I'm just modifying it(stm32_w5500.c  and stm32_exit_gpio.c) based on your docs. The drive of w5500 is correct, and actually your configuration of stm32_w5500 is valid
   


-- 
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


[GitHub] [nuttx] laoniaokkk commented on issue #8833: w5500 ethernet can not work well

Posted by "laoniaokkk (via GitHub)" <gi...@apache.org>.
laoniaokkk commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1633486068

   When I debug w5500, i found that: when send an icmp pack to PC, the PC will reply in 1ms. And in the w5500 driver ,it will disable the interrupt first when receive an interrupt ,and enable the interrupt after processed the receive data. It will take some time,and maybe lost  some interrupts(data). So i remove the code of disable interrupt from function "w5500_interrupt", after that the net work well. I don't know if this will cause other problems


-- 
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


[GitHub] [nuttx] michi-jung commented on issue #8833: w5500 ethernet can not work well

Posted by "michi-jung (via GitHub)" <gi...@apache.org>.
michi-jung commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1634139783

   @laoniaokkk Would you be willing to bring your fix upstream?


-- 
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


[GitHub] [nuttx] michi-jung commented on issue #8833: w5500 ethernet can not work well

Posted by "michi-jung (via GitHub)" <gi...@apache.org>.
michi-jung commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1665163770

   Hi @laoniaokkk,
   
   could you please provide your w5500_lower implementation?
   
   Thanks!


-- 
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


[GitHub] [nuttx] acassis commented on issue #8833: w5500 ethernet can not work well

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1472439132

   @michi-jung did you face this issue when you created the driver?


-- 
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


[GitHub] [nuttx] acassis commented on issue #8833: w5500 ethernet can not work well

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1475031607

   Hi @laoniaokkk which pins did you change? Do you please share your modifications?


-- 
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


[GitHub] [nuttx] laoniaokkk commented on issue #8833: w5500 ethernet can not work well

Posted by "laoniaokkk (via GitHub)" <gi...@apache.org>.
laoniaokkk commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1635586929

   @michi-jung I am sorry but i don't have the stm32f4discovery board yet, i test it on my own board. And i find after some times(a few minutes or hours) late ,the network will "death", and then put "ifconfig" command, the status of net is up but can not  ping


-- 
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


[GitHub] [nuttx] michi-jung commented on issue #8833: w5500 ethernet can not work well

Posted by "michi-jung (via GitHub)" <gi...@apache.org>.
michi-jung commented on issue #8833:
URL: https://github.com/apache/nuttx/issues/8833#issuecomment-1634210413

   @laoniaokkk It would be nice to have the `boards/arm/stm32/stm32f4discovery/ether_w5500` configuration running out of the box on upstream nuttx.  Could you take care of this?  I do not have access to this board.


-- 
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