10 years, 3 months ago.

Why is DEVICE_SERIAL macro set to "0" for STM32F4XX target?

I'm trying to use mbed library to implement UART communication on my STM32F417VGT6-bases board and I found that:

1) DEVICE_SERIAL macro is set to "0" in the device.h file located in the TARGET_STM32F4XX directory of the HAL. That, as far as I understand, means that mbed developers consider there's no serial communication devices available on the STM32F4XX family at all;

2) there's no serial_api.c file in the same directory;

but

3) there is a serial_api.c file in the TARGET_STM32F4 directory of the HAL and

4) DEVICE_SERIAL is defined as "1" in every device.h file located in all subdirs of TARGET_STM32F4 directory.

What does it mean? According to STM official site there is at least 3 UARTs in any modification of STM32F4-based controller. What's the reason of setting DEVICE_SERIAL to "0" then and what should I do to comminucate via UART using mbed? And generally what is the reason of having STM32F4 and STM32F4XX directories at HAL at all? Is there any documentaion I can read about this?

I'm working under Keil uVision 5.

posted by Vasily Chernikov 26 Jun 2015

1 Answer

10 years, 3 months ago.

I noticed that before, and it looks to me like the F4XX stuff are leftover files which should be deleted. A quick check does not show any F417 target, the F4XX stuff is used only by target STM32F407. If yours should be compatible with that, there are the DISCO_F407VG and ARCH_MAX which are properly supported.