mirror of
https://github.com/apache/nuttx.git
synced 2026-05-18 08:54:05 +08:00
Merged in david_s5/nuttx/master_h7 (pull request #1025)
stm32h7: bbsram issues causing no writes and hardfaults * stm32_pwr:Ensure data is flushed on backup domain access changes * stm32h7:bbsram convince compiler to perform 32 bit write Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
committed by
Gregory Nutt
parent
4710ec1e77
commit
a3bea40c46
@@ -334,7 +334,7 @@ static void stm32_bbsram_ecc_workaround(FAR struct bbsramfh_s *pf)
|
||||
{
|
||||
/* Force the last writes to be a a full 32 bit word */
|
||||
|
||||
pf->unit32 = (volatile uint32_t) pf->unit32;
|
||||
*((volatile uint32_t *) &pf->unit32) = (volatile uint32_t) pf->unit32;
|
||||
}
|
||||
#else
|
||||
#define stm32_bbsram_ecc_workaround()
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "barriers.h"
|
||||
#include "up_arch.h"
|
||||
#include "stm32_pwr.h"
|
||||
|
||||
@@ -151,6 +152,7 @@ void stm32_pwr_enablebkp(bool writable)
|
||||
bool wait = false;
|
||||
|
||||
flags = enter_critical_section();
|
||||
ARM_DSB();
|
||||
|
||||
/* Get the current state of the STM32 PWR control register */
|
||||
|
||||
@@ -186,13 +188,14 @@ void stm32_pwr_enablebkp(bool writable)
|
||||
wait = true;
|
||||
}
|
||||
|
||||
ARM_DSB();
|
||||
leave_critical_section(flags);
|
||||
|
||||
if (wait)
|
||||
{
|
||||
/* Enable does not happen right away */
|
||||
|
||||
up_udelay(4000);
|
||||
up_udelay(4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user