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

Ux_Device_CDC_ACM example Hardfault on high load #49

Open
HiFiPhile opened this issue Apr 23, 2024 · 5 comments
Open

Ux_Device_CDC_ACM example Hardfault on high load #49

HiFiPhile opened this issue Apr 23, 2024 · 5 comments
Assignees
Labels
bug Something isn't working internal bug tracker Issue confirmed and logged into the internal bug tracking system projects Projects-related (demos, applications, examples) issue or pull-request. usb Universal Serial Bus
Milestone

Comments

@HiFiPhile
Copy link

Describe the set-up

SDK Version: f0f0631
Board: NUCLEO-U5A5ZJ-Q
Compiler: IAR 9.50.1

Describe the bug (skip if none)

I'm a TinyUSB project maintainer, my planning was to compare the CDC throughput performance between usbx with a modified Ux_Device_CDC_ACM echo example.

But even without modification Ux_Device_CDC_ACM runs into hardfault on high load, tx_byte_pool_buffer overflowed and destroy all variables around. If I increase TX_APP_MEM_POOL_SIZE from 1k to 8k it crashes little later.

With attached serial testing script, crash happens about after 10 OUT transfers:

image

How to reproduce the bug (skip if none)

  1. Compile Ux_Device_CDC_ACM project.
  2. Use attached script, eg. ser_test.py COM4

ser_test.py.txt

@ALABSTM ALABSTM self-assigned this Apr 25, 2024
@ALABSTM ALABSTM added bug Something isn't working projects Projects-related (demos, applications, examples) issue or pull-request. usb Universal Serial Bus labels Apr 25, 2024
@ALABSTM
Copy link
Contributor

ALABSTM commented May 2, 2024

Hello @HiFiPhile,

Thank you for this report. It will be forwarded to our development teams. I will keep you informed.

With regards,

@ALABSTM ALABSTM added the internal bug tracker Issue confirmed and logged into the internal bug tracking system label May 2, 2024
@ALABSTM
Copy link
Contributor

ALABSTM commented May 2, 2024

ST Internal Reference: 180549

@ALABSTM
Copy link
Contributor

ALABSTM commented May 7, 2024

Hi @HiFiPhile,

Our development teams acknowledged what you reported. As a workaround, their advice is to set the request data size to be 512 (HS MPS) instead of 64 when calling ux_device_class_cdc_acm_read() while keeping actual data size less than or equal to 64.

/* Read the received data in blocking mode */
ux_device_class_cdc_acm_read(cdc_acm, (UCHAR *)UserRxBufferFS, 64,
&actual_length);

With regards,

@HiFiPhile
Copy link
Author

while keeping actual data size less than or equal to 64.

Hi, it means each data packet sent from host should be less than or equal to 64 ?

@ALABSTM
Copy link
Contributor

ALABSTM commented May 7, 2024

Hi @HiFiPhile,

Hi, it means each data packet sent from host should be less than or equal to 64 ?

Yes. That's the idea.

With regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internal bug tracker Issue confirmed and logged into the internal bug tracking system projects Projects-related (demos, applications, examples) issue or pull-request. usb Universal Serial Bus
Projects
Status: In progress
Development

No branches or pull requests

2 participants