cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F446ZE MDK-ARM uv4 project with Std Peripheral Library

stephengoodman9179
Associate II
Posted on May 16, 2017 at 02:54

stm32f4xx_rcc.c(2729): error:

 

#20: identifier 'RCC_BDCR_LSEMOD' is undefined

Does anyone have a good CDB file or the Device data/text for the STM32F446xxx MCU?

I have an MDK-ARM uVision v4 project which was made for the STM32F405/407 in 2012. It was made with the 'DSP and Standard Peripherals Library�?, (“SPL�?) v1.01.  I have been able to rebuild it using the ARM Keil MDK/uVision which works fine, and I've managed to do that with both uVision v 4.72 and with v 5.23 (which is current). Next, I need to retarget it to the STM32F446 MCU.

I can also spontaneously create this problem if I go into Cube MX, generate the code in a MDK-ARM uv4-format project. Note that I'm not needing to Build... Just to go to see that the MCU I want is targetted. Indeed, when I do this for the STM32F446ZE, then open the project in uVision 5, I get an error alert on the screen: 

It says:

 

“The Project references devices, files or libraries that are not installed. Download and Install:  Third Party Device Support for ‘STMicroelectronics: STM32F446ZE’ (Device not included in Legacy Device Database)�?

The SPL v 1.0.1 was released well before the the STM32F446 was introduced. ST released support for it in their SPL v1.5 in mid 2015,.

 

Now the SPL is v1.8.0 from Nov. 2016. The SPL will support the STM32F446ZE.

I’m under the impression that in uVision, (4 or 5) I need to set the Target Device to the STM32F446ZE. But it doesn’t exist in the Device Database. I can add it with either a CDB file which contains data about its characteristics, or I can manually enter the text data in a GUI.

To change the target 'Device' in uVision: If I use uVision v5.23, its support for the STM32F446 comes from the Device Family Pack for STM32F4 Series, v2.11.0 (2016-12-07); it's a 'DFP' or 'Pack'. Unfortunately, selecting the STM32F446ZETx from the DFP brings with it the forcing of the Pack's CubeF4 Libraries. By my understanding the Cube Libraries/HAL/LL BREAK the SPL. Indeed, the Build-All which works fine with the previously-selected v4 Device selection: STM32F407,  FAILS due to the Cube libraries' inclusion. None of the normal places to go in the project options, group, or file options can GET RID OF the includes for the Cube libraries.

Under the hood, uVision v5 actually has TWO DATABASES for 'Devices'.  The newest and current one is built around the DFP's or Packs. Then there is the earlier database which is still supported for the Devices which come along from v4. The very highest numbered STM32F4 series MCU that is included is the STM32F439. I did some web searching and found an article which said that I could get support for the STM32F446 under the older system by adding their 'Legacy Cortex-M4 Support'. This is supposed to add to the Device Database a number of MCU's which are newer than what MDK-ARM v4 included when it was released. But even after doing this there was no Device in the database for the STM32F446.

From that point I went on to read other articles about how you can add support for new Devices to the v4-style, older Device Database either with a CDB file you find from someone, or create interactively in a GUI the new Device. I followed these procedures to make a Device for STM32F446ZETx, based on the STM32F405 with certain changes which seemed obvious. I gave it all a go, doing Build All (but still with the SPL v1.0.1), and the results were positive. But I don't have confidence yet in the Device I defined/created for the STM32F446ZETx.  I'd far prefer to find an official one which is more likely to be correct than mine.

I started hunting. The release notes for the current SPL v1.8.0 indicate that when the first support for the STM32F446 was released, it was in SPL version 1.5.0 in March, 2015.

 

There is an interesting remark there which says, “

A software patch is needed to use STM32F446xx devices with MDK-ARM V5.13. If you do not have this patch installed, you can install it from the following folder '\Utilities\Third_Party\Toolchains_STM32F446xx_Patches\STM32F446_MDK-ARM_Support.7ip'

   

I’d like to look in that SPL v1.5 download, but it’s unavailable as far as I (and google) are concerned, and whatever was in that file may or may not have been the Device CDB file or data I wanted.

Does anyone have a good CDB file or the Device data/text for the STM32F446xxx MCU?

I’ve taken a shot at creating one, here it is. I’ve based it on the entries I was able to retrieve out of the both the ‘405 and ‘446 out of the ARM Keil MDK, the ‘405 in the old Device Database, and extrapolated to the ‘446. But again, I’d rather have a good one than make my own.

Here is the entry I came up with for the Device Database.

PROPOSED STM32F446 Device Database for Keil MDK uVision v4  (ADAPTED FROM '405)

BOOK0=DATASHTS\ST\STM32F4xx\DM00037051.pdf('Datasheet')

BOOK1=DATASHTS\ST\STM32F4xx\DM00031020.pdf('Reference Manual')

BOOK2=datashts\arm\cortex_m4\r0p1\DDI0439C_CORTEX_M4_R0P1_TRM.PDF('Technical Reference Manual')

BOOK3=datashts\arm\cortex_m4\r0p1\DUI0553A_CORTEX_M4_DGUG.PDF('Generic User Guide')

CMISC=-DSTM32F40_41xxx

CPU=IRAM(0x20000000-0x2001FFFF) IROM(0x8000000-0x80EFFFF) CLOCK(25000000) CPUTYPE('Cortex-M4') FPU2

FLDLL=UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_512 -FS08000000 -FL0080000)

MON=SARMCM3.DLL('-MPU') TCM.DLL('-pCM4')

REGFILE=stm32f4xx.h('ST\STM32F4xx')

SFILE='Startup\ST\STM32F4xx\startup_stm32f40_41xxx.s' ('STM32F40/41xxx Startup Code')

SIM=SARMCM3.DLL('-MPU -REMAP') DCM.DLL('-pCM4')

SVD=SFD\ST\STM32F4xx\STM32F40x.sfr

0 REPLIES 0