Backup SRAM

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Backup SRAM

Post by Tabulous »

Looking to use backup SRAM, on F4 device, the hal_lld.c as a #if STM32_BKPRAM_ENABLE, but this is not defined anywhere, i would have thought it would be in the mcuconf.h ???

Anyways i added
#define STM32_BKPRAM_ENABLE TRUE
to my mcuconf.h and it now errors on

undefined reference to `rccEnableBKPSRAM'

????
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: Backup SRAM

Post by Tabulous »

got a feeling this is down to me using 2.6.1 which is package with chibistudio, where as 2.6.3 will not have this issue ?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Backup SRAM

Post by Giovanni »

Update to 2.6.3 by just replacing the chibios folder. That function is defined in 2.6.3.

Giovanni
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: Backup SRAM

Post by Tabulous »

Giovanni wrote:Update to 2.6.3 by just replacing the chibios folder. That function is defined in 2.6.3.

Giovanni


I did this

but you then get lots of errors in the hal_lld.h and this come back to this in stm32.h error is "STM32 device not specified"

#if defined(STM32F030) || defined(STM32F0XX_LD) || \
defined(STM32F0XX_MD)
#include "stm32f0xx.h"

#elif defined(STM32F10X_LD_VL) || defined(STM32F10X_MD_VL) || \
defined(STM32F10X_HD_VL) || defined(STM32F10X_LD) || \
defined(STM32F10X_MD) || defined(STM32F10X_HD) || \
defined(STM32F10X_XL) || defined(STM32F10X_CL) || \
defined(__DOXYGEN__)
#include "stm32f10x.h"

#elif defined(STM32F2XX)
#include "stm32f2xx.h"

#elif defined(STM32F30X)
#include "stm32f30x.h"

#elif defined(STM32F37X)
#include "stm32f37x.h"

#elif defined(STM32F401xx) || defined(STM32F40_41xxx) || \
defined(STM32F427_437xx) || defined(STM32F429_439xx)
#include "stm32f4xx.h"

#elif defined(STM32L1XX_MD)
#include "stm32l1xx.h"

#else
#error "STM32 device not specified"
#endif


It seems to me all these have been changed from 2.6.1 to 2.6.3 ??
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Backup SRAM

Post by Giovanni »

Is the device identifier correct in board.h? the new ST header requires different identifiers.

Giovanni
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: Backup SRAM

Post by Tabulous »

the board identifier is

#define STM32F4XX

which i ok for the older 2.6.1 stm32.h see below

#if defined(STM32F0XX)
#include "stm32f0xx.h"

#elif defined(STM32F10X_LD_VL) || defined(STM32F10X_MD_VL) || \
defined(STM32F10X_HD_VL) || defined(STM32F10X_LD) || \
defined(STM32F10X_MD) || defined(STM32F10X_HD) || \
defined(STM32F10X_XL) || defined(STM32F10X_CL) || \
defined(__DOXYGEN__)
#include "stm32f10x.h"

#elif defined(STM32F2XX)
#include "stm32f2xx.h"

#elif defined(STM32F30X)
#include "stm32f30x.h"

#elif defined(STM32F37X)
#include "stm32f37x.h"

#elif defined(STM32F4XX)
#include "stm32f4xx.h"

#elif defined(STM32L1XX_MD)
#include "stm32l1xx.h"

#else
#error "STM32 device not specified"
#endif

but as stated this as changed, so should my board identifier now be ?
#define STM32F40_41xxx

If so do i still also keep #define STM32F4XX ??? as there is alot of code in 2.6.3 that still uses the old identifier i.e. look in sdc_lld.h at SDIO Clock divider ?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Backup SRAM

Post by Giovanni »

You should use:

STM32F40_41xxx

In hal_lld.h there is:

Code: Select all

#if defined(STM32F429_439xx) || defined(__DOXYGEN__)
#define PLATFORM_NAME           "STM32F429/F439 High Performance with DSP and FPU"
#define STM32F4XX

#elif defined(STM32F427_437xx)
#define PLATFORM_NAME           "STM32F427/F437 High Performance with DSP and FPU"
#define STM32F4XX

#elif defined(STM32F40_41xxx)
#define PLATFORM_NAME           "STM32F407/F417 High Performance with DSP and FPU"
#define STM32F4XX

#elif defined(STM32F401xx)
#define PLATFORM_NAME           "STM32F401 High Performance with DSP and FPU"
#define STM32F4XX

#elif defined(STM32F2XX)
#define PLATFORM_NAME           "STM32F2xx High Performance"

#else
#error "STM32F2xx/F4xx device not specified"
#endif


This way the drivers don't have to check for all those identifiers.

Giovanni
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: Backup SRAM

Post by Tabulous »

needed to freashen the indexing also :-)
Post Reply