How to relocate/execute a function to DDR.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to relocate/execute a function to DDR.

615件の閲覧回数
tandinh
Contributor II

I based on the link: https://community.nxp.com/servlet/JiveServlet/download/104433-4-291307/Relocating+Code+and+Data+Usin... and was able to relocate a function to the external DDR (0xa000_0000). I verified the relocated function was copied to the DDR and was able to single step to the function. However, as soon as I stepped to the first instruction "a4000000: push {r7, lr}", it led to the HardFault handler. Please help and let me know what am I missing. 

I include the KDS example project in the attachment.

Thanks

2 返答(返信)

490件の閲覧回数
Carlos_Mendoza
NXP Employee
NXP Employee

Hi  TAN DINH,

Make sure to initialize the external memory controller before trying to access the DDR memory.

Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 件の賞賛

490件の閲覧回数
tandinh
Contributor II

Hi Carlos,

Thanks for the reply. I did initialize the DDR before copying. I did find the solution for this. Instead of using physical address of DDR (0xA000_0000), I use the DDR_ALIAS address for code (0x1800_0000), then the issue goes away. I am able to step inside the function in DDR without any issue.

Thanks.

-- Tan Dinh