-
Notifications
You must be signed in to change notification settings - Fork 978
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
STM32F10xx Serial bus fault on large data #1399
Comments
Hi @chrysophylax I will try to correct this issue but not so easy. One workaround could be to increase the buffer size.
|
Definitely hoping for a fix here 😔 |
Is there a workaround for this? |
But size depends on your needs, depends on your application, so it is up to you to implement it:
|
What's the recommended maximum value, and do I just replace the value in the library for the board? I can tune it down from there if I can at least try it out without it panicking. |
There is not recommended value, as it depends on application. Up to you to test. |
What's the maximum? And what are the side effects? Is it possible to brick the board this way or enter a state where it can't be reflashed? |
I changed the multiplier from |
|
How quickly does this get cleared? What's the effective RX rate? |
It depends of several stuff. Host PC, user application, .... The main issue here is when there is no more space in the Rx buffer the USB should stop transfer until a free room is available. |
this is kind of 'off-topic', under bulk transfer section, under 'OUT' As for the sketch sending data to the host. i'd think it'd be necessary to check either way, it seemed quite possible for a 'dead lock' situation to happen. |
With this bug I can't use a newer core than 1.9.0 Is there another way, than increase CDC_RECEIVE_QUEUE_BUFFER_SIZE in in the library? Arduino_Core_STM32/cores/arduino/stm32/usb/cdc/cdc_queue.h |
Currently not as the fix is not so simple to deploy. |
Is there a way to increase CDC_RECEIVE_QUEUE_BUFFER_SIZE without change a file in the core? |
No |
at the moment, i'd suggest this as a partial solution, you could copy the relevant codes for the usb stack etc and perhaps place that in the sketch folder etc. it may take editing the codes. and omit selecting usb-cdc if you are using that particular set of things in the stack. there are some occasions like SPI etc where I need some custom functionalities i'd do that. for SPI i simply omit the library and copy the SPI library codes into the sketch folder and make a custom SPI driver |
I had this same issue show up for me when upgrading the core from a November 2022 version to now. SerialUSB communications simply stopped working after sending a lot of data from the PC. I can confirm that increasing the size of CDC_RECEIVE_QUEUE_BUFFER_PACKET_NUMBER fixes it (setting it to 20 in my case!!) But this uses a lot of RAM, which did not used to be the case in the older core. Was there some kind of flow control that was removed? |
Describe the bug
When sending large amounts of data over Serial Monitor (string len > 204 ), the processor enters a hard fault.
Hard fault status register (SCB_HFSR) 0xE000ED2C has bit 30 set to 1 (FORCED: Forced hard fault, 1: Forced hard fault.)
Configurable fault status register (SCB_CFSR) 0xE000ED28 has bit 10 set to 1 (IMPRECISERR: Imprecise data bus error)
To Reproduce
On the latest 2.0.0 core
Expected behavior
The text is written back in the Serial monitor.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Board (please complete the following information):
Additional context
I have bisected this git repository and identified the issue as originating in commit 00acff6 by @fpistm which updated the HAL Drivers to v1.1.5 for STM32f1xx. The commit before 242671d using HAL v1.1.4 works perfectly as expected.
I attach three screenshots showing the hard fault, the frozen serial monitor, and the working behaviour.
The text was updated successfully, but these errors were encountered: