cancel
Showing results for 
Search instead for 
Did you mean: 

stm32l1xx_hal_rtc.c:424:38: error: 'RTC_CR_BKP' undeclared

Posted on May 24, 2017 at 11:06

The last driver for L1, version 1.7.0 contains this error when trying to compile projects in OpenSTM32 IDE where I replaced the HAL driver by hand. So I had to revert to 1.6.0 version.

stm32l1xx_hal_rtc.c:424:38: error: 'RTC_CR_BKP' undeclared ...

#error #driver #stm32l1 #openstm32 #170
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on May 31, 2017 at 16:08

Hi

Guta_Ciucur.Vasile

‌,

Probably this is not the correct way to update to the newversion of the driver.

-> Correct.

When a new release is available, any file could be impacted.

Thus, the safest way to upgrade your project will be to create a new project based on the new release and after that you can add your user files.

  • To be conscious about the made updates, you may always refer to the release notes provided when downloading the STM32Cube package.All impacted files are described there.

Khouloud.

View solution in original post

8 REPLIES 8
Khouloud GARSI
Lead II
Posted on May 24, 2017 at 16:51

Hi

Guta_Ciucur.Vasile

‌,

Could you please specify the STM32L1 device that you are using.

Khouloud.

Khouloud GARSI
Lead II
Posted on May 24, 2017 at 18:37

Hi

Guta_Ciucur.Vasile

‌,

The RTC_CR_BKP is defined in the 'stm32l152xe.h' file;

Please make sure that this file is correctly inserted.

Khouloud

Posted on May 24, 2017 at 17:38

I use the Nucleo L152RE board and these are my OpenSTM32 projects I use with

https://github.com/funlw65/my_nucleo_l152re

  All projects compile just fine with the 1.6.0 version of the HAL driver.
Posted on May 24, 2017 at 19:04

Thank you

garsi.khouloud

‌, the problem is, right now I don't need the RTC peripheral, I don't use it in any of the projects I started. With the 1.6.0 version the projects compile just fine, with the 1.7.0 version, the compiler complains at the beginning of the library compilation (the library is compiled first), it does not reaches the files of the project. I suspect you guys will be contacted by the OpenSTM32 team, to signal this problem. Right now, they still provide the 1.6.0 version of the STM32L1 driver. It may be their problem, it may be yours (ST)... will see.

Posted on May 25, 2017 at 13:03

Hi

Guta_Ciucur.Vasile

‌,

Creating projects with OpenSTM32 and generating the pin configuration with STM32CubeMX.

Is the compilation error encountered after generating the code using CubeMX tool or after adding your own modification to the project.

Could you please share your ioc file for further check.

Khouloud.

Posted on May 26, 2017 at 00:11

The OpenSTM32 IDE creates a library project in the Workspace, named

'nucleo-l152re_hal_lib' (a library that will be linked to any of the

project you create with the IDE and tune with the CubeMX).

There is a subfolder named 'HAL_Driver' which contains other two subfolders

named 'Inc' and 'Src'.

If I manually replace these two subfolders with the ones contained in the

'STM32Cube_FW_L1_V1.7.0' repository, I get that error. And it won't work

until I overwrite them with the folders from 'STM32Cube_FW_L1_V1.6.0'

repository. Probably this is not the correct way to update to the new

version of the driver.

This library project can be compiled stand-alone, without involving any of

the projects already created or new ones. With the current version it trows

the error. With the previous version, it compiles just fine. Again, the way

I 'upgraded' the driver, is probably not the way of upgrading it.

On Thu, May 25, 2017 at 2:04 PM, Khouloud G <st-microelectronics@jiveon.com>

Posted on May 28, 2017 at 00:21

Ah. I see now. The stm32l152xe.h header file from version 1.7.0 is not

identical with the one from 1.6.0 version (although, I thought the

definitions in a device header file won't change as Microchip is doing with

their device headers almost at every new version of their Mplab X IDE).

That is what you had to tell me...

So, it is not enough to replace only the HAL drivers, you have to also

replace the CMSIS drivers...

It wasn't hard... Guys, you really have to be connected with the OpenSTM32

team... to know and supervise what they are doing as there are the majority

of the programmers and students, working with free toolchains.

Thank you for the clue anyway!

Posted on May 31, 2017 at 16:08

Hi

Guta_Ciucur.Vasile

‌,

Probably this is not the correct way to update to the newversion of the driver.

-> Correct.

When a new release is available, any file could be impacted.

Thus, the safest way to upgrade your project will be to create a new project based on the new release and after that you can add your user files.

  • To be conscious about the made updates, you may always refer to the release notes provided when downloading the STM32Cube package.All impacted files are described there.

Khouloud.