2021-03-09 09:40 PM
An existing project runs on STM32F091, it use CMSIS USART driver (ARM_DRIVER_USART Driver_USART1). Now I need to migrate this project to run on STM32G070. But in CubeMX for STM32G070, there aren't any USART driver under CMSIS driver, except a header file for customary implementation. So what is the best way to migrate UART functionality? Do I need to implement a similar CMSIS USART driver for G0 series? (CMSIS should be easier for migration, now it seems to cause more trouble.)
Solved! Go to Solution.
2021-03-16 01:10 PM
The HAL is broken and almost useless because of flawed API design. Sadly CMSIS drivers are also based on HAL. They are kind of more stable, because they are stuffed full with workarounds for the broken HAL, but I doubt the HAL "lock" and other race conditions are fixed. And even if it is, the API is still the dumb receive-stop-receive design. Therefore continuous stream reception is not possible.
Just make your own sane implementation. One can base it on or at least get inspired by this:
https://github.com/MaJerle/stm32-usart-uart-dma-rx-tx
It even has an example for G0.
2021-03-09 11:49 PM
> CMSIS USART driver (ARM_DRIVER_USART Driver_USART1)
Where do you have it from?
JW
2021-03-10 05:02 PM
Right, I enabled the driver in "manage run time environment" in keil, not CubeMX.
So, it was keil who implement the CMSIS USART driver for ST MCUs... Oh.. I feel like ordering a McChicken in KFC
2021-03-11 04:31 AM
> Oh.. I feel like ordering a McChicken in KFC
:D
Please select your post as Best so that the thread is marked as Solved.
JW
2021-03-11 01:49 PM
w/Nacho Fries?
2021-03-12 02:04 AM
Also update your cross-post on the Keil forum, and mark the solution there:
2021-03-15 03:26 AM
This problem is still not solved. I learned that it is not ST who implements CMSIS UART driver, but it doesn't mean the problem is solved.
It would be solved if someone help point out 1) here's the CMSIS UART driver for STM32G0 series. or 2) The driver is not available, the best way is ....
2021-03-15 05:08 AM
So when it is resolved, remember to update both threads.
2021-03-15 11:44 AM
Apparently, 2.
There's no best way. Options may include:
- rewrite the program from scratch to avoid using said driver
- port the driver yourself
- find somebody who will port it for you
- try to contact Keil directly and ask this question there
- try to contact ST directly (maybe through web support form) and ask this question there.
JW
2021-03-15 12:05 PM
How hard can it be?
Port the portions of the driver you actually need to the new platform, or code your own minimal abstraction layer, or hire a coder who can.
If you have a support contract with Keil, submit against that.