yoneken / rosserial_stm32

This is a part of [rosserial](https://github.com/ros-drivers/rosserial) repository to communicate with ROS system through a USART for STM32 embedded system.
BSD 2-Clause "Simplified" License
218 stars 72 forks source link

how to add another STM32 Board #45

Open ghost opened 1 year ago

ghost commented 1 year ago

define STM32F3xx // Change for your device

ifdef STM32F3xx

include "stm32f3xx_hal.h"

include "stm32f3xx_hal_uart.h"

endif / STM32F3xx /

ifdef STM32F4xx

include "stm32f4xx_hal.h"

include "stm32f4xx_hal_uart.h"

endif / STM32F4xx /

ifdef STM32F7xx

include "stm32f7xx_hal.h"

include "stm32f7xx_hal_uart.h"

endif / STM32F7xx /

This a piece of code from STM32Hardware header file, how to add stm32f103 microcontroller ? please guide

ghost commented 1 year ago

I am using CubeIDE

mink007 commented 5 months ago

I am assuming you have generated the boiler plate code for your STM32 project in STM32CubeIDE.

In the STM32Hardware.h simply add these lines:

ifdef STM32F1xx

include "stm32f1xx_hal.h"

include "stm32f1xx_hal_uart.h"

endif

remove this line "#define STM32F3xx // Change for your device"