Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
G4_mpu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ISC2
pro
G4_mpu
Commits
afa941e0
Commit
afa941e0
authored
1 year ago
by
iliya
Browse files
Options
Downloads
Patches
Plain Diff
feat: pt3 of ex2 done
parent
9cfe91a1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mpu_user_console_etu.c
+14
-0
14 additions, 0 deletions
mpu_user_console_etu.c
with
14 additions
and
0 deletions
mpu_user_console_etu.c
+
14
−
0
View file @
afa941e0
...
...
@@ -22,16 +22,28 @@
#include
"uart.h"
#include
"macro.h"
#define BUF_SIZE 100
#define MMFAR *(unsigned *)0xE000ED34
unsigned
user_stack
[
USER_STACK_SIZE
];
// space for user stack
void
*
user_stating_address
;
int
*
p_sram2
=
(
int
*
)
0x2007c000
,
a
,
*
p_out_of_mem
=
(
int
*
)
0x80000
;
unsigned
arr_addr
[
BUF_SIZE
]
=
{
0
};
unsigned
arr_err_code
[
BUF_SIZE
]
=
{
0
};
volatile
static
unsigned
idx_error
;
void
switch_to_user_mode
();
void
asm_test_fault
();
void
MemManage_Handler
()
{
arr_addr
[
idx_error
]
=
MMFAR
;
arr_err_code
[
idx_error
]
=
SCB
->
CFSR
;
idx_error
++
;
SCB
->
CFSR
=
0xFFFF
;
LPC_GPIO2
->
FIOPIN
=
idx_error
;
}
void
test_supervisor_mode
()
{
...
...
@@ -56,6 +68,8 @@ void test_user_mode() {
int
main
(
void
)
{
LPC_GPIO2
->
FIODIR
=
0xFF
;
LPC_GPIO2
->
FIOPIN
=
0
;
// MPU configuration here...
// Region 0 (Flash)
MPU
->
RNR
=
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment