[ECOS] Re: AT91SAM7S USB corruption
I have just tried Olivers patches to the AT91 USB driver, and my problems have been fixed! I still had to patch the patches, but only a minor fix was needed: CLEAR_BITS (pCSR, AT91_UDP_CSR_TXCOMP | AT91_UDP_CSR_RXSETUP | AT91_UDP_CSR_ISOERROR); in usbs_at91_endpoint_isr_rx shouldn't clear the TXCOMP flag. And thus should become: CLEAR_BITS (pCSR, AT91_UDP_CSR_RXSETUP | AT91_UDP_CSR_ISOERROR); With this minor fix to the patches, I've managed to leave my code running for well over 8 hours without any crashes or issues! Thanks, -- Erant On Feb 11, 2010, at 2:54 PM, oliver munz @ s p e a g wrote: There is an error in the rx-endpoint-interrupt-handling: Sorry it should be: pep-buffer_size = (cyg_uint32) * ppbegin - (cyg_uint32) pep-buffer; if (!pep-halted pep-buffer_size) { (*pep-complete_fn) (pep-complete_data, pep-buffer_size); } else { (*pep-complete_fn) (pep-complete_data, -EAGAIN); } usbs_at91_endpoint_interrupt_enable (epn, false); Regards Oliver -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
[ECOS] Re: AT91SAM7S USB corruption
There is an error in the rx-endpoint-interrupt-handling: In the usbs_at91_endpoint_dsr (cyg_uint8 epn) replace: pep-buffer_size = (cyg_uint32) * ppbegin - (cyg_uint32) pep-buffer; if (pep-buffer_size pep-complete_fn) { if (!pep-halted) { (*pep-complete_fn) (pep-complete_data, pep-buffer_size); } else { (*pep-complete_fn) (pep-complete_data, -EAGAIN); } } usbs_at91_endpoint_interrupt_enable (epn, false); with this: pep-buffer_size = (cyg_uint32) * ppbegin - (cyg_uint32) pep-buffer; if (!pep-halted) { (*pep-complete_fn) (pep-complete_data, pep-buffer_size); } else { (*pep-complete_fn) (pep-complete_data, -EAGAIN); } usbs_at91_endpoint_interrupt_enable (epn, false); I will sometime make a diff... Regards Oliver -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
[ECOS] Re: AT91SAM7S USB corruption
There is an error in the rx-endpoint-interrupt-handling: Sorry it should be: pep-buffer_size = (cyg_uint32) * ppbegin - (cyg_uint32) pep-buffer; if (!pep-halted pep-buffer_size) { (*pep-complete_fn) (pep-complete_data, pep-buffer_size); } else { (*pep-complete_fn) (pep-complete_data, -EAGAIN); } usbs_at91_endpoint_interrupt_enable (epn, false); Regards Oliver -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
[ECOS] Re: AT91SAM7S USB corruption
Hello Erant I also have problems whit the current at91_usb. I try to bring an old running eCOS firmware to the actual eCOS-version. The first thing i found was, that the enumeration writes the last endpoint-desctipoter twice. The patch for this is: usbs.c: if (done) { endpoint-fill_buffer_fn = (void (*)(usbs_control_endpoint*)) 0; ++endpoint-buffer_size = 0; } else { req-type = (unsigned char) current_interface; req-value_lo = (unsigned char) current_endpoint; req-value_hi = (unsigned char) last_endpoint; req-index_hi = (unsigned char) (sent 8); req-index_lo = (unsigned char) (sent 0x00FF); I use fprintf and fgetc for writing and reading from bulk-endpoints. The fprintf works great as ever, but the fgetc is broken. So if You find some problem in the driver i would like to know... Regards Oliver -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss