Current version of stm32f4xx.h is v1.2.1 and the latest one is v2.4.1.
I updated it to latest Firmware Package supplied by ST.
There was two issues for pulling request.
1. How could I include CPU information when compiling?
In new stm32f4xx.h, there's macro like below.
I thought if I would put "#define STM32F411xE 1" to platform_selector.h in solution, it would have worked.
But it didn't. So temporarily I put it to stm32f4xx_hal_conf.h. But it's wrong way. How can I give the CPU information to stm32f4xx.h in the propery way?
stm32f4xx.h
#if defined(STM32F405xx)
#include "stm32f405xx.h"
...
#elif defined(STM32F411xE)
#include "stm32f411xe.h"
...
#else
#error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
#endif
2. Depending on the CPU, the number of IO is different. How can I give that information?
For example, STM32F411xE doesn't have SPI6. So After updating stm32f4xx.h, when I compiled, I got error in STM32F4_SPI_functions.cpp. Because it doesn't have SPI6 definition.
So I handled like below.
In the case of USB, STM32F411xE doesn't support HS. so I handled similarly.
Will it be the right approach? Can you suggest more standardized method?
// enable USB clock
if( STM32F4_USB_IS_HS( Controller ) )
{ // HS on AHB1
#if !defined(STM32F411xE)
RCC->AHB1ENR |= RCC_AHB1ENR_OTGHSEN;
// this is needed to enable the FS phy clock when the CPU is sleeping
RCC->AHB1LPENR &= ~RCC_AHB1LPENR_OTGHSULPILPEN;
#endif
}
else
{ // FS on AHB2
RCC->AHB2ENR |= RCC_AHB2ENR_OTGFSEN;
}
Current version of stm32f4xx.h is v1.2.1 and the latest one is v2.4.1.
I updated it to latest Firmware Package supplied by ST.
There was two issues for pulling request.
1. How could I include CPU information when compiling?
In new stm32f4xx.h, there's macro like below. I thought if I would put "#define STM32F411xE 1" to platform_selector.h in solution, it would have worked. But it didn't. So temporarily I put it to stm32f4xx_hal_conf.h. But it's wrong way. How can I give the CPU information to stm32f4xx.h in the propery way?
stm32f4xx.h
2. Depending on the CPU, the number of IO is different. How can I give that information?
For example, STM32F411xE doesn't have SPI6. So After updating stm32f4xx.h, when I compiled, I got error in STM32F4_SPI_functions.cpp. Because it doesn't have SPI6 definition. So I handled like below. In the case of USB, STM32F411xE doesn't support HS. so I handled similarly. Will it be the right approach? Can you suggest more standardized method?
STM32F4_SPI_functions.cpp
STM32F4_usb_functions.cpp