Page 1 of 1

Backup SRAM

Posted: Tue Feb 18, 2014 6:06 pm
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'

????

Re: Backup SRAM

Posted: Tue Feb 18, 2014 6:38 pm
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 ?

Re: Backup SRAM

Posted: Tue Feb 18, 2014 6:55 pm
by Giovanni
Update to 2.6.3 by just replacing the chibios folder. That function is defined in 2.6.3.

Giovanni

Re: Backup SRAM

Posted: Wed Feb 19, 2014 1:49 pm
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 ??

Re: Backup SRAM

Posted: Wed Feb 19, 2014 2:21 pm
by Giovanni
Is the device identifier correct in board.h? the new ST header requires different identifiers.

Giovanni

Re: Backup SRAM

Posted: Wed Feb 19, 2014 3:02 pm
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 ?

Re: Backup SRAM

Posted: Wed Feb 19, 2014 3:17 pm
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

Re: Backup SRAM

Posted: Wed Feb 19, 2014 3:43 pm
by Tabulous
needed to freashen the indexing also :-)