Skip to content

Commit 1e4fbc4

Browse files
dgarskedanielinux
authored andcommitted
Peer review fixes (thanks Copilot)
1 parent bbb4d66 commit 1e4fbc4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

hal/stm32_tz.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,12 @@ void hal_tz_release_nonsecure_area(void)
200200

201201
#define SET_GTZC1_MPCBBx_SECCFGR_VCTR(bank,n,val) \
202202
(*((volatile uint32_t *)(GTZC1_MPCBB##bank##_SECCFGR) + n )) = val
203-
/* PRIVCFGR_VCTR sits 0x100 after SECCFGR_VCTR in each MPCBB block. */
203+
/* PRIVCFGR_VCTR sits 0x100 bytes (0x40 words) after SECCFGR_VCTR in each
204+
* MPCBB block. */
205+
#define GTZC_MPCBB_PRIVCFGR_WORD_OFFSET (0x100u / sizeof(uint32_t))
204206
#define SET_GTZC1_MPCBBx_PRIVCFGR_VCTR(bank,n,val) \
205-
(*((volatile uint32_t *)(GTZC1_MPCBB##bank##_SECCFGR) + 64 + n )) = val
207+
(*((volatile uint32_t *)(GTZC1_MPCBB##bank##_SECCFGR) + \
208+
GTZC_MPCBB_PRIVCFGR_WORD_OFFSET + n )) = val
206209

207210
void hal_gtzc_init(void)
208211
{

0 commit comments

Comments
 (0)