Default Memory Protection Flag for enabling/disabling addresses with no range set?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User19424
Level 3
Level 3
First solution authored First like received
Hello,

When memory protection is activated (PROTEN), I noticed that addresses not set in any of the protection ranges (DPR0-DPR15) are automatically considered "not allowed"
Is there a way to change the functionality so that by default addresses not set are allowed? Meaning, I only want to protect and monitor the areas I set in the Memory Protection Registers.

Example:

Say I enable PROTEN, And only set the following, while making everything else 0

DPR1_L = 0x80028000
DPR1_U = 0x80040000

Now DPRE_0 = 2 (meaning only range one is enabled)

In this case, If I say read from 0x80020000, I will get a trap, since by default anything not within the ranges is considered disabled.

Thanks for any help!
0 Likes
2 Replies
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
No, there's no way to change the ranges to become not allowed instead of allowed. But you can achieve equivalent functionality by using two ranges that leave a hole:

DPRE_0 = 3 (0 and 1)
DPR0_L = 0x00000000 DPR0_U = 0x80027FF0
DPR1_L = 0x80040000 DPR1_U = 0xFFFFFFFF
0 Likes
User19424
Level 3
Level 3
First solution authored First like received
UC_wrangler wrote:
No, there's no way to change the ranges to become not allowed instead of allowed. But you can achieve equivalent functionality by using two ranges that leave a hole:

DPRE_0 = 3 (0 and 1)
DPR0_L = 0x00000000 DPR0_U = 0x80027FF0
DPR1_L = 0x80040000 DPR1_U = 0xFFFFFFFF


Got it.
Was trying to see if I can use all the ranges and not "waste" 2 of them.

Thanks for the answer again!
0 Likes