Skip to content
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

USB-NCM driver 0.17 hangs after a period of sending packets (IEC-243) #107

Open
3 tasks done
emaayan opened this issue Dec 21, 2024 · 0 comments
Open
3 tasks done
Labels
Status: Opened Issue is new Type: Bug Bug in esp-usb

Comments

@emaayan
Copy link

emaayan commented Dec 21, 2024

Answers checklist.

  • I have read the component documentation ESP-IDF Components and the issue is not addressed there.
  • I am using target and esp-idf version as defined in component's idf_component.yml
  • I have searched the issue tracker for a similar issue and not found any related issue.

Which component are you using? If you choose Other, provide details in More Information.

device/esp_tinyusb

ESP-IDF version.

5.3.1

Development Kit.

esp-s3

Used Component version.

0.17.1

More Information.

hi, i'm directly using tinyusb port from espressif , but that repo has no issues repo

if i try to use the esp_tinyusb component wrapper the tinyusb_send method would eventually fail consistently with sending this.
steps to reproduce:

  1. download and install the windows ncm driver
  2. upload the sketch
  3. when the network device is added give it a static IP 192.168.5.3 , and gateway 192.168.5.1
    esp_tusb_ncm_bug.zip

the program generates a bytes array at random lengths from 20 to 1400 and first sends the size of the byte array and the actuall byte array while the corresponding client code does the opposite

after a while it just halts in it tracks sometimes you get log error of ethernetif_input: IP input error
private static ByteBuffer getByteBuffer(InputStream inputStream, int size) throws IOException { final ByteBuffer allocate = ByteBuffer.allocate(size).order(ByteOrder.LITTLE_ENDIAN); final byte[] array = allocate.array(); final int read = inputStream.readNBytes(array,0,size);// read(array,0,size); return allocate; } public static void main(String[] args) throws IOException { String host = "192.168.5.1"; final Socket socket = SocketFactory.getDefault().createSocket(host, 19000); while (socket.isConnected()){ final InputStream inputStream = socket.getInputStream(); final ByteBuffer byteBuffer = getByteBuffer(inputStream, 4); final int sz = byteBuffer.getInt(); final byte[] bytes = inputStream.readNBytes(sz); System.out.println(sz +" " +Arrays.toString(bytes)); } }

it hangs on tud_task() , which waits indefinitely..

@emaayan emaayan added the Type: Bug Bug in esp-usb label Dec 21, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 21, 2024
@github-actions github-actions bot changed the title USB-NCM driver 0.17 hangs after a period of sending packets USB-NCM driver 0.17 hangs after a period of sending packets (IEC-243) Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new Type: Bug Bug in esp-usb
Projects
None yet
Development

No branches or pull requests

2 participants