jhugon / ascii-serial-com

Serial communication library between computers and microcontrollers, FPGAs, etc. Uses only ASCII
GNU General Public License v3.0
0 stars 0 forks source link

Add STM32 Examples #23

Closed jhugon closed 2 years ago

jhugon commented 2 years ago

Probably want to use STM32F091 first

Use libopencm3. Maybe difficult to integrate with build system. Could start with libopencm3 as a git sub repo?

https://github.com/libopencm3/libopencm3 https://github.com/libopencm3/libopencm3-examples

jhugon commented 2 years ago

Maybe these make files can help https://github.com/libopencm3/libopencm3/tree/master/mk

jhugon commented 2 years ago

Instead, maybe could use linker script from opencm3 with driver lib from https://github.com/STMicroelectronics/STM32Cube_MCU_Overall_Offer

It looks like an assembler script that sets up the interrupts from the ST examples would be useful too

jhugon commented 2 years ago

ST provides linker and assembler startup script here: https://github.com/STMicroelectronics/STM32CubeF0/tree/master/Projects/STM32F091RC-Nucleo/Templates/SW4STM32

not sure how easy that will be to get working

jhugon commented 2 years ago

Having trouble with UART loopback, and the board makes it difficult to check with a scope/logic-analyzer b/c the UART isn't connected to any pins. You have to solder a jumper!

jhugon commented 2 years ago

Atomic ops: https://libopencm3.org/docs/latest/stm32l1/html/group__CM3__cortex__atomic__defines.html

jhugon commented 2 years ago

Usart interrupt example: https://github.com/libopencm3/libopencm3-examples/blob/master/examples/stm32/f4/stm32f429i-discovery/usart_irq/usart_irq.c