Hi, I need to load and debug my application in SDRAM on a LPC54608. Is there a script for J-Link to allow this?
I know that the MPU needs to be configured in order to be possible to execute the code from SDRAM so that is one of the things that the J-Link needs to configure before running the application.
Pls refer to the community, it talks about how to configure MPU, how to configure SDRAM so that the you can save code in SDRAM and run in SDRAM directly.
Hope it can help you
Thank you for your quick reply.
That is not exaclty what I need, I'm not able to use the internal flash for my application.
I need a .jlinkscript that configures the clocks, pins, sdram and mpu so that the debugger can access the sdram a load the code.
I'm already able to do all of that using a secondary bootloader, but I also need to load the code into the sdram directly using the jlink otherwise I cannot debug my project.
I think this will not work.
Take a look at the datasheet (LPC546xx.pdf), page 10. The EMC is not connected to the I-bus, which would be a requirement to execute code from.
I'm able to run code from the SDRAM using a secondary bootloader to configure the SDRAM and MPU to allow code execution from SDRAM.
The application note AN12423 explains how to do it.
I am not familiar with the script file format, I will ask AE team and check if they are familiar with the script file of J-Link. I will give you a feedback before the end of this week.
I have asked the AE team, it appears that nobody is familiar with the J-LINK device script file format, as you know that J-LINK is third party(Segger) product, you 'd better ask J-LINK support team. I have searched how to write peripheral register with script file based on J-LINK device, it appear you can not write register directly, this is the case in J-LINK forum:
Hope it is helpful
Thanks for looking into this. I'm trying to write the script my self, is not an easy task but I think I'm getting there. That thread in J-LINK forum is from 2015, maybe that was true at the time but now I certanly can write to the peripherals registers before loading the code into the SDRAM.
NXP provides the .jlinkscript in the iMX RT1064 SDK examples projects so not sure why then are saying they are unfamiliar with that script. Maybe not the same team.
This is a script for LPC43xx, I attach it here, hope it can help you.
From the script, it appears that the code requires to be compiled before using, right?
Thanks, I will have a look at this example to see if there is something that I missing on mine.
Yes, compile the code first and then j-link runs the script before loading the compiled code into the SDRAM.