Hi,
I have a micropython project and am hooking up a module to a uart on a STM32F MCU. I have an existing C library that uses a COM port to communicate with a module. I'd really like to reuse that library on my micropython project.
I've looked through the lower level "drivers" such as uart.c and machine_uart.c as templates however whenever I attempt to compile and link them with my library I get way too many errors mostly from include and paths.
Is there a higher level abstracted uart.c module that can directly communicate with the STM32 MCU within the micropython build environment that I can link/use?
My interface from my library will have a micropython interface so I believe I have that covered.
Any help or pointers would be greatly appreciated.
Thanks in advance for any and all assistance.
Higher level UART library that my ARM code can link to?
-
- Posts: 7
- Joined: Mon Oct 26, 2020 6:26 pm
Re: Higher level UART library that my ARM code can link to?
uart.h is the only interface to the UART library.
You could also use the UART code that comes with the HAL.
The various STM32 HAL: libraries can be found here: https://github.com/micropython/stm32lib ... d3a7f401ad
You'll need to pick whichevery directories are appropriate for the particular processor you're using. The HAL: libraries will require headers from CMSIS, which can be found in the CMSIS directory (from the HAL) and also here: https://github.com/micropython/micropyt ... /cmsis/inc
As far as include paths, you'll need to reference the cmsis/inc, and the stm32lib/CMSIS/PROCESSOR_FAMILY and the stm32lib/PROCESSOR_FAMILY_HAL_Driver/inc directories, along with the py directory and the ports/stm32 directory (and possibly a couple other directories - I'd need to see the exact errors that you're running into).
You could also use the UART code that comes with the HAL.
The various STM32 HAL: libraries can be found here: https://github.com/micropython/stm32lib ... d3a7f401ad
You'll need to pick whichevery directories are appropriate for the particular processor you're using. The HAL: libraries will require headers from CMSIS, which can be found in the CMSIS directory (from the HAL) and also here: https://github.com/micropython/micropyt ... /cmsis/inc
As far as include paths, you'll need to reference the cmsis/inc, and the stm32lib/CMSIS/PROCESSOR_FAMILY and the stm32lib/PROCESSOR_FAMILY_HAL_Driver/inc directories, along with the py directory and the ports/stm32 directory (and possibly a couple other directories - I'd need to see the exact errors that you're running into).