HardFault When Reading DRAM on i.MX93 Cortex-M33 Core

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

HardFault When Reading DRAM on i.MX93 Cortex-M33 Core

438 次查看
RJC1
Contributor II

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!

Screenshot 2025-02-03 004029.png

0 项奖励
回复
3 回复数

381 次查看
AldoG
NXP TechSupport
NXP TechSupport

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.

0 项奖励
回复

370 次查看
RJC1
Contributor II

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:

 

Screenshot 2025-02-05 130246.png

Screenshot 2025-02-05 130647.png

Screenshot 2025-02-05 130820.png

and this is only M is running:


Screenshot 2025-02-05 130358.png

when I pass :
secureValue = *secureMemPtr;

will jump to this:

 

 

369 次查看
RJC1
Contributor II

it will jump to this if I pass secureValue = *secureMemPtr; when only debugging with Cortex M runningScreenshot 2025-02-05 130506.png