diff options
author | edolomb <none@example.com> | 2018-03-26 10:05:03 +0000 |
---|---|---|
committer | edolomb <none@example.com> | 2018-03-26 10:05:03 +0000 |
commit | 3b2b8fc938792c5c1c9437bf4eea3562228cd457 (patch) | |
tree | a009de1c88b4ae6c9d01e53dd9ac2dd8b680e394 /os/hal/ports | |
parent | 354096a9730611e2af046273e5758c6504cac79e (diff) | |
download | ChibiOS-3b2b8fc938792c5c1c9437bf4eea3562228cd457.tar.gz ChibiOS-3b2b8fc938792c5c1c9437bf4eea3562228cd457.tar.bz2 ChibiOS-3b2b8fc938792c5c1c9437bf4eea3562228cd457.zip |
Fixed bugs
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11857 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/hal/ports')
-rw-r--r-- | os/hal/ports/SAMA/SAMA5D2x/sama_secumod.c | 6 | ||||
-rw-r--r-- | os/hal/ports/SAMA/SAMA5D2x/sama_secumod.h | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.c b/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.c index 705ed96f9..7c1039076 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.c +++ b/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.c @@ -392,7 +392,7 @@ void secSetCallback(SECDriver *secp, uint32_t sources, secumod_callback_t callba /* IRQ sources enabled only after setting up the callback.*/
secp->secumod_callback = callback;
secp->sec->SECUMOD_NIEPR = sources;
- if (SECUMOD->SECUMOD_NMPR != sources) {
+ if (SECUMOD->SECUMOD_NIMPR != sources) {
secumodToggleProtectionReg();
secp->sec->SECUMOD_NIEPR = sources;
}
@@ -510,6 +510,8 @@ uint32_t secumodReadInternalMemory(uint8_t *data, uint32_t addr, uint32_t size) if (addr >= ((uint32_t)SECURAM))
addr -= ((uint32_t)SECURAM);
+ secumodMemReady();
+
for (i = 0; i < size; i += count) {
region = (addr + i) >> 10;
if ((SECUMOD_RAMACC_RWx_NO_ACCESS(region) ==
@@ -547,6 +549,8 @@ uint32_t secumodWriteInternalMemory(uint8_t *data, uint32_t addr, uint32_t size) if (addr >= ((uint32_t)SECURAM))
addr -= ((uint32_t)SECURAM);
+ secumodMemReady();
+
for (i = 0; i < size; i += count) {
region = (addr + i) >> 10;
if ((SECUMOD_RAMACC_RWx_NO_ACCESS(region) ==
diff --git a/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.h b/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.h index d73938c4c..c96a69c18 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.h +++ b/os/hal/ports/SAMA/SAMA5D2x/sama_secumod.h @@ -484,6 +484,10 @@ struct SECDriver { */
#define secumodSetBackupModeProtections(sources) { \
SECUMOD->SECUMOD_BMPR = sources; \
+ if (SECUMOD->SECUMOD_BMPR != sources) { \
+ secumodToggleProtectionReg(); \
+ SECUMOD->SECUMOD_BMPR = sources; \
+ } \
}
/**
|