2017-11-10 04:18 AM
I am accessing an illegal memory location, but it does no generate MemManage fault or HardFault. Here's the compiling code that demonstrate the issue.
&sharpdefine SCB_SHCSR (*((volatile unsigned long*) 0xE000ED24)) //System handler control and state register
void MemManage_Handler(void)
{ __asm( 'MOV R4, 0x77777777\n\t' 'MOV R5, 0x77777777\n\t' );}void HardFault_Handler(void)
{ __asm( 'MOV R4, 0x77777777\n\t' 'MOV R5, 0x77777777\n\t' );} int main(void){ SCB_SHCSR = 0x00010000; // enable MemManage Fault __asm( 'LDR R0, =0xE0100000\n\t' 'MOV R1, 0x77777777\n\t' 'STR R1, [R0,&sharp0]' ); return (1);}void SystemInit(void)
{}So, 0xE0100000 is an illegal memory location and does not allow to read/write. But in main function I am writing at that location but it does not generate any fault i.e. MemManage or hardfault handler is not executed. Why is that?
It does however shows this error message: *** error 65: access violation at 0xE0100000 : no 'write' permission.
#stm32f103rb #stm32 #keil #cortex-m3 #memory-protection2017-11-10 07:47 AM
>>
It does however shows this error message: *** error 65: access violation at 0xE0100000 : no 'write' permission.
Run on real hardware not the 'simulation'
2017-11-10 09:03 AM
So, if I run it on hardware, will the interrupt handlers get executed?
2017-11-10 09:53 AM
You won't get 'error 65'
2017-11-10 12:06 PM
https://community.st.com/0D50X00009XkX8dSAF