Page 1 of 3
STM32F411 support
Posted: Fri Aug 08, 2014 8:54 am
by lilvinz
Hi,
are there any plans regarding support of the new STM32F411?
There is a NUCLEO board with that chip available already.
I would volunteer to add support as soon as the reference manual is out officially.
Cheers,
Vincent
Re: STM32F411 support
Posted: Fri Aug 08, 2014 9:08 am
by Giovanni
The plan is to support all of them

Any help is welcome of course.
Giovanni
Re: STM32F411 support
Posted: Mon Aug 11, 2014 5:45 pm
by lilvinz
Very good plan

I have requested the reference manual from our distributor...
Cheers,
Vinz
Re: STM32F411 support
Posted: Mon Sep 08, 2014 7:33 pm
by lilvinz
Finally the reference manual has been released.
It seems there is not much relevant difference between the 401 and the 411.
- The F411 has SPI5, which the F401 doesn't.
- The F411 clock can be up to 100 MHz
- The F411 has 128 KiB of SRAM
ST hasn't released the standard peripheral driver library for F411 so that looks like time to update to the "cube" thing.
They have split up the device headers. How do you plan to proceed with that?
Follow ST and split up headers or wait for the combined header to get updated?
Cheers,
Vinz
Re: STM32F411 support
Posted: Mon Sep 08, 2014 7:40 pm
by Giovanni
We need the CMSIS-style header because the drivers depend on that. Using a different system would be too much rework and the "cube thing" does not support all devices yet.
Giovanni
Re: STM32F411 support
Posted: Mon Sep 08, 2014 8:07 pm
by lilvinz
The cube software includes CMSIS style headers.
e.g.
Code: Select all
* @file stm32f411xe.h
* @author MCD Application Team
* @version V2.1.0
* @date 19-June-2014
* @brief CMSIS STM32F411xExx Device Peripheral Access Layer Header File.
Its just split up to several files where stm32f2xx.h and stm32f4xx.h are just switches depending on the defined chip:
Code: Select all
/STM32Cube_FW_F2_V1.1.0/Drivers/CMSIS/Device/ST/STM32F2xx/Include//stm32f2xx.h
/STM32Cube_FW_F2_V1.1.0/Drivers/CMSIS/Device/ST/STM32F2xx/Include//stm32f205xx.h
/STM32Cube_FW_F2_V1.1.0/Drivers/CMSIS/Device/ST/STM32F2xx/Include//stm32f207xx.h
/STM32Cube_FW_F2_V1.1.0/Drivers/CMSIS/Device/ST/STM32F2xx/Include//stm32f215xx.h
/STM32Cube_FW_F2_V1.1.0/Drivers/CMSIS/Device/ST/STM32F2xx/Include//stm32f217xx.h
/STM32Cube_FW_F4_V1.3.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include//stm32f4xx.h
/STM32Cube_FW_F4_V1.3.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include//stm32f401xc.h
/STM32Cube_FW_F4_V1.3.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include//stm32f401xe.h
/STM32Cube_FW_F4_V1.3.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include//stm32f405xx.h
/STM32Cube_FW_F4_V1.3.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include//stm32f407xx.h
/STM32Cube_FW_F4_V1.3.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include//stm32f411xe.h
/STM32Cube_FW_F4_V1.3.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include//stm32f415xx.h
/STM32Cube_FW_F4_V1.3.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include//stm32f417xx.h
/STM32Cube_FW_F4_V1.3.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include//stm32f427xx.h
/STM32Cube_FW_F4_V1.3.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include//stm32f429xx.h
/STM32Cube_FW_F4_V1.3.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include//stm32f437xx.h
/STM32Cube_FW_F4_V1.3.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include//stm32f439xx.h
I could try switching over to those and applying the ChibiOS related fixes if they have not been fixed upstream yet.
I think they slightly changed the chip defines so i would try to preserve backwards compatibility using the preprocessor.
What do you think?
Cheers,
Vinz
Re: STM32F411 support
Posted: Mon Sep 08, 2014 8:14 pm
by Giovanni
I see, I'll have to evaluate the impact on the HAL, I am worried we will be again in a bug fixes cycle after 3.0 reached already a good stability.
Giovanni
Re: STM32F411 support
Posted: Mon Sep 08, 2014 8:24 pm
by lilvinz
Just to be clear: They changed these constants, not any register stuff:
Code: Select all
/* Uncomment the line below according to the target STM32 device used in your
application
*/
#if !defined (STM32F405xx) && !defined (STM32F415xx) && !defined (STM32F407xx) && !defined (STM32F417xx) && \
!defined (STM32F427xx) && !defined (STM32F437xx) && !defined (STM32F429xx) && !defined (STM32F439xx) && \
!defined (STM32F401xC) && !defined (STM32F401xE) && !defined (STM32F411xE)
/* #define STM32F405xx */ /*!< STM32F405RG, STM32F405VG and STM32F405ZG Devices */
/* #define STM32F415xx */ /*!< STM32F415RG, STM32F415VG and STM32F415ZG Devices */
/* #define STM32F407xx */ /*!< STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG and STM32F407IE Devices */
/* #define STM32F417xx */ /*!< STM32F417VG, STM32F417VE, STM32F417ZG, STM32F417ZE, STM32F417IG and STM32F417IE Devices */
/* #define STM32F427xx */ /*!< STM32F427VG, STM32F427VI, STM32F427ZG, STM32F427ZI, STM32F427IG and STM32F427II Devices */
/* #define STM32F437xx */ /*!< STM32F437VG, STM32F437VI, STM32F437ZG, STM32F437ZI, STM32F437IG and STM32F437II Devices */
/* #define STM32F429xx */ /*!< STM32F429VG, STM32F429VI, STM32F429ZG, STM32F429ZI, STM32F429BG, STM32F429BI, STM32F429NG,
STM32F439NI, STM32F429IG and STM32F429II Devices */
/* #define STM32F439xx */ /*!< STM32F439VG, STM32F439VI, STM32F439ZG, STM32F439ZI, STM32F439BG, STM32F439BI, STM32F439NG,
STM32F439NI, STM32F439IG and STM32F439II Devices */
/* #define STM32F401xC */ /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */
/* #define STM32F401xE */ /*!< STM32F401CD, STM32F401RD, STM32F401VD, STM32F401CE, STM32F401RE and STM32F401VE Devices */
/* #define STM32F411xE */ /*!< STM32F411CD, STM32F411RD, STM32F411VD, STM32F411CE, STM32F411RE and STM32F411VE Devices */
#endif
Re: STM32F411 support
Posted: Mon Sep 08, 2014 8:34 pm
by Giovanni
I understood that, the macro names are a bit different (again.... it is like the third time now...).
In current headers are:
Code: Select all
#if !defined (STM32F40_41xxx) && !defined (STM32F427_437xx) && !defined (STM32F429_439xx) && !defined (STM32F401xx)
/* #define STM32F40_41xxx */ /*!< STM32F405RG, STM32F405VG, STM32F405ZG, STM32F415RG, STM32F415VG, STM32F415ZG,
STM32F407VG, STM32F407VE, STM32F407ZG, STM32F407ZE, STM32F407IG, STM32F407IE,
STM32F417VG, STM32F417VE, STM32F417ZG, STM32F417ZE, STM32F417IG and STM32F417IE Devices */
/* #define STM32F427_437xx */ /*!< STM32F427VG, STM32F427VI, STM32F427ZG, STM32F427ZI, STM32F427IG, STM32F427II,
STM32F437VG, STM32F437VI, STM32F437ZG, STM32F437ZI, STM32F437IG, STM32F437II Devices */
/* #define STM32F429_439xx */ /*!< STM32F429VG, STM32F429VI, STM32F429ZG, STM32F429ZI, STM32F429BG, STM32F429BI,
STM32F429NG, STM32F439NI, STM32F429IG, STM32F429II, STM32F439VG, STM32F439VI,
STM32F439ZG, STM32F439ZI, STM32F439BG, STM32F439BI, STM32F439NG, STM32F439NI,
STM32F439IG and STM32F439II Devices */
/* #define STM32F401xx */ /*!< STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB and STM32F401VC Devices */
#endif
Giovanni
Re: STM32F411 support
Posted: Mon Sep 08, 2014 11:46 pm
by lilvinz
Hi,
this is the result so far:
https://github.com/lilvinz/ChibiOS-RT/commits/stm32f411Works on NucleoF411 board.
Also note the bug i discovered while editing F4 hal_lld.h:
https://github.com/lilvinz/ChibiOS-RT/c ... c6e3fa3cfbAltogether i'd say F4 hal_lld.h needs an overhaul.
There seems to be some stuff which is just wrong e.g. HAS_ADC2 and HAS_ADC3 is true for all F4 chips.
Let me know what you think about this approach.
Cheers,
Vincent