zephyriot / zep-jira14

0 stars 0 forks source link

ENC28J60 driver doesn't work on Arduino 101 #1171

Closed nashif closed 7 years ago

nashif commented 7 years ago

Reported by Lei Liu:

Configuration

x86 Bug detailed description =================== ENC28J60 driver doesn't work on Arduino 101. There is no network activity from the ENC module Steps to Reproduce ================== 1. cd samples/net/dns_client 2. make pristine && make BOARD=arduino_101 flash 3. open serial port Expected Result ============= DNS client works well && ENC28J60 driver works. Actual Result ========== There is no network activity from the ENC module (Imported from Jira ZEP-1293)
nashif commented 7 years ago

by Tomasz Bursztyka:

Lei Liu Isn't the test you are trying to run the wrong one? (or did you just c/p the wrong one actually)

nashif commented 7 years ago

by Flavio Santes:

Just to clarify the issue description: QA was testing the DNS client app with the A101 and the ENC module.

The report refers to the SPI/ENC driver (the Ethernet module via SPI), just remove SPI from "SPI/ENC" to avoid confusions.

nashif commented 7 years ago

by Flavio Santes:

I am updating the issue description

nashif commented 7 years ago

by Tomasz Bursztyka:

Thanks for clarifying

nashif commented 7 years ago

by Lei Liu:

Sorry for the incorrect description. Thanks Flavio Santes for your updating.

nashif commented 7 years ago

by Juan Manuel Cruz Alcaraz:

The following commits are being reviewed. https://gerrit.zephyrproject.org/r/#/c/7647/ https://gerrit.zephyrproject.org/r/#/c/7513/

nashif commented 7 years ago

by Lei Liu:

Juan Manuel Cruz Alcaraz I tried your patches basing on commit:9076215ff72eaadee17ea2f7e870098235119c20 (net branch)

Patch: https://gerrit.zephyrproject.org/r/#/c/7513/ is useless. cause the code already in. {code:title=drivers/ethernet/eth_enc28j60.c|borderStyle=solid} 145 nano_fiber_sem_take(&context->spi_sem, TICKS_UNLIMITED); 146 147 for (int i = 0; i < num_segments; 148 ++i, index_buf += MAX_BUFFER_LENGTH) { 149 context->mem_buf[0] = ENC28J60_SPI_WBM; 150 memcpy(context->mem_buf + 1, index_buf, MAX_BUFFER_LENGTH); 151 spi_write(context->spi, 152 context->mem_buf, MAX_BUFFER_LENGTH + 1); 153 }

{code:title=drivers/ethernet/eth_enc28j60.c|borderStyle=solid}
178         for (int i = 0; i < num_segments;
179              ++i, index_buf += MAX_BUFFER_LENGTH) {
180                 context->mem_buf[0] = ENC28J60_SPI_RBM;
181                 spi_transceive(context->spi,
182                                context->mem_buf, MAX_BUFFER_LENGTH + 1,
183                                context->mem_buf, MAX_BUFFER_LENGTH + 1);
184                 memcpy(index_buf, context->mem_buf + 1, MAX_BUFFER_LENGTH);
185         }

Apply patch https://gerrit.zephyrproject.org/r/#/c/7647/ . I still fail to observe any package is send out from enc28j60 module when running samples/net/dns_client APP.

nashif commented 7 years ago

by Juan Manuel Cruz Alcaraz:

The driver behaves correctly on the echo client/server samples. We are tracing why in this particular sample there are tx issues.

nashif commented 7 years ago

by Flavio Santes:

After applying [1, 2], TX and RX work again. However, driver stability must be evaluated under stress conditions and under several configurations.

On the other hand, the DNS client is not working, so I will create another Jira to track this new issue. It seems that last updates to the kernel and IP stack broke something related to the RX callback and once the callback is executed, the IP stack becomes unresponsive.

[1] https://gerrit.zephyrproject.org/r/#/c/7647/ [2] https://gerrit.zephyrproject.org/r/#/c/7513/

nashif commented 7 years ago

by Flavio Santes:

GH-1234 will track the DNS client issue.

nashif commented 7 years ago

by Juan Manuel Cruz Alcaraz:

The DNS clients and other net applications are not working because IP stack seems to be unstable. The ENC driver works correctly for other applications like echo server.

I suggest to reopen with a changed name, like: DNS sample is not working. This will help to root cause and assign an owner correctly. For now it seems the root cause might be the IP stack and not the ENC driver.

There seems to be a mismatch between what IP stack is expecting from the drivers. Since this was working previoulsy it means that the IP stack API contract has changed and there is not information from IP stack owners on that matter.

It is related with the following bug: GH-1238

nashif commented 7 years ago

by Sharron LIU:

Juan Manuel Cruz Alcaraz , for an issue resolved with "Won'tDo", please leave it for the reporter to close it. Lei Liu , please review comments from Juan, and confirm you agree the issue could be root caused to GH-1238.

nashif commented 7 years ago

by Lei Liu:

Yes, agree with Juan. Close this is OK

nashif commented 7 years ago

by Mark Linkmeyer:

Correcting the priority field