Hi,I have an application where a webserver and an USB-mass-storage-device should share the access to a MMC-filesystem. Both modules separate works fine. I can access files via the webserver or via the USB-interface if I initialize only one of them. But if I initialize the USB-device, the network goes dead. No ping response and no connection to the webserver furthermore. The USB-device works normal at this point.I attached a stripped version of my project, where the network is initialized immediately but the USB-device after 20 seconds. Within this twenty seconds the network-access is functional, after initialization of the USB after 20 seconds the network goes down.I hope that someone can find my failure and help to bring both modules work together.A second question. In this application I need a second USB-mass-storage-device (applicated as second drive on the PC). What have I to do to create two independent USB-devices. The transfer-functions for this device I've already tested. I can access both memory areas separate if I use the appropriate transfer-functions. But I can at the moment only create one device at a time and found no possibility to create a second. Any hints?
In reply to adboc:
Hi adboc, thank you for your hints. I changed the priorities of Init-Thread to 5 DHCP-Thread to 8 HTTP-Thread to 6 and USB0-Thread to 7 and increased all 1ms-sleeps to at least 2ms. But the behavior of the result is the same as before, unfortunately. No idea, whats still wrong. I've updated the example archive on my first post if someone wants to test it. The chapter "Multiple SCSI LUN" I'll study in within the next time and will give feedback about the result. Sorry for my bad english, I'm german.
In reply to 4711:
After reading the chapter about "Multiple SCSI LUN" I realized, that I already did what was suggested there. Attached is the content of the struct "g_ux_device_class_storage_parameter" the function "_ux_device_stack_class_register" is called with. But there is only the first drive (0) visible on the PC (and the network always stops working ). frupic.frubar.net/36820
You may also use USB Composite Device. Please take a look at example project:
Hi adboc, there are no unexpected entries on the call stack. The second question regarding the threads I don't understand. I'll try to dig into the TCPIP stats to find any irregularities.
Hi Jeremy,USB doesn't use the FileX-system. It's working with own block oriented functions direct on the media. Off course changes of the file-system by the PC will not recognised by FileX until a reopen. And this doesn't explain why after initialisation of the USB-devices not even a response on a simple ping-request happens.
Hi adboc,thanks for the hints.The receive interrupt for the network is always processed. But stepping trough the processes I found, that the allocation of an new packet from the packetpool fails after initialization of the USB.Before USB-initialization the packet_pool_id is 1346454347 (I guess this is equal to NC_PACKET_POOL_ID [I nowhere found a declaration for this]) and so the allocation process is continued.
Immediately after initialization of the USB-device the packet_pool_id changes to a randomly value and stay so for all following calls. All other values in the pointer are destroyed too. So there is no packet processed from now on because the allocation for a new packet fails with a pointer error (0x07).
Can it be a stack problem?
In reply to garyj:
thanks for the hint.
The USBX Pool Memory already was by 32kB. I increased it to 64kB with the same issue. Also increasing the stack size of the USB Stack from 8192 to 16384 didn't solve the behaviour. Always immediately after initialization of the USBX Device Control Driver with ux_dcd_initialize() the Pool Pointer Structure of the Network Thread was destroyed and the packet allocation failed.