-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enc424j600 does not work #35091
Comments
I can not reproduce it with link_board_eth shield connected to nrf5340dk_nrf5340. Please check interrupt (INT) line, level shifter, pullups on your board. |
@jfischer-no There are 3 bits for interrupts that are not implemented as per the datasheet http://ww1.microchip.com/downloads/en/devicedoc/39935b.pdf page 120 in the high byte (2 bits in the lower byte too), the lower 3 bits are reserved, that is "Ignore on read, don’t care on write", in the chip I have here, they are being returned as set hence the following error "[00:00:00.259,124] ethdrv: Unknown Interrupt, EIR: 0x0700" The code in the driver works by waiting for an interrupt, then in a thread it waits for a semaphore and once received, disables interrupts on the enc424j600, it reads and then handles the interrupt and re-enables interrupts except in the case of it being an invalid interrupt, in which case it leaves interrupts disabled. This is not valid operation.
So the issue may be that you have a different silicon revision of the enc424j600 chip or for any other number of reasons, however, the bug is with the driver code. |
It could also be related to errata number 4 as per https://ww1.microchip.com/downloads/en/DeviceDoc/80477A.pdf |
Only two interrupt source are enabled PHYLNK and PKTCNT. "the INT pin is driven low and the INT flag (ESTAT<15>) becomes set" only for these interrupt sources, not for any others. continue at L:487 is intentional to detect errors like spurious interrupts.
It is not relevant because these interrupt sources are not enabled by the driver, and thus will not generate interrupt.
It is valid, I intentionally designed it that way, see above.
Well that can be, surely you have checked your hardware and signal integrity, then it must be the driver.
Maybe it is not the driver? |
I enclose a zip with 2 traces and 2 outputs, one from before the changes and one from after. Logic traces can be viewed with saleae's viewer available from https://support.saleae.com/logic-software channel 0 is SPI clock, channel 1 is SPI MOSI, channel 2 is SPI MISO and channel 3 is the interrupt. You can use the saleae logic SPI decoder to view the SPI traffic from a glance. |
For the record: I was able to reproduce it on nRF5340DK by changing used SPI node to spi2 (the same used on BL5340 board). I can also confirm that clearing INTIE flag in EIE register right after reset (SETETHRST) fixes the issue. |
After system reset (SETETHRST) interrupt enable register (EIE) has the default value 0x8010 and global interrupt enable flag (INTIE) is set. This is not desired and the INTIE flag should be set only at the end of the initialization. Disable INTIE flag and set desired interrupts sources in a single write command just right after system reset. Resolves: zephyrproject-rtos#35091 Reported-by: Jamie McCrae <[email protected]> Signed-off-by: Johann Fischer <[email protected]>
After system reset (SETETHRST) interrupt enable register (EIE) has the default value 0x8010 and global interrupt enable flag (INTIE) is set. This is not desired and the INTIE flag should be set only at the end of the initialization. Disable INTIE flag and set desired interrupts sources in a single write command just right after system reset. Resolves: #35091 Reported-by: Jamie McCrae <[email protected]> Signed-off-by: Johann Fischer <[email protected]>
…r reset After system reset (SETETHRST) interrupt enable register (EIE) has the default value 0x8010 and global interrupt enable flag (INTIE) is set. This is not desired and the INTIE flag should be set only at the end of the initialization. Disable INTIE flag and set desired interrupts sources in a single write command just right after system reset. Resolves: zephyrproject-rtos#35091 Reported-by: Jamie McCrae <[email protected]> Signed-off-by: Johann Fischer <[email protected]> (cherry picked from commit de974ef) Signed-off-by: Andrzej Puzdrowski <[email protected]>
…r reset After system reset (SETETHRST) interrupt enable register (EIE) has the default value 0x8010 and global interrupt enable flag (INTIE) is set. This is not desired and the INTIE flag should be set only at the end of the initialization. Disable INTIE flag and set desired interrupts sources in a single write command just right after system reset. Resolves: zephyrproject-rtos#35091 Reported-by: Jamie McCrae <[email protected]> Signed-off-by: Johann Fischer <[email protected]> (cherry picked from commit de974ef) Signed-off-by: Andrzej Puzdrowski <[email protected]> (cherry picked from commit 1c6eaa2)
Describe the bug
We are using a enc424j600 device with our BL5340 board (nRF5340-based) and running the sample apps for network (e.g. dumb_http_server) results in a failed networking start up. There is a strange way to get it working however, if the module is booted with the enc424j600's interrupt line disconnect and then connected after a bootup
To Reproduce
Build dumb_http_server for enc424j600 and run it
Expected behavior
With the changes made:
Impact
Driver is useless, network is useless, showstopper
Logs and console output
Output with interrupt line connected as normal:
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: