AnsweredAssumed Answered

RT1020 - SDRAM and SWD debugging problems

Question asked by rshipman on Apr 3, 2020
Latest reply on Apr 9, 2020 by Victor Jimenez



I hope you are all well.


I have configured the evkmimxrt1020_hello_world project to run entirely from SDRAM on the RT1020-EVK.

The three changes I made to the default demo are:

1. In 'Properties | C/C++ Build | MCU settings': I moved BOARD_FLASH to the bottom of the table. (Normally BOARD_FLASH is at the top.)

2. In 'Properties | C/C++ Build | Settings | Tool Settings tab | MCU Linker | Managed Linker Script':  I checked the box for 'Link application to RAM'. (Normally this is unchecked.)

3. I changed the .launch file to use the redlink script I created from the dcd data in xip/evkmimxrt1020_sdram_ini_dcd.c.

FYI: This is how I did that. After running debug to create a .launch file (debug will fail the first time until you change the redlink script), I double-clicked the .launch file, selected the 'LinkServer Debugger' tab, clicked 'Workspace...' and selected my .scp file.


This project is attached as a zip archive.


The program runs ok - I get the 'hello world' on the uart and I can enter characters.


I run into problems when using the debugger. If I want to step through code it does not behave correctly and generally seems unstable.

Try these:



Run debug and it will stop at the call to BOARD_ConfigMPU() in main. As you would expect.

Click on 'Step Into' and the program will just run to completion as if I had clicked on Run/Resume.



Run debug and it will stop at the call to BOARD_ConfigMPU() in main. As you would expect.

Click on 'Step Over' and the debugger will stop at the next function call to BOARD_InitPins(). As you would expect.

Click on 'Step Over' again and the program just hangs, running, but not doing anything. Click on pause and it always stops at the same call (to BOARD_InitPins()).


To be clear, if I do not use the debugger, except to just run the whole demo from the beginning, it runs ok. It is when I try to step or pause or whatever that it goes wrong. And only when running from SDRAM. The debugger seems to work fine (more or less) running from XIP flash (the default setup).


Is there anything I should be aware of that could be causing this? How do I fix this?


Many thanks.