-
Notifications
You must be signed in to change notification settings - Fork 15
[Pending mbed-os 5.6] Print peripheral on ACL violation from debug blinky example #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@danny4478 |
source/mem_map/mem_map.h
Outdated
#define __MEM_MAP_H__ | ||
|
||
typedef struct mem_map { | ||
const char *name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after *
source/mem_map/mem_map.h
Outdated
uint32_t end; | ||
} MemMap; | ||
|
||
const MemMap* memory_map_name(uint32_t addr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before *
source/mem_map/mem_map.cpp
Outdated
|
||
/* find system memory region */ | ||
map = g_mem_map; | ||
for(i = 0; i < UVISOR_ARRAY_COUNT(g_mem_map); i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would always use " { ... }", even wen not needed by compiler.
It is safer.
source/main.cpp
Outdated
|
||
static void example_halt_error(THaltError reason, const THaltInfo *halt_info) { | ||
|
||
const MemMap *map; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after *
source/main.cpp
Outdated
static void example_halt_error(THaltError reason, const THaltInfo *halt_info) { | ||
|
||
const MemMap *map; | ||
map = memory_map_name(halt_info->bfar); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure here that bfar is valid?
source/mem_map/mem_map.cpp
Outdated
map = g_mem_map; | ||
for(i = 0; i < UVISOR_ARRAY_COUNT(g_mem_map); i++) | ||
if((addr >= map->base) && (addr <= map->end)) | ||
return map; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same goes for if
statements - braces ARE mandatory for all block statements - also for single line cases
"Print peripheral on ACL violation from debug fault example" Shouldn't this PR be against the debug fault example? |
Hi, @alzix instructed me to use the basic uVisor example from uvisor repo |
Please update the commit message to reflect this, then. Thanks |
e2e98e7
to
9788239
Compare
Hi @Patater , |
@alzix Makes sense to me. Not sure how valuable the separate debug fault example is with this change, though. |
@Patater I think the debug fault example is still useful as it's an example which explicitly shows a fault scenario. |
@mikisch81 @alzix It'd probably be best to modify our debug fault example to poke some unowned peripheral instead of 0xFFFFFFFF, that way we could use a memory map like this. The IRQ example could stay simple as well without the memory map, although I agree with the porting benefits of having the memory map here too. |
pending for mbed-os : mbed-os-5.6.0-rc1 |
retest uvisor |
/morph uvisor-test |
@theamirocohen , please update mbed-os hash to point after ARMmbed/mbed-os#5275 merge |
f6c5947
to
6fd2838
Compare
@alzix, I've updated mbed-os hash to point after ARMmbed/mbed-os#5275 merge |
e223d20
to
8993dcf
Compare
/morph uvisor-test |
1 similar comment
/morph uvisor-test |
f00c526
to
578522b
Compare
Print the name of a peripheral when faulting on an address belonging to a perhipheral. The memory maps of K64F and STM32F4 were added.
578522b
to
a9927f7
Compare
Print the name of a peripheral when faulting on an address belonging
to a perhipheral.
The memory maps of K64F and STM32F4 were added.