2022-04-08 12:24 PM
I've found that Nucleo-L4R5ZI and Nucleo-L476RG sometimes stop receiving UART data through the STLINK USB interface is Mass Storage type is enabled.
I created a program that echos random data sizes (send to board, board echos back). This will crash after a while on macOS if "Mass Storage" is enabled (it is fine on Windows and Linux regardless of Mass Storage option). Here is a simple MBED project and both a Python and Node application to cause the failure.
https://github.com/petertorelli/serialbreaker
The crash takes a while to happen, it is quite intermittent, and requires a full uplug/replug of the device (macOS will sometimes complain that the mass device was not removed properly).
I have another where I found the ST board can still transmit, it just cannot receive. I know this because I can reset the board with the reset button, see a boot test message, but it still won't respond to commands sent over the UART. I think the bug is in the RX path from the host to the STM board.
I've seen this on every MacOS version since Mavericks (when I first started developing). I've never seen it on Windows or Linux. I recommend anyone using the dev board in this mode to disable Mass Storage.
--Peter
Solved! Go to Solution.
2022-05-30 10:38 AM
Hello @Walid ZRELLI ,
When I went to switch the L4R5ZI back to "mass storage device" with the CubeMX programmer, it updated the STLink firmware and now that board is not failing at all.
So I switched to a L476RG.
It looks like firmware V2J37M27 fixed the problem, as I also tested on two other L476RG board and an F429ZI, and the STLink f/w update solved the crashes.
Thanks for looking into this, I appreciate the support!
Peter
2022-04-26 05:23 AM
Hello @Community member ,
In order to allow a better analysis of this issue, Could you please provide your UART configuration and your project to reproduce this issue, so that we can give you an answer.
Thanks in advance.
BeST Regards,
Walid
2022-04-26 10:07 PM
Hello @Walid ZRELLI ,
I added a CubeMX project to my repo (minus the drivers) and the IOC file for a Nucleo L4R5ZI.
https://github.com/petertorelli/serialbreaker/tree/main/firmware/cubemx/NUCLEO-L4R5ZI
I wrote the code for the MLPerf Tiny firmware framework based on this board, and a number of people encountered the same problem with ST boards but only on macOS. I believe I root caused it to the issue I submitted, but I please try the "breaker" Node/Python code in the repo. E.g.:
% python3 main.py /dev/<portname>
It should run for a while then hang (usually a few minutes). DIsable Mass Storage with the STLink firmware update and it runs overnight. I've seen this issue on multiple macs and os versions.
Thanks,
Peter
2022-05-16 11:38 AM
Hello Walid,
Were you able to reproduce the problem?
Peter
2022-05-17 02:02 AM
Hello @Community member ,
This issue is under investigation. I will keep you updated as soon as possible.
BeST Regards,
Walid
2022-05-17 02:03 AM
Internal ticket number: 128440 (PS: This is an internal tracking number and is not accessible or usable by customers)
2022-05-18 08:17 AM
Hello @Community member ,
Could you please try removing the locking mechanism (__HAL_LOCK()/__HAL_UNLOCK() )from the HAL_UART_Transmit_IT/Receive_IT() APIs and let me know if this solved your problem?
Thanks in advance.
BeST Regards,
Walid
2022-05-20 01:47 AM
Hello @Community member
Is there any news from your side?
BeST Regards,
Walid
2022-05-21 09:50 AM
Hello @Walid ZRELLI
I didn't have time to test last week, I will apply your suggestion shortly. Thanks for the follow up!
Peter
2022-05-30 10:38 AM
Hello @Walid ZRELLI ,
When I went to switch the L4R5ZI back to "mass storage device" with the CubeMX programmer, it updated the STLink firmware and now that board is not failing at all.
So I switched to a L476RG.
It looks like firmware V2J37M27 fixed the problem, as I also tested on two other L476RG board and an F429ZI, and the STLink f/w update solved the crashes.
Thanks for looking into this, I appreciate the support!
Peter