Discussion:
The serial no output?
(too old to reply)
Gong Darcy
2012-09-16 10:03:10 UTC
Permalink
hi Greg,
The compiler fire-stm32v2/nsh and shenzhou/nsh.Serial port does not output
any information to show.
However, I have used the configuration of hymini-stm32v/nsh, serial output
is normal.
I am using the board, fire-stm32v3 (now v2 has been discontinued. The
increased peripheral functions compatible and v2)

I found nsh/defconfig some serial configuration.Trying to shield these
parameters, but it has no effect.I was very surprised, commissioning
enc28j60 drive, no serial output?Direct look GDB information?
(I GDB debug know nothing about)

I just resolved my JLink problems.Before I test OpenOCD.I did not pay
attention to the the OpenOCD replace with Libusb-win32 Jlink drive Segger
drivers.I did not see this change.
Then the whole week has been trying to repair JLink firmware. Until today
to remove Libusb-win32. My world is finally normal ....
~ ~ ~> _ <~ ~ ~

Darcy
Gregory Nutt
2012-09-16 12:58:45 UTC
Permalink
Hi, Darcy,
The compiler fire-stm32v2/nsh and shenzhou/nsh.Serial port does not output any information to show. However, I have used the configuration of hymini-stm32v/nsh, serial output is normal. I am using the board, fire-stm32v3 (now v2 has been discontinued. The increased peripheral functions compatible and v2)
I do get serial output with no problem from the fire-stm32v2.  But there is a problem that if you have no SD card in the slot or if you have no network connected:  Then it will wait for a very long time before it runs (about 1 minute).  If you have no SD card in the slot, then you might want to disable SDIO for now.  Here are the modifications to the fire-stm32v2/nsh configuration that I am running with.

-CONFIG_STM32_SDIO=y
+CONFIG_STM32_SDIO=n

-CONFIG_MMCSD=y
+CONFIG_MMCSD=n


(Plus some larger stack sizes and additional debug settings that I am using for debug).

I have not yet tried the Shenzhou board yet because I am waiting to receive a new ST-Link to debug with.  However, it also has SDIO and Network Enabled.  So it will probably also take a long time to come up.  Try putting in an SD card or just waiting for a long time.

The long delay with no network connected is because of the time for the the PHY to negotiate the network.  That delay could probably be reduced.

The long with no SD card is because the board does not support the card detect discrete.  So the driver believes that the card is present and tries many times with delays to access the card before it gives up.  That delay could be improved.  But it is always best to have the card detect discrete from the SD connector so that the software can know when a card is present and can get an interrupt when a card is inserted or removed.
I found nsh/defconfig some serial configuration.Trying to shield these parameters, but it has no effect.I was very surprised, commissioning enc28j60 drive, no serial output?Direct look GDB information? (I GDB debug know nothing about)
The ENC28J60 network is almost working; data is exchanged on the network, but there is some corruption of packets.  There is more work to do for the ENC28J60 (I did lift the W25x16 chip select so I cannot test that).

I don't use GDB for debugging so I cannot help with that.
I just resolved my JLink problems.Before I test OpenOCD.I did not pay attention to the the OpenOCD replace with Libusb-win32 Jlink drive Segger drivers.I did not see this change. Then the whole week has been trying to repair JLink firmware. Until today to remove Libusb-win32. My world is finally normal ....
It is good that you make it past those problems!

Greg
Gong Darcy
2012-09-16 15:17:44 UTC
Permalink
Hi Greg,

Fortunately, a hard time! Enc28j60 whether still does not work?
I see the following information:

darcy

nsh> ifconfig
eth0 HWaddr 00:e0:de:ad:be:ef
IPaddr:192.168.0.50 DRaddr:192.168.0.1 Mask:255.255.255.0

uIP IP TCP UDP ICMP
Received 0000 0000 0000 0000
Dropped 0000 0000 0000 0000
IP VHL: 0000 HBL: 0000
LBL: 0000 Frg: 0000
Checksum 0000 0000 0000 ----
TCP ACK: 0000 SYN: 0000
RST: 0000 0000
Type 0000 ---- ---- 0000
Sent ---- 0000 0000 0000
Rexmit ---- 0000 ---- ----

nsh>
NuttShell (NSH)
nsh>
NuttShell (NSH)
nsh> ping 192.168.0.1
PING 192.168.0.1 56 bytes of data
10 packets transmitted, 0 received, 100% packet loss, time 10900 ms
Post by Gregory Nutt
**
Hi, Darcy,
Post by Gong Darcy
The compiler fire-stm32v2/nsh and shenzhou/nsh.Serial port does not
output any information to show. However, I have used the configuration of
hymini-stm32v/nsh, serial output is normal. I am using the board,
fire-stm32v3 (now v2 has been discontinued. The increased peripheral
functions compatible and v2)
I do get serial output with no problem from the fire-stm32v2. But there
is a problem that if you have no SD card in the slot or if you have no
network connected: Then it will wait for a very long time before it runs
(about 1 minute). If you have no SD card in the slot, then you might want
to disable SDIO for now. Here are the modifications to the
fire-stm32v2/nsh configuration that I am running with.
-CONFIG_STM32_SDIO=y
+CONFIG_STM32_SDIO=n
-CONFIG_MMCSD=y
+CONFIG_MMCSD=n
(Plus some larger stack sizes and additional debug settings that I am using for debug).
I have not yet tried the Shenzhou board yet because I am waiting to
receive a new ST-Link to debug with. However, it also has SDIO and Network
Enabled. So it will probably also take a long time to come up. Try
putting in an SD card or just waiting for a long time.
The long delay with no network connected is because of the time for the
the PHY to negotiate the network. That delay could probably be reduced.
The long with no SD card is because the board does not support the card
detect discrete. So the driver believes that the card is present and tries
many times with delays to access the card before it gives up. That delay
could be improved. But it is always best to have the card detect discrete
from the SD connector so that the software can know when a card is present
and can get an interrupt when a card is inserted or removed.
Post by Gong Darcy
I found nsh/defconfig some serial configuration.Trying to shield these
parameters, but it has no effect.I was very surprised, commissioning
enc28j60 drive, no serial output?Direct look GDB information? (I GDB debug
know nothing about)
The ENC28J60 network is almost working; data is exchanged on the network,
but there is some corruption of packets. There is more work to do for the
ENC28J60 (I did lift the W25x16 chip select so I cannot test that).
I don't use GDB for debugging so I cannot help with that.
Post by Gong Darcy
I just resolved my JLink problems.Before I test OpenOCD.I did not pay
attention to the the OpenOCD replace with Libusb-win32 Jlink drive Segger
drivers.I did not see this change. Then the whole week has been trying to
repair JLink firmware. Until today to remove Libusb-win32. My world is
finally normal ....
It is good that you make it past those problems!
Greg
Gregory Nutt
2012-09-16 15:53:34 UTC
Permalink
Hi, Darcy,
Post by Gong Darcy
Fortunately, a hard time! Enc28j60 whether still does not work?
...
You see the same that I do.  I am debugging that now and expect to have it working in a few days.

If you look with WireShark, you will see that the card sends 6 "Who has xx.xx.xx.xx?  Please tell xx.xx.xx.xx" with six good  "xx.xx.xx.xx is at xx.xx.xx.xx.xx.xx" Followed by four ICMP packets that have corrupted data:  The data is positioned wrong 2 bytes.  Those should be easy to fix when I get the time.

Greg
Gregory N
2012-09-16 15:57:36 UTC
Permalink
Hi, again, Darcy,

Sorry about responding twice.
Post by Gregory Nutt
Hi, Darcy,
Post by Gong Darcy
Fortunately, a hard time! Enc28j60 whether still does not work?
...
You see the same that I do.  I am debugging that now and expect to have it working in a few days.
If you look with WireShark, you will see that the card sends 6 "Who has xx.xx.xx.xx?  Please tell xx.xx.xx.xx" with six good  "xx.xx.xx.xx is at xx.xx.xx.xx.xx.xx" Followed by four ICMP packets that have corrupted data:  The data is positioned wrong 2 bytes.  Those should be easy to fix when I get the time.
You are aware that the ENC28J60 has never been tested? It is listed as a problem in the TODO list:

Title: UNFINISHED ENC28J60 DRIVER
Description: So far, I have not come up with a usable hardware platform to
verify the ENC28J60 Ethernet driver (drivers/net/enc28j60.c).
So it is untested.
Status: Open
Priority: Low unless you need it.

That is why I am happy to have the fire-stm32v2. It is the first platform with properly integrated ENC28J60. So it will take some time to get it working for the first time!

Also, I just checked in a W25 driver that should work on the board. Also UNTESTED.

Greg
Gong Darcy
2012-09-16 16:18:33 UTC
Permalink
Hi Greg,

Very grateful for the work you do.The Wildfire stm32v2 enc28j60 work.I ran
on it before rt-thread 1.1.x.If you need a normal work of the program as a
reference.I can upload the project file (
https://shenzhou-iv-stm32f107-rt-thread.googlecode.com/svn/trunk/rtt-1.1.0b/
).
Unfortunately, I can not expand too much in depth field of hardware
drivers. I focus on the first scons on, do a directory scanner, according
SConscriptd amount makefile and make.defs generation script. We look
forward to your work!
The Shenzhou Board is completely unable to RUN. No matter how long, etc.,
serial output, the shield about CONFIG_MMCSD useless (I looked at the
configuration file, did not open CONFIG_STM32_SDIO).
But before I transplant from Olimex-stm32-p107 project file. Serial output
no problem.

Darcy
Post by Gregory N
**
Hi, again, Darcy,
Sorry about responding twice.
Post by Gregory Nutt
Hi, Darcy,
Post by Gong Darcy
Fortunately, a hard time! Enc28j60 whether still does not work?
...
You see the same that I do. I am debugging that now and expect to have
it working in a few days.
Post by Gregory Nutt
If you look with WireShark, you will see that the card sends 6 "Who has
xx.xx.xx.xx? Please tell xx.xx.xx.xx" with six good "xx.xx.xx.xx is at
The data is positioned wrong 2 bytes. Those should be easy to fix when I
get the time.
You are aware that the ENC28J60 has never been tested? It is listed as a
Title: UNFINISHED ENC28J60 DRIVER
Description: So far, I have not come up with a usable hardware platform to
verify the ENC28J60 Ethernet driver (drivers/net/enc28j60.c).
So it is untested.
Status: Open
Priority: Low unless you need it.
That is why I am happy to have the fire-stm32v2. It is the first platform
with properly integrated ENC28J60. So it will take some time to get it
working for the first time!
Also, I just checked in a W25 driver that should work on the board. Also
UNTESTED.
Greg
Gregory Nutt
2012-09-16 16:40:16 UTC
Permalink
Hi, Darcy,
Very grateful for the work you do.The Wildfire stm32v2 enc28j60 work.I ran on it before rt-thread 1.1.x.If you need a normal work of the program as a reference.I can upload the project file ( https://shenzhou-iv-stm32f107-rt-thread.googlecode.com/svn/trunk/rtt-1.1.0b/).
Unfortunately, I can not expand too much in depth field of hardware drivers. I focus on the first scons on, do a directory scanner, according SConscriptd amount makefile and make.defs generation script. We look forward to your work!
The Shenzhou Board is completely unable to RUN. No matter how long, etc., serial output, the shield about CONFIG_MMCSD useless (I looked at the configuration file, did not open CONFIG_STM32_SDIO). But before I transplant from Olimex-stm32-p107 project file. Serial output no problem.
That does not surprise me.  It normally does take some testing and debugging on any new port.  They don't usually come up correctly with no work.

If you want to try to bring-up the Shenzhou configuration, I would first disable everything that you do not need.  Like:

CONFIG_STM32_BKP=n
CONFIG_STM32_ETHMAC=n
CONFIG_STM32_PWR=n
CONFIG_STM32_SPI1=n
CONFIG_STM32_SPI=n

CONFIG_SPI=n
CONFIG_RTC=n
CONFIG_MMCSD=n
CONFIG_NET=n
CONFIG_FS_FAT=n
CONFIG_NSH_TELNET=n

CONFIG_SCHED_WORKQUEUE=n

Keep it simple for the first time.  Maybe one of these devices is preventing NSH from coming up.

Greg
Gregory N
2012-09-19 14:40:21 UTC
Permalink
Hi, Darcy,
Post by Gong Darcy
Fortunately, a hard time! Enc28j60 whether still does not work?
...
You are aware that the ENC28J60 has never been tested? ...
The ENC28J60 has now been tested and works with the fire-stm32v2 board. That version is checked into the new SVN.

I use the configuration at configs/fire-stm32v2/defconfig with the following changes to make testing simpler:

CONFIG_STM32_SDIO=n
CONFIG_STM32_USB=n
CONFIG_MMCSD=n
CONFIG_USBDEV=n

Greg
Gong Darcy
2012-09-20 15:17:51 UTC
Permalink
hi Greg,

Ask now enc28j60 chips can already work properly?
Whether it was possible to give me your the nsh shell of the ifconfig
information posts. I run the show are 0.

darcy
Post by Gregory Nutt
**
Hi, Darcy,
Post by Gong Darcy
Fortunately, a hard time! Enc28j60 whether still does not work?
...
You are aware that the ENC28J60 has never been tested? ...
The ENC28J60 has now been tested and works with the fire-stm32v2 board.
That version is checked into the new SVN.
I use the configuration at configs/fire-stm32v2/defconfig with the
CONFIG_STM32_SDIO=n
CONFIG_STM32_USB=n
CONFIG_MMCSD=n
CONFIG_USBDEV=n
Greg
Gregory Nutt
2012-09-20 15:53:45 UTC
Permalink
Hi, Darcy,
Post by Gong Darcy
Post by Gong Darcy
Fortunately, a hard time! Enc28j60 whether still does not work?
...
You are aware that the ENC28J60 has never been tested?  ...
The ENC28J60 has now been tested and works with the fire-stm32v2 board.  That version is checked into the new SVN.
CONFIG_STM32_SDIO=n
CONFIG_STM32_USB=n
CONFIG_MMCSD=n
CONFIG_USBDEV=n
Ask now enc28j60 chips can already work properly?
Whether it was possible to give me your the nsh shell of the ifconfig information posts. I run the show are 0.
The ENC28J60 networking is working well for me. I have the following configuration:

1. Fire-STM32v2 board (not v3),
2. I have lifted the chip select pin on the W25x16 FLASH because it conflicts with the chip select for the ENC28J60,
3. I used the configs/fire-stm32v2/defconfig with the above changes plus:

CONFIG_DEBUG=y

And the network works pretty well:

| NuttShell (NSH)
| nsh> ping 10.0.0.1
| PING 10.0.0.1 56 bytes of data
| 56 bytes from 10.0.0.1: icmp_seq=3 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=4 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=5 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=6 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=7 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=8 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=9 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=10 time=0 ms
| 10 packets transmitted, 8 received, 20% packet loss, time 11090 ms
| nsh> ping 10.0.0.1
| PING 10.0.0.1 56 bytes of data
| 56 bytes from 10.0.0.1: icmp_seq=1 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=2 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=3 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=4 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=5 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=6 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=7 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=8 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=9 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=10 time=0 ms
| 10 packets transmitted, 10 received, 0% packet loss, time 10100 ms
| nsh> ifconfig
| eth0    HWaddr 00:e0:de:ad:be:ef
|         IPaddr:10.0.0.2 DRaddr:10.0.0.1 Mask:255.255.255.0
|
| uIP         IP   TCP  UDP  ICMP
| Received    0052 0000 0000 0012
| Dropped     0040 0000 0000 0000
|   IP        VHL: 0000 HBL: 0000
|             LBL: 0000 Frg: 0000
|   Checksum  0000 0000 0000 ----
|   TCP       ACK: 0000 SYN: 0000
|             RST: 0000 0000
|   Type      0000 ---- ---- 0000
| Sent        ---- 0000 0000 0014
|   Rexmit    ---- 0000 ---- ----
|
| nsh>


There is sometimes problems when initializing the ENC28J50 ERXWPT pointer.  That pointer is read-only and set by the hardware to the beginning of the RX buffer when the RX buffer addresses are initialized.  Sometimes that iniital pointer is bad.  In that case the ENC28J60 does not work and the board has to be reset.  But the ERXWPT is initialized correctly most of the time (9 times of out ten) and the above output shows the proper behavior of the interface.

Notice that two packets are missing in the first ping sequence.  That is common with the ENC29J60.  One should be lost because the ICMP ECHO request is replaced with an ARP request.  But I have not studied why sometimes 2 or 3 are lost on the first ping.  I have not seen packet losses with the ENC28J60 after that.

In the statistic above, you can see that 20 ICMP packets were sent (00014) and 18 ICMP packets were received (0012).  82 total packets were received (0052) but 64 were dropped (0040) because of unsupported protocols.

If you see something different than it is because:

1. There is some difference in your RTOS configuration?  You know that the NuttX repository has changed, right?  See http://sourceforge.net/p/nuttx/code/ .  Check the above configuration changes.

2. Your hardware is different?  Are you using v3 or v2?  Does v3 have the same problem with the same chip select for both the W25x16 FLASH and the ENC28J60.  If so, have you lifted the chip select pin on the W25x16?  You cannot communicate with the ENC28J60 if the W25x16 is enabled with the same chip select.

3. Or your network is configured differently?  I have an internal 10.0.0.xx network that I use for testing since I don't allow devices under test on the open network.

Greg
Gong Darcy
2012-09-21 08:28:26 UTC
Permalink
Hi Greg,
The my wildfire-v3 still can not use network functions.
I looked for, v3-enc28j60 INTR IO port PE4. v2 is used in PE5
The other aspects are the same. I adjust GPIO_ENC28J60_INTR defined, and
still can not use.
fup / ifdown instruction?


Darcy


open CONFIG_DEBUG=y
I
NuttShell (NSH)
nsh> ifconfig
eth0 HWaddr 00:e0:de:ad:be:ef
IPaddr:192.168.150.50 DRaddr:192.168.150.1 Mask:255.255.255.0

uIP IP TCP UDP ICMP
Received 0000 0000 0000 0000
Dropped 0000 0000 0000 0000
IP VHL: 0000 HBL: 0000
LBL: 0000 Frg: 0000
Checksum 0000 0000 0000 ----
TCP ACK: 0000 SYN: 0000
RST: 0000 0000
Type 0000 ---- ---- 0000
Sent ---- 0000 0000 0000
Rexmit ---- 0000 ---- ----

nsh> ping 192.168.150.1
PING 192.168.150.1 56 bytes of data
10 packets transmitted, 0 received, 100% packet loss, time 10310 ms
nsh>
nsh> ping 192.168.150.1
PING 192.168.150.1 56 bytes of data
10 packets transmitted, 0 received, 100% packet loss, time 10890 ms
nsh>
Post by Gregory Nutt
**
Hi, Darcy,
Post by Gong Darcy
Post by Gong Darcy
Fortunately, a hard time! Enc28j60 whether still does not work?
...
You are aware that the ENC28J60 has never been tested? ...
The ENC28J60 has now been tested and works with the fire-stm32v2
board. That version is checked into the new SVN.
Post by Gong Darcy
I use the configuration at configs/fire-stm32v2/defconfig with the
CONFIG_STM32_SDIO=n
CONFIG_STM32_USB=n
CONFIG_MMCSD=n
CONFIG_USBDEV=n
Ask now enc28j60 chips can already work properly?
Whether it was possible to give me your the nsh shell of the ifconfig
information posts. I run the show are 0.
1. Fire-STM32v2 board (not v3),
2. I have lifted the chip select pin on the W25x16 FLASH because it
conflicts with the chip select for the ENC28J60,
CONFIG_DEBUG=y
| NuttShell (NSH)
| nsh> ping 10.0.0.1
| PING 10.0.0.1 56 bytes of data
| 56 bytes from 10.0.0.1: icmp_seq=3 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=4 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=5 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=6 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=7 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=8 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=9 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=10 time=0 ms
| 10 packets transmitted, 8 received, 20% packet loss, time 11090 ms
| nsh> ping 10.0.0.1
| PING 10.0.0.1 56 bytes of data
| 56 bytes from 10.0.0.1: icmp_seq=1 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=2 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=3 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=4 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=5 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=6 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=7 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=8 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=9 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=10 time=0 ms
| 10 packets transmitted, 10 received, 0% packet loss, time 10100 ms
| nsh> ifconfig
| eth0 HWaddr 00:e0:de:ad:be:ef
| IPaddr:10.0.0.2 DRaddr:10.0.0.1 Mask:255.255.255.0
|
| uIP IP TCP UDP ICMP
| Received 0052 0000 0000 0012
| Dropped 0040 0000 0000 0000
| IP VHL: 0000 HBL: 0000
| LBL: 0000 Frg: 0000
| Checksum 0000 0000 0000 ----
| TCP ACK: 0000 SYN: 0000
| RST: 0000 0000
| Type 0000 ---- ---- 0000
| Sent ---- 0000 0000 0014
| Rexmit ---- 0000 ---- ----
|
| nsh>
There is sometimes problems when initializing the ENC28J50 ERXWPT
pointer. That pointer is read-only and set by the hardware to the
beginning of the RX buffer when the RX buffer addresses are initialized.
Sometimes that iniital pointer is bad. In that case the ENC28J60 does not
work and the board has to be reset. But the ERXWPT is initialized
correctly most of the time (9 times of out ten) and the above output shows
the proper behavior of the interface.
Notice that two packets are missing in the first ping sequence. That is
common with the ENC29J60. One should be lost because the ICMP ECHO request
is replaced with an ARP request. But I have not studied why sometimes 2 or
3 are lost on the first ping. I have not seen packet losses with the
ENC28J60 after that.
In the statistic above, you can see that 20 ICMP packets were sent (00014)
and 18 ICMP packets were received (0012). 82 total packets were received
(0052) but 64 were dropped (0040) because of unsupported protocols.
1. There is some difference in your RTOS configuration? You know that the
NuttX repository has changed, right? See
http://sourceforge.net/p/nuttx/code/ . Check the above configuration
changes.
2. Your hardware is different? Are you using v3 or v2? Does v3 have the
same problem with the same chip select for both the W25x16 FLASH and the
ENC28J60. If so, have you lifted the chip select pin on the W25x16? You
cannot communicate with the ENC28J60 if the W25x16 is enabled with the same
chip select.
3. Or your network is configured differently? I have an internal
10.0.0.xx network that I use for testing since I don't allow devices under
test on the open network.
Greg
Gong Darcy
2012-09-21 08:41:13 UTC
Permalink
Hi Greg
The attachment is a schematic files

darcy
Post by Gong Darcy
Hi Greg,
The my wildfire-v3 still can not use network functions.
I looked for, v3-enc28j60 INTR IO port PE4. v2 is used in PE5
The other aspects are the same. I adjust GPIO_ENC28J60_INTR defined, and
still can not use.
fup / ifdown instruction?
Darcy
open CONFIG_DEBUG=y
I
NuttShell (NSH)
nsh> ifconfig
eth0 HWaddr 00:e0:de:ad:be:ef
IPaddr:192.168.150.50 DRaddr:192.168.150.1 Mask:255.255.255.0
uIP IP TCP UDP ICMP
Received 0000 0000 0000 0000
Dropped 0000 0000 0000 0000
IP VHL: 0000 HBL: 0000
LBL: 0000 Frg: 0000
Checksum 0000 0000 0000 ----
TCP ACK: 0000 SYN: 0000
RST: 0000 0000
Type 0000 ---- ---- 0000
Sent ---- 0000 0000 0000
Rexmit ---- 0000 ---- ----
nsh> ping 192.168.150.1
PING 192.168.150.1 56 bytes of data
10 packets transmitted, 0 received, 100% packet loss, time 10310 ms
nsh>
nsh> ping 192.168.150.1
PING 192.168.150.1 56 bytes of data
10 packets transmitted, 0 received, 100% packet loss, time 10890 ms
nsh>
Post by Gregory Nutt
**
Hi, Darcy,
Post by Gong Darcy
Post by Gong Darcy
Fortunately, a hard time! Enc28j60 whether still does not work?
...
You are aware that the ENC28J60 has never been tested? ...
The ENC28J60 has now been tested and works with the fire-stm32v2
board. That version is checked into the new SVN.
Post by Gong Darcy
I use the configuration at configs/fire-stm32v2/defconfig with the
CONFIG_STM32_SDIO=n
CONFIG_STM32_USB=n
CONFIG_MMCSD=n
CONFIG_USBDEV=n
Ask now enc28j60 chips can already work properly?
Whether it was possible to give me your the nsh shell of the ifconfig
information posts. I run the show are 0.
1. Fire-STM32v2 board (not v3),
2. I have lifted the chip select pin on the W25x16 FLASH because it
conflicts with the chip select for the ENC28J60,
CONFIG_DEBUG=y
| NuttShell (NSH)
| nsh> ping 10.0.0.1
| PING 10.0.0.1 56 bytes of data
| 56 bytes from 10.0.0.1: icmp_seq=3 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=4 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=5 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=6 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=7 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=8 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=9 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=10 time=0 ms
| 10 packets transmitted, 8 received, 20% packet loss, time 11090 ms
| nsh> ping 10.0.0.1
| PING 10.0.0.1 56 bytes of data
| 56 bytes from 10.0.0.1: icmp_seq=1 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=2 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=3 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=4 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=5 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=6 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=7 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=8 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=9 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=10 time=0 ms
| 10 packets transmitted, 10 received, 0% packet loss, time 10100 ms
| nsh> ifconfig
| eth0 HWaddr 00:e0:de:ad:be:ef
| IPaddr:10.0.0.2 DRaddr:10.0.0.1 Mask:255.255.255.0
|
| uIP IP TCP UDP ICMP
| Received 0052 0000 0000 0012
| Dropped 0040 0000 0000 0000
| IP VHL: 0000 HBL: 0000
| LBL: 0000 Frg: 0000
| Checksum 0000 0000 0000 ----
| TCP ACK: 0000 SYN: 0000
| RST: 0000 0000
| Type 0000 ---- ---- 0000
| Sent ---- 0000 0000 0014
| Rexmit ---- 0000 ---- ----
|
| nsh>
There is sometimes problems when initializing the ENC28J50 ERXWPT
pointer. That pointer is read-only and set by the hardware to the
beginning of the RX buffer when the RX buffer addresses are initialized.
Sometimes that iniital pointer is bad. In that case the ENC28J60 does not
work and the board has to be reset. But the ERXWPT is initialized
correctly most of the time (9 times of out ten) and the above output shows
the proper behavior of the interface.
Notice that two packets are missing in the first ping sequence. That is
common with the ENC29J60. One should be lost because the ICMP ECHO request
is replaced with an ARP request. But I have not studied why sometimes 2 or
3 are lost on the first ping. I have not seen packet losses with the
ENC28J60 after that.
In the statistic above, you can see that 20 ICMP packets were sent
(00014) and 18 ICMP packets were received (0012). 82 total packets were
received (0052) but 64 were dropped (0040) because of unsupported protocols.
1. There is some difference in your RTOS configuration? You know that
the NuttX repository has changed, right? See
http://sourceforge.net/p/nuttx/code/ . Check the above configuration
changes.
2. Your hardware is different? Are you using v3 or v2? Does v3 have the
same problem with the same chip select for both the W25x16 FLASH and the
ENC28J60. If so, have you lifted the chip select pin on the W25x16? You
cannot communicate with the ENC28J60 if the W25x16 is enabled with the same
chip select.
3. Or your network is configured differently? I have an internal
10.0.0.xx network that I use for testing since I don't allow devices under
test on the open network.
Greg
Gong Darcy
2012-09-21 09:35:30 UTC
Permalink
Hi Greg,

Updated new SVN repository file.
Error open CONFIG_DEBUG.

darcy

NuttShell (NSH)
nsh> Assertion failed at file:net/enc28j60.c line: 1433
sp: 20004624
stack base: 20004698
stack size: 000003fc
20004620: 00000001 00000599 0801f134 2000227c 00001fff 080011a1 40010800
20002220
20004640: 00000040 0801b171 0008cd24 00000000 02faf080 20002230 00000005
200025bc
20004660: 00000000 200025b0 00000000 08003d67 08003cf1 00000000 00000000
00000000
20004680: 00000000 00000000 00000000 08003a15 00000000 00000000 00000000
00000000
AþCDE

N
NuttShell (NSH)
nsh> ifconfig
eth0 HWaddr 00:e0:de:ad:be:ef
IPaddr:192.168.150.50 DRaddr:192.168.150.1 Mask:255.255.255.0

uIP IP TCP UDP ICMP
Received 000b 0000 0001 0000
Dropped 000a 0000 0000 0000
IP VHL: 0000 HBL: 0000
LBL: 0000 Frg: 0000
Checksum 0000 0000 0000 ----
TCP ACK: 0000 SYN: 0000
RST: 0000 0000
Type 0000 ---- ---- 0000
Sent ---- 0000 0000 0000
Rexmit ---- 0000 ---- ----

nsh> ping 192.168.150.1
PING 192.168.150.1 56 bytes of data
10 packets transmitted, 0 received, 100% packet loss, time 10150 ms
nsh> ping 192.168.150.1
PING 192.168.150.1 56 bytes of data
10 packets transmitted, 0 received, 100% packet loss, time 10880 ms
Post by Gong Darcy
Hi Greg
The attachment is a schematic files
darcy
Post by Gong Darcy
Hi Greg,
The my wildfire-v3 still can not use network functions.
I looked for, v3-enc28j60 INTR IO port PE4. v2 is used in PE5
The other aspects are the same. I adjust GPIO_ENC28J60_INTR defined, and
still can not use.
fup / ifdown instruction?
Darcy
open CONFIG_DEBUG=y
I
NuttShell (NSH)
nsh> ifconfig
eth0 HWaddr 00:e0:de:ad:be:ef
IPaddr:192.168.150.50 DRaddr:192.168.150.1 Mask:255.255.255.0
uIP IP TCP UDP ICMP
Received 0000 0000 0000 0000
Dropped 0000 0000 0000 0000
IP VHL: 0000 HBL: 0000
LBL: 0000 Frg: 0000
Checksum 0000 0000 0000 ----
TCP ACK: 0000 SYN: 0000
RST: 0000 0000
Type 0000 ---- ---- 0000
Sent ---- 0000 0000 0000
Rexmit ---- 0000 ---- ----
nsh> ping 192.168.150.1
PING 192.168.150.1 56 bytes of data
10 packets transmitted, 0 received, 100% packet loss, time 10310 ms
nsh>
nsh> ping 192.168.150.1
PING 192.168.150.1 56 bytes of data
10 packets transmitted, 0 received, 100% packet loss, time 10890 ms
nsh>
Post by Gregory Nutt
**
Hi, Darcy,
Post by Gong Darcy
Post by Gong Darcy
Fortunately, a hard time! Enc28j60 whether still does not work?
...
You are aware that the ENC28J60 has never been tested? ...
The ENC28J60 has now been tested and works with the fire-stm32v2
board. That version is checked into the new SVN.
Post by Gong Darcy
I use the configuration at configs/fire-stm32v2/defconfig with the
CONFIG_STM32_SDIO=n
CONFIG_STM32_USB=n
CONFIG_MMCSD=n
CONFIG_USBDEV=n
Ask now enc28j60 chips can already work properly?
Whether it was possible to give me your the nsh shell of the ifconfig
information posts. I run the show are 0.
1. Fire-STM32v2 board (not v3),
2. I have lifted the chip select pin on the W25x16 FLASH because it
conflicts with the chip select for the ENC28J60,
CONFIG_DEBUG=y
| NuttShell (NSH)
| nsh> ping 10.0.0.1
| PING 10.0.0.1 56 bytes of data
| 56 bytes from 10.0.0.1: icmp_seq=3 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=4 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=5 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=6 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=7 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=8 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=9 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=10 time=0 ms
| 10 packets transmitted, 8 received, 20% packet loss, time 11090 ms
| nsh> ping 10.0.0.1
| PING 10.0.0.1 56 bytes of data
| 56 bytes from 10.0.0.1: icmp_seq=1 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=2 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=3 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=4 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=5 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=6 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=7 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=8 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=9 time=0 ms
| 56 bytes from 10.0.0.1: icmp_seq=10 time=0 ms
| 10 packets transmitted, 10 received, 0% packet loss, time 10100 ms
| nsh> ifconfig
| eth0 HWaddr 00:e0:de:ad:be:ef
| IPaddr:10.0.0.2 DRaddr:10.0.0.1 Mask:255.255.255.0
|
| uIP IP TCP UDP ICMP
| Received 0052 0000 0000 0012
| Dropped 0040 0000 0000 0000
| IP VHL: 0000 HBL: 0000
| LBL: 0000 Frg: 0000
| Checksum 0000 0000 0000 ----
| TCP ACK: 0000 SYN: 0000
| RST: 0000 0000
| Type 0000 ---- ---- 0000
| Sent ---- 0000 0000 0014
| Rexmit ---- 0000 ---- ----
|
| nsh>
There is sometimes problems when initializing the ENC28J50 ERXWPT
pointer. That pointer is read-only and set by the hardware to the
beginning of the RX buffer when the RX buffer addresses are initialized.
Sometimes that iniital pointer is bad. In that case the ENC28J60 does not
work and the board has to be reset. But the ERXWPT is initialized
correctly most of the time (9 times of out ten) and the above output shows
the proper behavior of the interface.
Notice that two packets are missing in the first ping sequence. That is
common with the ENC29J60. One should be lost because the ICMP ECHO request
is replaced with an ARP request. But I have not studied why sometimes 2 or
3 are lost on the first ping. I have not seen packet losses with the
ENC28J60 after that.
In the statistic above, you can see that 20 ICMP packets were sent
(00014) and 18 ICMP packets were received (0012). 82 total packets were
received (0052) but 64 were dropped (0040) because of unsupported protocols.
1. There is some difference in your RTOS configuration? You know that
the NuttX repository has changed, right? See
http://sourceforge.net/p/nuttx/code/ . Check the above configuration
changes.
2. Your hardware is different? Are you using v3 or v2? Does v3 have
the same problem with the same chip select for both the W25x16 FLASH and
the ENC28J60. If so, have you lifted the chip select pin on the W25x16?
You cannot communicate with the ENC28J60 if the W25x16 is enabled with the
same chip select.
3. Or your network is configured differently? I have an internal
10.0.0.xx network that I use for testing since I don't allow devices under
test on the open network.
Greg
Gregory Nutt
2012-09-21 13:36:44 UTC
Permalink
Hi, Darcy.
Post by Gong Darcy
NuttShell (NSH)
nsh> Assertion failed at file:net/enc28j60.c line: 1433
sp:         20004624
stack base: 20004698
stack size: 000003fc
20004620: 00000001 00000599 0801f134 2000227c 00001fff 080011a1 40010800 20002220
20004640: 00000040 0801b171 0008cd24 00000000 02faf080 20002230 00000005 200025bc
20004660: 00000000 200025b0 00000000 08003d67 08003cf1 00000000 00000000 00000000
20004680: 00000000 00000000 00000000 08003a15 00000000 00000000 00000000 00000000
Post by Gregory Nutt
There is sometimes
problems when initializing the ENC28J50 ERXWPT pointer.  That pointer is read-only and set by the hardware to the beginning of the RX buffer
when the RX buffer addresses are initialized.  Sometimes that iniital
pointer is bad.  In that case the ENC28J60 does not work and the board
has to be reset.  But the ERXWPT is initialized correctly most of the
time (9 times of out ten) and the above output shows the proper behavior of the interface.

In that case, the first packet is written to wrong location.  When the logic gets the next next packet pointer it reads bad memory and the nextpkt pointer gets corrupted.  That corrupted pointer leads to the assertion.  I am not sure what to do about this yet.  There must be some strong initailization of the pointers.
Post by Gong Darcy
nsh> ifconfig
eth0    HWaddr 00:e0:de:ad:be:ef
        IPaddr:192.168.150.50 DRaddr:192.168.150.1 Mask:255.255.255.0
uIP         IP   TCP  UDP  ICMP
Received    000b 0000 0001 0000
Dropped     000a 0000 0000 0000
  IP        VHL: 0000 HBL: 0000
            LBL: 0000 Frg: 0000
  Checksum  0000 0000 0000 ----
  TCP       ACK: 0000 SYN: 0000
            RST: 0000 0000
  Type      0000 ---- ---- 0000
Sent        ---- 0000 0000 0000
  Rexmit    ---- 0000 ---- ----
Notice that it is receiving packets fine.  I received  11, dropped 10 and found 1 UDP packet.
Post by Gong Darcy
nsh> ping 192.168.150.1
PING 192.168.150.1 56 bytes of data
10 packets transmitted, 0 received, 100% packet loss, time 10150 ms
nsh> ping 192.168.150.1
PING 192.168.150.1 56 bytes of data
10 packets transmitted, 0 received, 100% packet loss, time 10880 ms
Then what does ifconfig show?  Probably 10 ICMP packets sent and nothing received.  We know that the ENC28J60 can received packets.  We see that in the above ifconfig output.  So either it is sending the packets or perhaps you have some issue with you network or with the host that that you are ping-ing (Perhaps it is blocking ECHO requests).


To debug this, you will probably need to do two things:

1)  Enable DEBUG output so that you can see what happened?

CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=y
CONFIG_DEBUG_NET=y

CONFIG_ENC28J60_DUMPPACKET=y

2) Use Wireshark to see what is really happening on the network: http://www.wireshark.org/download.html

Greg
Gregory Nutt
2012-09-21 13:46:03 UTC
Permalink
Hi, Darcy,
Post by Gregory Nutt
2) Use Wireshark to see what is really happening on the network: http://www.wireshark.org/download.html
Wireshark is very helpful.

Here is what the ping command looks like from NSH:

nsh> ping 10.0.0.1
PING 10.0.0.1 56 bytes of data
56 bytes from 10.0.0.1: icmp_seq=2 time=0 ms
56 bytes from 10.0.0.1: icmp_seq=3 time=0 ms
56 bytes from 10.0.0.1: icmp_seq=4 time=0 ms
56 bytes from 10.0.0.1: icmp_seq=5 time=0 ms
56 bytes from 10.0.0.1: icmp_seq=6 time=0 ms
56 bytes from 10.0.0.1: icmp_seq=7 time=0 ms
56 bytes from 10.0.0.1: icmp_seq=8 time=0 ms
56 bytes from 10.0.0.1: icmp_seq=9 time=0 ms
56 bytes from 10.0.0.1: icmp_seq=10 time=0 ms
10 packets transmitted, 9 received, 10% packet loss, time 10680 ms
nsh>

But attached is what you see from Wireshark.  You will see everything that appears on the network and you will then know where the problem is.

Greg
Gong Darcy
2012-09-21 18:20:22 UTC
Permalink
Hi Greg,
This is the I now output state(3 times boot).I have installed
Wireshark, is to figure out how to use.
Darcy

=======================================================================<<<First
boot<<<===
AþCDE
netdev_register: Registered MAC: 00:00:00:00:00:00 as dev: eth0
up_netinitialize: Bound SPI port 1 to ENC28J60 device 0
netdev_ifrenc_ifdown: Taking down: 0.0.0.0
enc_reset: Reset
enc_reset: Rev ID: 06
enc_pwrsave: Set PWRSV
enc_ifup: Bringing up: 192.168.150.50
enc_reset: Reset
ioctl: cmd: 1803
netdev_enc_reset: Rev ID: 06
ifenc_pwrfull: Clear PWRSV
rioctl: cmd: 1794
netdetelnetd_daemon: Accepting connections on port 23
v_ifrioctl: cmd: 1796
netdev_ifrioctl: cmd: 1800
nsh_telnetstart: Starting the Telnet daemon

NuttShell (NSH)
nsh> enc_irqworker: EIR: 10
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0346 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80064000000000000 000000000000000000000000
.........d...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 6400a8c0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 038c pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 03d2 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0418 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
=======================================================================<<<Second
boot<<<===
AþCDE
netdev_register: Registered MAC: 00:00:00:00:00:00 as dev: eth0
up_netinitialize: Bound SPI port 1 to ENC28J60 device 0
netdev_ifrenc_ifdown: Taking down: 0.0.0.0
enc_reset: Reset
enc_reset: Rev ID: 06
enc_pwrsave: Set PWRSV
enc_ifup: Bringing up: 192.168.0.50
enc_reset: Reset
ioctl: cmd: 1803
netdev_enc_reset: Rev ID: 06
ifenc_pwrfull: Clear PWRSV
rioctl: cmd: 1794
netdetelnetd_daemon: Accepting connections on port 23
v_ifrioctl: cmd: 1796
netdev_ifrioctl: cmd: 1800
nsh_telnetstart: Starting the Telnet daemon

NuttShell (NSH)
nsh> enc_irqworker: EIR: 10
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0346 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80064000000000000 000000000000000000000000
.........d...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 6400a8c0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 038c pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 03d2 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0418 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 045e pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 04a4 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 04ea pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0530 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0576 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 05bc pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0602 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0648 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0772 pktlen: 292 rxstat: 03c0
Received Packet (20002298):
0000: ffffffffffff001302b941c308004500 0112000040004011b6ecc0a8009fc0a8
..........A...E. ***@.@.........
0020: 00ff008a008a00fe82c7110a073bc0a8 009f008a00e800002045454542464745
.............;.. ........ EEEBFGE
0040: 4a45454548434e4647454a4643464546 464542454d434e414100204648455046
JEEEHCNFGEJFCFEF FEBEMCNAA. FHEPF
0060: 43454c45484643455046464641434143 414341434143414341424f00ff534d42
CELEHFCEPFFFACAC ACACACACABO..SMB
0080: 25000000000000000000000000000000 0000000000000000000000001100004e
%............... ...............N
00a0: 00000000000000000000000000000000 0000004e00560003000100010002005f
................ ...N.V........._
00c0: 005c4d41494c534c4f545c42524f5753 45000f53e09304004441564944472d56
.\MAILSLOT\BROWS E..S....DAVIDG-V
00e0: 49525455414c2d4d0409039a84000f01 55aa6461766964672d7669727475616c
IRTUAL-M........ U.davidg-virtual
0100: 2d6d616368696e652073657276657220 2853616d62612c205562756e74752900
-machine server (Samba, Ubuntu).
enc_rxdispatch: IP packet received (08)
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0886 pktlen: 269 rxstat: 03c0
Received Packet (20002298):
0000: ffffffffffff001302b941c308004500 00fb000040004011b703c0a8009fc0a8
..........A...E. ***@.@.........
0020: 00ff008a008a00e77fd4110a073cc0a8 009f008a00d100002045454542464745
.............<.. ........ EEEBFGE
0040: 4a45454548434e4647454a4643464546 464542454d434e414100204142414346
JEEEHCNFGEJFCFEF FEBEMCNAA. ABACF
0060: 504650454e4644454346434550464846 444546465046504143414200ff534d42
PFPENFDECFCEPFHF DEFFPFPACAB..SMB
0080: 25000000000000000000000000000000 00000000000000000000000011000037
%............... ...............7
00a0: 00000000000000000000000000000000 00000037005600030001000100020048
................ ...7.V.........H
00c0: 005c4d41494c534c4f545c42524f5753 45000c53e0930400574f524b47524f55
.\MAILSLOT\BROWS E..S....WORKGROU
00e0: 50000000000000000409001000800f01 55aa4441564944472d5649525455414c
P............... U.DAVIDG-VIRTUAL
0100: 2d4d414348494e4500
-MACHINE.
enc_rxdispatch: IP packet received (08)
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 08cc pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0912 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0958 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 099e pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 09e4 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0a2a pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0a70 pktlen: 64 rxstat: 03c0
Received Packet (20002298):
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
enc_transmit: Sending packet, pktlen: 42
Transmit Packet (20002298):
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
0020: f0bf97d03151c0a800a1
....1Q....
enc_irqworker: EIR: 08
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0000 pktlen: 0 rxstat: 0000
enc_pktif: ERROR: RXSTAT: 0000
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: f00e pktlen: 38847 rxstat: 31d0
enc_pktif: Bad packet size dropped (38847)
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
Assertion failed at file:net/enc28j60.c line: 1433
sp: 2000461c
stack base: 20004698
stack size: 000003fc
20004600: 00000001 00000599 080211c4 080013f1 08018e29 20004624 00000040
00000599
20004620: 080211c4 200025bc 00000000 080011a1 0000000a 20002220 00000040
0801bd81
20004640: 2000465c 08003b99 97bff00e 00000000 20002230 00000005 200025bc
00000000
20004660: 200025b0 00000000 00000000 08003d67 08003cf1 00000000 00000000
00000000
20004680: 00000000 00000000 00000000 08003a15 00000000 00000000 00000000
00000000
=======================================================================<<<Third
boot<<<===
AþCDE
netdev_register: Registered MAC: 00:00:00:00:00:00 as dev: eth0
up_netinitialize: Bound SPI port 1 to ENC28J60 device 0
netdev_ifrenc_ifdown: Taking down: 0.0.0.0
enc_reset: Reset
enc_reset: Rev ID: 06
enc_pwrsave: Set PWRSV
enc_ifup: Bringing up: 192.168.0.50
enc_reset: Reset
ioctl: cmd: 1803
netdev_enc_reset: Rev ID: 06
ifenc_pwrfull: Clear PWRSV
rioctl: cmd: 1794
netdetelnetd_daemon: Accepting connections on port 23
v_ifrioctl: cmd: 1796
netdev_ifrioctl: cmd: 1800
nsh_telnetstart: Starting the Telnet daemon

NuttShell (NSH)
nsh> enc_irqworker: EIR: 10
enc_uiptxpoll: Poll result: d_len=0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 4545 pktlen: 17731 rxstat: 4643
enc_pktif: ERROR: RXSTAT: 4643
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
Assertion failed at file:net/enc28j60.c line: 1433
sp: 2000461c
stack base: 20004698
stack size: 000003fc
20004600: 00000001 00000599 080211c4 080013f1 08018e29 20004624 00000040
00000599
20004620: 080211c4 200025bc 00000000 080011a1 0000000a 20002220 00000040
0801bd81
20004640: 2000465c 08003b99 200025bc 00000000 20002230 00000005 200025bc
00000000
20004660: 200025b0 00000000 00000000 08003d67 08003cf1 00000000 00000000
00000000
20004680: 00000000 00000000 00000000 08003a15 00000000 00000000 00000000
00000000
Post by Gregory Nutt
**
Hi, Darcy.
Post by Gong Darcy
NuttShell (NSH)
nsh> Assertion failed at file:net/enc28j60.c line: 1433
sp: 20004624
stack base: 20004698
stack size: 000003fc
20004620: 00000001 00000599 0801f134 2000227c 00001fff 080011a1 40010800
20002220
Post by Gong Darcy
20004640: 00000040 0801b171 0008cd24 00000000 02faf080 20002230 00000005
200025bc
Post by Gong Darcy
20004660: 00000000 200025b0 00000000 08003d67 08003cf1 00000000 00000000
00000000
Post by Gong Darcy
20004680: 00000000 00000000 00000000 08003a15 00000000 00000000 00000000
00000000
Post by Gong Darcy
Post by Gregory Nutt
There is sometimes
problems when initializing the ENC28J50 ERXWPT pointer. That pointer is
read-only and set by the hardware to the beginning of the RX buffer
when the RX buffer addresses are initialized. Sometimes that iniital
pointer is bad. In that case the ENC28J60 does not work and the board
has to be reset. But the ERXWPT is initialized correctly most of the
time (9 times of out ten) and the above output shows the proper behavior of the interface.
In that case, the first packet is written to wrong location. When the
logic gets the next next packet pointer it reads bad memory and the nextpkt
pointer gets corrupted. That corrupted pointer leads to the assertion. I
am not sure what to do about this yet. There must be some strong
initailization of the pointers.
Post by Gong Darcy
nsh> ifconfig
eth0 HWaddr 00:e0:de:ad:be:ef
IPaddr:192.168.150.50 DRaddr:192.168.150.1 Mask:255.255.255.0
uIP IP TCP UDP ICMP
Received 000b 0000 0001 0000
Dropped 000a 0000 0000 0000
IP VHL: 0000 HBL: 0000
LBL: 0000 Frg: 0000
Checksum 0000 0000 0000 ----
TCP ACK: 0000 SYN: 0000
RST: 0000 0000
Type 0000 ---- ---- 0000
Sent ---- 0000 0000 0000
Rexmit ---- 0000 ---- ----
Notice that it is receiving packets fine. I received 11, dropped 10 and
found 1 UDP packet.
Post by Gong Darcy
nsh> ping 192.168.150.1
PING 192.168.150.1 56 bytes of data
10 packets transmitted, 0 received, 100% packet loss, time 10150 ms
nsh> ping 192.168.150.1
PING 192.168.150.1 56 bytes of data
10 packets transmitted, 0 received, 100% packet loss, time 10880 ms
Then what does ifconfig show? Probably 10 ICMP packets sent and nothing
received. We know that the ENC28J60 can received packets. We see that in
the above ifconfig output. So either it is sending the packets or perhaps
you have some issue with you network or with the host that that you are
ping-ing (Perhaps it is blocking ECHO requests).
1) Enable DEBUG output so that you can see what happened?
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=y
CONFIG_DEBUG_NET=y
CONFIG_ENC28J60_DUMPPACKET=y
http://www.wireshark.org/download.html
Greg
Gregory Nutt
2012-09-21 19:28:33 UTC
Permalink
Hi, Darcy,
  This is the I now output state(3 times boot).I have installed Wireshark, is to figure out how to use.
It is very, very easy!  You just select the Capture menu, then the interface.  That is all.  Then it will capture network data until you do Capture->Stop.
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0346 pktlen: 64 rxstat: 03c0
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1 ..........1Q.... ..........1Q....
0020: 000000000000c0a80064000000000000 000000000000000000000000         .........d...... ............
...
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 038c pktlen: 64 rxstat: 03c0
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1 ..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000         .........2...... ............
...
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 03d2 pktlen: 64 rxstat: 03c0
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1 ..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000         .........2...... ............
etc.

This is one of the reasons that I don't like to use the open network for testing.  You are receiving many, many broadcast messages that will probably all be dropped.  That is normal behavior when you run in an open network.

I recommend that you catch all of the console output in a log file.  There will be a lot of it!
...
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 6400a8c0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 038c pktlen: 64 rxstat: 03c0
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1 ..........1Q.... ..........1Q....
0020: 000000000000c0a80032000000000000 000000000000000000000000         .........2...... ............
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
You received an ARP request from something on the network.

IP Header: fffffffffffff0bf97d0315108060001 0800
 To MAC     ff:ff:ff:ff:ff:ff (broadcast)
 Sender MAC f0:bf:97:d0:31:51

ICMP Packet: 06040001f0bf97d03151c0a800a1 000000000000c0a80032000000000000 000000000000000000000000    
 Sender MAC: 0b:f9:7d:03:15
 Sender IP:  c0a800a1 = 192.168.0.161
 Target MAC: 00:00:00:00:00:00
 Target IP:  c0a80032 = 192.168.0.162
enc_transmit: Sending packet, pktlen: 42
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032 ....1Q.......... ...............2
0020: f0bf97d03151c0a800a1                                              ....1Q....
..
Assertion failed at file:net/enc28j60.c line: 1433
And this is that same bug that sometimes the ERXWPT pointer is not initialized by the ENC28J60 correctly.

That basically all looks normal.  Did you try to ping?  It is difficult when there are so many packets being received.  It is difficult to debug if you use an open network.

Greg
Gong Darcy
2012-09-23 10:00:48 UTC
Permalink
Hi Greg,
I've been in the fire-stm32v3 run from the network.As you said, the network
is sometimes good and sometimes bad.
China Electronics Engineers blog, I find the a little ENC28j60 Boot
instructions. I hope to be useful to you.
The information in Chinese, I use google translate transferred into
English. Blog Address:
http://www.cnblogs.com/yuani/articles/1656803.html
I will press the paper said look at the code.I rookie, it is estimated that
the problem can not be solved.

darcy

--------------------------------------
Ethernet controller ENC28J60 programming essentials
Abstract: In embedded systems, the Ethernet controller is usually one of
the focus MicroChip company ENC28J60 higher value in the embedded system
applications, the chip integrates the MAC controller and PHY, SPI
interface, suitable for use in added Ethernet connectivity tight pin
resources embedded systems, this paper introduces a MicroChip ENC28J60
controller initialization and its programming attention and points, and for
some of the problems that may be encountered in the development discussed.
Keywords: ENC28J60 Programming
1 Ethernet data buffer (8K) read and write / address control REG's role:
REG In addition to EPKTCNT 16bits, Ethernet data buffer address: 0000h ~
1FFFh
1) by ERDPT (divided into H / L two) MCU read buffer pointer:
- Manual P28, MCU read buffer data, each actually read the address saved by
the REG.
2) EWRPT (divided into H / L two) MCU write buffer pointer:
- Manual P29, MCU to write data to the buffer, each time the address is
actually written by the Save the REG.
3). ERXRDPT (divided into the H / L two) receiving a read pointer:
- Manual P17, P33, and the location of the definition of prohibited receive
hardware write FIFO. In normal operation, the receiver hardware (network
interface direction) data sequentially written into the unit (not including
the cell) until ERXRDPT referred. Note that the REG release buffer space
operations.
4). ERXWRPT (divided into the H / L two) receiving a write pointer:
- Manual P17, P33, defined receiver hardware FIFO write data received in
the specific location. In normal operation, the receiver hardware (network
interface direction) to the data the sequential write ERXWRPT referred
unit. Note this the REG as "read-only", and with the release of buffer
space operations.
5) ETXST (divided into H / L two) to send slow starting address:
- Manual P17 function, the entire Ethernet in the data buffer, defined to
be the send data area of ​​the first address
6) while the ETXND (divided into the H / L two) transmit buffer area end
address:
- Manual P17 function, the entire Ethernet in the data buffer, defined to
be the tail of the send data area address
7) receiving slow start address of the area pointed to by ERXST (divided
into H / L two):
- Manual P17, the entire Ethernet data buffer, defined receiver hardware
can be written to the first address of the data buffer.
8). ERXND (the end of the receive buffer area is divided into H / L two):
- Manual P17, the entire Ethernet data buffer, defined receiver hardware
can be written to the address of the data buffer tail.
9). EPKTCNT (8bits) Ethernet packet counter:
- Manual P43, P45, when hardware allows each received at least one Ethernet
packet (> 64bytes), EPKTCNT +1, a maximum of 255, then regardless of the
buffer whether there idle also no longer receive data. every time forward
ERXRDPT (release the receive buffer operation), EPKTCNT-1, the minimum
value is 0.
Note: in the above 9 REG, the name with an "X" in a predetermined address
to the Ethernet transceiver use (i.e.: from the Ethernet side access 8K
cache),, only ERDPT and EWRPT is MCU through the SPI interface to access
the 8K buffer access relationship as shown below:


The where ERXWRPT and ERXRDPT point to the same address, should be
receiving ENC28J60 pointing address from ERXWRPT has been written to
address ERXRDPT point before a space (ie manual so-called "no including
ERXRDPT pointing unit"). Entire receiving buffer The District All available
the .8 K space, the actual space used for the transmit buffer is determined
by the register set ETXST and ETXND actually used for buffer space
determined by the the register set ERXST and ERXND Obviously 8K space can
excess nothing not in position.
2.MII and PHY register operation:
PHY register is responsible for the configuration of the PHY interface MCU
can not directly from the SPI interface to access these REG master can be
accessed through the MAC group, a group of special control REG PHY control
register, these special control REG MAC group that called MII interface
registers.
The MCU, there will be no possibility of direct access to the PHY, the PHY
operation must be done by the MII register. Need to pay attention, PHY
written must write low 8bits 16bits, when the write high 8bits when control
setting will be effective immediately.
3 controller structure and initialization process
Initialization process should be:
For initialization the ETH group REG ---> initialize MAC group REG ---> by
MII initialization PHY groups REG hardware stable (need to query)
Step1: ETH group control register initialization
1). EIE initialization
- Manual P67, Ethernet Interrupt Enable Control
The master SPI write control REG (WCR), issued 2byte the REG address 0h1b,
data for:
0b010 \ 11011 +0 bAAAAAAAA (A - 8bits actual data)
2). EIR query
- Manual P68, Ethernet interrupt status for
The master SPI read control REG (RCR), issued 2byte the REG address 0h1C,
data for:
0b010 \ 11100 +0 bXXXXXXXX (X-issued in order to maintain SPCK invalid
number)
Read data in return to the SPI send the second significant byte.
3). ESTAT query
- Manual P66, obtaining PHY Ready state (as well as Ethernet error status)
The master SPI read control REG (RCR), issued 2byte the REG address 0h1D,
data for:
0b010 \ 11101 +0 bXXXXXXXX (X-issued in order to maintain SPCK invalid
number)
Read data in return to the SPI send the second significant byte.
4). ECON2 initialization
- Manual P16, IC control of energy-saving control, packet pointer register
The master SPI write control REG (WCR), issued 2byte, the REG address 0h1E
data:
0b010 \ 11110 +0 bAAAAAAAA (A - 8bits actual data)
5). ECON1 initialization
- Manual P15, pay special attention to the select bit BANK0 ~ 3, write
different control REG Bank0 ~ 3 choices need to repeatedly change.
- Manual P16, IC control of energy-saving control, packet pointer register
The master SPI write control REG (WCR), issued 2byte, the REG address 0h1F
data:
0b010 \ 11111 +0 bAAAAAAAA (A - 8bits actual data)
6). ERXFCON receiver filter initialization
- Manual P48,
First need to write ECON1, chose to visit Bank1 thereafter
The master SPI write control REG (WCR), issued 2byte REG address 0h18, data:
0b010 \ 11000 +0 bAAAAAAAA (A - 8bits actual data)
Step2: ETH group address register initialization
1). The register group ETXST and ETXND place
- Definition of send buffer range
ETXSTL / H
The master SPI write control REG (WCR), issued 4byte the REG address 0h04
(L), of 0h05 (H), the data is:
0b010 \ 00100 +0 bAAAAAAAA (A - 8bits actual data, ETXSTL) of
0b010 \ 00101 +0 bAAAAAAAA (A - 8bits actual data ETXSTH)
ETXNDL / H
The master SPI write control REG (WCR), issued 4byte the REG address 0h06
(L), of 0h07 (H), the data is:
0b010 \ 00110 +0 bAAAAAAAA (A - 8bits actual data, ETXNDL) of
0b010 \ 00111 +0 bAAAAAAAA (A - 8bits actual data ETXNDH)
2). The register group ERXST and ERXND place
- Define the range of the receive buffer
ERXSTL / H
The master SPI write control REG (WCR), issued 4byte the REG address 0h08
(L), of 0h09 (H), the data is:
0b010 \ 01000 +0 bAAAAAAAA (A - 8bits actual data, ERXSTL) of
0b010 \ 01001 +0 bAAAAAAAA (A - 8bits actual data ERXSTH)
ERXNDL / H
The master SPI write control REG (WCR), issued 4byte REG address 0h0a (L),
0h0b (H), the data is:
0b010 \ 01010 +0 bAAAAAAAA (A - 8bits actual data, ERXNDL) of
0b010 \ 01011 +0 bAAAAAAAA (A - 8bits actual data ERXNDH)
3). ERXWRPT, and ERXRDPT in place
- Attention to its range with the application-defined data frame size
changes, and every time to be processed after receiving operating ERXRDPT
free up space.
ERXWRPTL / H
The master SPI write control REG (WCR), issued 4byte REG address 0h0C (L),
0h0D (H), the data is:
0b010 \ 01100 +0 bAAAAAAAA (A - 8bits actual data, ERXRDPTL) of
0b010 \ 01101 +0 bAAAAAAAA (A - 8bits actual data ERXRDPTH)
Note: initialization ERXWRPTL / H and generally equal to ERXSTL / H
ERXRDPTL / H
The master SPI write control REG (WCR), issued 4byte REG address 0h0E (L),
0h0F (H), the data for:
0b010 \ 01110 +0 bAAAAAAAA (A - 8bits actual data, ERXRDPTL) of
0b010 \ 01111 +0 bAAAAAAAA (A - 8bits actual data ERXRDPTH)
Note: the ERXRDPT with ERXWRPT difference should be greater than an
Ethernet data frame the length if ERXRDPT = ERXWRPT the entire receive
buffer can be used continuously.
4) According to the MCU needs to receive data from the Ethernet, ERDPT place
ERDPTL / H
The master SPI write control REG (WCR), issued 4byte REG address 0h00 (L),
0h01 (H), the data for:
0b010 \ 00000 +0 bAAAAAAAA (A - 8bits actual data, ERDPTL)
0b010 \ 00001 +0 bAAAAAAAA (A - 8bits actual data ERDPTH)
5) According to the MCU to Ethernet to send data, EWRPT place
EWRPTL / H
The master SPI write control REG (WCR), issued 4byte the REG address 0h02
(L), of 0h03 (H), the data is:
0b010 \ 00010 +0 bAAAAAAAA (A - 8bits actual data, EWRPTL) of
0b010 \ 00011 +0 bAAAAAAAA (A - 8bits actual data EWRPTH)
Step3: MAC group register initialization
(Note: the MAC group registers Mapping in Bank2 / 3 access is required
before adjust the BSEL0 ECON1 in / 1)
If the initialization after power-on reset, initialization must query
ESTAT.CLKRDY (Manual P33)
The MAC register initialization order does not matter, general description
of the order in accordance with (Manual P34):
1) MACON2.MARST cleared 0-MAC initialization exit.
The master SPI write control REG (WCR), issued 2byte REG address 0h01
(Bank2) data:
0b010 \ 00001 +0 bAAAAAAAA (A - 8bits actual data)
2). MACON1 initialization
- MARXEN position 1 to enable MAC receive.
- Start full-duplex the way, TXPAUS RXPAUS of position.
The master SPI write control REG (WCR), issued 2byte REG address 0h00
(Bank2) data:
0b010 \ 00000 +0 bAAAAAAAA (A - 8bits actual data)
3). MACON3 initialization
- The PADCFG.TXCRCEN. FULDPX position enable frame automatically populated
enable automatic CRC generation. (Note the use of the which FRMLNEN bit).
The master SPI write control REG (WCR), issued 2byte REG address 0h02
(Bank2) data:
0b010 \ 00010 +0 bAAAAAAAA (A - 8bits actual data)
4). MACON4 generally keep the default value
5) MAMXFL will (16bitsREG, is divided into two parts of H / L) in place
- Determine the maximum number of bytes of the network frame (tentatively
defined application in the frame length of 64 bytes).
The master SPI write control REG (WCR), issued 4byte, the the the REG
address (BANK2) 0h0A (L), 0h0B (H), the data is:
0b010 \ 01010 +0 bAAAAAAAA (A - 8bits actual data, MAMXFLL),
0b010 \ 01011 +0 bAAAAAAAA (A - 8bits actual data, MAMXFLH),
6). MABBIPG seated
- Back-to-back packet interval in place, full-duplex when placed value
fixed for 15h
The master SPI write control REG (WCR), issued 2byte REG address 0h04
(Bank2) data:
0b010 \ 00100 +0 b00010101
7). MAIPGL seated
- A non-back-to-back packet time interval in place, full duplex placement
value is fixed to 12h (L) and 0Ch (H,)
The master SPI write control REG (WCR), issue 4 bytes, the REG address
(Bank2) 0h06 (L) 0h07 (H)
Data is:
0b010 \ 00110 +0 b00010010 (MAIPGLL)
0b010 \ 00111 +0 b00001100 (MAIPGLH)
Note: In normal use, it should be full-duplex mode, the MACLCON1 / 2 to
keep the default value
8). MAC address in place (mapped in Bank3)
- 6 bytes of the MAC address is written to the register set: MAADR0 ~
MAADR5.
The master SPI write control REG (WCR), issued 6byte REG address (Bank3)
0h00 ~ 0h05 data:
0b010 \ 00000 +0 bAAAAAAAA (A - 8bits actual data, MAADR1)
0b010 \ 00001 +0 bAAAAAAAA (A - 8bits actual data, MAADR0),
0b010 \ 00010 +0 bAAAAAAAA (A - 8bits actual data, MAADR3) of
0b010 \ 00011 +0 bAAAAAAAA (A - 8bits actual data MAADR2)
0b010 \ 00100 +0 bAAAAAAAA (A - 8bits actual data, MAADR5),
0b010 \ 00101 +0 bAAAAAAAA (A - 8bits actual data, MAADR4),
Step4: PHY group register initialization
Note: If the initialization after power-on reset, initialization must query
ESTAT.CLKRDY (Manual P33)
(Note: the MII interface REG mapping of the PHY group register in Bank2,
visit need the adjustment ECON1 BSEL0 / 1)
And PHY MII register a total of six are:
The MICON-Manual P21, MII control REG
MICMD-Manual P21, MII command REG
MIREGADR-Manual P19, PHY access address REG
MIWRL/H- Manual P19, PHY write data REG high / low, note that the the REG
set of must first write L and then write H, write H MII control event
triggers.
P19, MIRDL/H- manual PHY read data REG high / low the before reading-should
MICMD MIIRD position 1, so that can be triggered by the the PHY event and
make MISTAT.BUSY = 1, when the MII PHY value, MIIRD not automatically To
manually cleared so in doublet query MISTAT.BUSY = 0 cleared.
MISTAT-Manual P22, MII status REG reflect the state of the PHY read / write
PHY before should the query REG when MISTAT.BUSY = 0 only when they can
operate.
Manual P38, generally only need to configure three PHY module and want to
check the working status of the PHY
1). PHCON1 manual operation
- Although half / full duplex mode can be determined by way of external
LED, but manually set the value of PHCON1.PDPXMD bit safer method, but also
hand-to modify MACON3 in FULDPX bit.
- PHY address 00h, MII operation processes in Manual P19
The The the master SPI write control REG (WCR), issued 2byte * to to into
the MIREGADR, into the MIWRL / H 3 REG
Address (BANK2) 0h14 (the MIREGADR), 0h16 (into the MIWRL), 0h17 (MIWRH),
the data is:
0b010 \ 10100 +0 b00000000 (byte the 1-MIREGADR the address, byte 2 - the
write PHCON1 address 00h)
0b010 \ 10110 +0 bAAAAAAAA (byte the 1-MIREGADR the address, byte 2 - write
MIWRL the-L byte the 8bits actual data should be written to PHCON1 the
actual value)
0b010 \ 10111 +0 b00000000 the (byte the 1-MIREGADR the address, byte 2 the
8bits actual data - write MIWRH the invalid data issued here, the only
trigger PHY event).
After writing, MII automatically trigger PHY event, MISTAT.BUSY
automatically set.
2). PHLCON settings
- According to the actual structure of the external junction LED circuit,
it is possible to modify the REG.
- PHY address 00h, MII operation processes in Manual P19
The The the master SPI write control REG (WCR), issued 2byte * to to into
the MIREGADR, into the MIWRL / H 3 REG
Address (BANK2) 0h14 (the MIREGADR), 0h16 (into the MIWRL), 0h17 (MIWRH),
the data is:
0b010 \ 10100 +0 b00010100 the (byte the 1-MIREGADR the address, byte 2 -
write PHLCON the address 14h)
0b010 \ 10110 +0 bAAAAAAAA (byte the 1-MIREGADR the address, byte 2 - write
MIWRL the-L byte the 8bits actual data should be written to PHLCON the
actual value)
0b010 \ 10111 +0 b00000000 the (byte the 1-MIREGADR the address, byte 2 the
8bits actual data - write MIWRH the invalid data issued here, the only
trigger PHY event).
After writing, MII automatically trigger PHY event, MISTAT.BUSY
automatically set.
3). PHCON2 settings
- General duplex state can keep its default value, but to note the TXDIS
bit can turn off PHY hardware to send.
The The the master SPI write control REG (WCR), issued 2byte * to to into
the MIREGADR, into the MIWRL / H 3 REG
Address (BANK2) 0h14 (the MIREGADR), 0h16 (into the MIWRL), 0h17 (MIWRH),
the data is:
0b010 \ 10100 +0 b00000000 the (byte the 1-MIREGADR the address, byte 2 -
write PHCON2 the address 11h)
0b010 \ 10110 +0 bAAAAAAAA (byte the 1-MIREGADR the address, byte 2 - write
MIWRL the-L byte the 8bits actual data should be written to PHCON2 the
actual value)
0b010 \ 10111 +0 b00000000 the (byte the 1-MIREGADR the address, byte 2 the
8bits actual data - write MIWRH the invalid data issued here, the only
trigger PHY event).
After writing, MII automatically trigger PHY event, MISTAT.BUSY
automatically set.
Special Note: PHY registers can not be accessed directly, indirectly,
operating through the MII register.
4) query MISTAT state
- Master SPI read control REG (RCR), issued 3byte, the REG address of 0h0A
(Bank3), data:
0b010 \ 01010 +0 bXXXXXXXX +0 bXXXXXXXX (X-to maintain the SPCK issued
invalid number)
Read data returns sent in SPI third significant byte.
Post by Gregory Nutt
**
Hi, Darcy,
Post by Gong Darcy
This is the I now output state(3 times boot).I have installed
Wireshark, is to figure out how to use.
It is very, very easy! You just select the Capture menu, then the
interface. That is all. Then it will capture network data until you do
Capture->Stop.
Post by Gong Darcy
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 0346 pktlen: 64 rxstat: 03c0
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
Post by Gong Darcy
0020: 000000000000c0a80064000000000000 000000000000000000000000
.........d...... ............
Post by Gong Darcy
...
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 038c pktlen: 64 rxstat: 03c0
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
Post by Gong Darcy
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
Post by Gong Darcy
...
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 03d2 pktlen: 64 rxstat: 03c0
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
Post by Gong Darcy
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
etc.
This is one of the reasons that I don't like to use the open network for
testing. You are receiving many, many broadcast messages that will
probably all be dropped. That is normal behavior when you run in an open
network.
I recommend that you catch all of the console output in a log file. There
will be a lot of it!
Post by Gong Darcy
...
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 6400a8c0
enc_uiptxpoll: Poll result: d_len=0
enc_irqworker: EIR: 40
enc_irqworker: EPKTCNT: 01
enc_pktif: Receiving packet, nextpkt: 038c pktlen: 64 rxstat: 03c0
0000: fffffffffffff0bf97d0315108060001 080006040001f0bf97d03151c0a800a1
..........1Q.... ..........1Q....
Post by Gong Darcy
0020: 000000000000c0a80032000000000000 000000000000000000000000
.........2...... ............
Post by Gong Darcy
enc_rxdispatch: ARP packet received (608)
uip_arp_arpin: ARP request for IP 3200a8c0
You received an ARP request from something on the network.
IP Header: fffffffffffff0bf97d0315108060001 0800
To MAC ff:ff:ff:ff:ff:ff (broadcast)
Sender MAC f0:bf:97:d0:31:51
ICMP Packet: 06040001f0bf97d03151c0a800a1 000000000000c0a80032000000000000
000000000000000000000000
Sender MAC: 0b:f9:7d:03:15
Sender IP: c0a800a1 = 192.168.0.161
Target MAC: 00:00:00:00:00:00
Target IP: c0a80032 = 192.168.0.162
So something on your network knows about your IP address. And this seems
Post by Gong Darcy
enc_transmit: Sending packet, pktlen: 42
0000: f0bf97d0315100e0deadbeef08060001 08000604000200e0deadbeefc0a80032
....1Q.......... ...............2
Post by Gong Darcy
0020: f0bf97d03151c0a800a1
....1Q....
Post by Gong Darcy
..
Assertion failed at file:net/enc28j60.c line: 1433
And this is that same bug that sometimes the ERXWPT pointer is not
initialized by the ENC28J60 correctly.
That basically all looks normal. Did you try to ping? It is difficult
when there are so many packets being received. It is difficult to debug if
you use an open network.
Greg
Gregory Nutt
2012-09-23 13:34:40 UTC
Permalink
Hi, Darcy,
I've been in the fire-stm32v3 run from the network.As you said, the network is sometimes good and sometimes bad. ...
The problem is that the ERXWRPTH:ERXWRPTL registers are sometimes not being initialized properly.
http://www.cnblogs.com/yuani/articles/1656803.html
ERXWRPTL / H
0b010 \ 01100 +0 bAAAAAAAA (A - 8bits actual data, ERXRDPTL) of
0b010 \ 01101 +0 bAAAAAAAA (A - 8bits actual data ERXRDPTH)
Note: initialization ERXWRPTL / H and generally equal to ERXSTL / H
ERXRDPTL / H
0b010 \ 01110 +0 bAAAAAAAA (A - 8bits actual data, ERXRDPTL) of
0b010 \ 01111 +0 bAAAAAAAA (A - 8bits actual data ERXRDPTH)
The 0b010 part is the upper 3-bits of the write control register command.  The next five bits are the register address.  NOTE:  That they have these reversed above.  01100 is ERXRDPTL, 01101 is ERXRDPTH, 01110 is ERXWRPTL, and ERXWRPTH.

I do not initialize ERXWRPTL / H at all because according to the ENC28J60 data sheet:


"The ERXWRPTH:ERXWRPTL registers define a location within the FIFO where the hardware will write bytes that it receives. The pointer is read-only and is automatically updated by the hardware whenever a new packet is successfully received....

"When programming the ERXST or ERXND Pointer, the internal hardware copy of the ERXWRPT registers will automatically be updated with the value of ERXST. This value will be used as the starting location when the receive hardware begins writing received data. ..."

1) You can try writing the address to ERXWRPTL / H (even though the specification says they are read-only).

2) Or perhaps if ERXWRPTL / H have the wrong value, you could reset ERXSTL/H or ERXNDL/H again?

I will try 1)


Greg

Gregory Nutt
2012-09-21 18:04:15 UTC
Permalink
Hi, Darcy,
Post by Gong Darcy
The attachment is a schematic files
I did not review all of the pins in the schematic.  I did see the change to the ENC28J60 interrupt and also the change in the GPIO for the KEY1.  Let me no if you see other differences.

I created a new configuration option, CONFIG_ARCH_BOARD_FIRE_STM32V3 that will use the different pin configurations for the v3 board.  I can add more pin differences if you see them.

Greg
Gong Darcy
2012-09-21 19:02:02 UTC
Permalink
hi Greg,
I write with python an auxiliary tool.Simplify tools/configure.sh the
operation.
Note configuration of nuttx.cfg. The configs/boardname/nsh/defconfig
definition will be replaced with the parameters in the nuttx.cfg.
Usage, see:. / Run.py-h
I generally use. / Run.py-b fire-stm32v2/nsh-a

darcy
Post by Gregory Nutt
**
Hi, Darcy,
Post by Gong Darcy
The attachment is a schematic files
I did not review all of the pins in the schematic. I did see the change
to the ENC28J60 interrupt and also the change in the GPIO for the KEY1.
Let me no if you see other differences.
I created a new configuration option, CONFIG_ARCH_BOARD_FIRE_STM32V3 that
will use the different pin configurations for the v3 board. I can add more
pin differences if you see them.
Greg
Continue reading on narkive:
Loading...