cancel
Showing results for 
Search instead for 
Did you mean: 

What's the best way to port CMSIS UART from F0 to G0

TDao.19
Associate II

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.)

1 ACCEPTED SOLUTION

Accepted Solutions
Piranha
Chief II

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.

View solution in original post

17 REPLIES 17

> CMSIS USART driver (ARM_DRIVER_USART Driver_USART1)

Where do you have it from?

JW

TDao.19
Associate II

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

> 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

w/Nacho Fries?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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 ....

So when it is resolved, remember to update both threads.

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

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..