Hello,
I'm encountering a HardFault when attempting to read a byte from the DRAM memory-mapped regions on the i.MX93's Cortex-M33 core. I'm using MCUXpresso and have written the following code:
#define ADDRESS_READ 0xC0000000//(I tried 0xC0000000 0xA0000000 0x80000000)
volatile uint32_t *secureMemPtr = (volatile uint32_t *) ADDRESS_READ;
secureValue = *secureMemPtr;
When debugging in MCUXpresso, the code consistently jumps to the HardFault_Handler at the line:
ldr r0,=HardFault_Handler
bx r0
This loop repeats continuously.
Could you please advise on how to correctly read words from the DRAM?
Thank you for your assistance!
Hello,
Could you share how are you running your test?
Is it by single boot and then loading trough uboot or by userspace?
Are you debugging when seeing the hardfault?
Best regards/Saludos,
Aldo.
Thanks for your help, I've figure it out! if I debug when only Cortex M33 running, I can't access the DRAM at all. but if I debug when both Cortex A55 and Cortex M33 running, I can access and modify the DRAM directly through MCUXPresso.
though I don't know the why, but it works and I only need to access DRAM while both Cortex A and Cortex M is running ; )
this is when both A and M running:
and this is only M is running:
when I pass :
secureValue = *secureMemPtr;
will jump to this:
it will jump to this if I pass secureValue = *secureMemPtr; when only debugging with Cortex M running