RT1170 debugging when application is built for SDRAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RT1170 debugging when application is built for SDRAM

Jump to solution
3,572 Views
robert_s
Contributor III

Hi,

I am developing an application for the RT1170 using MCUXpresso and it's SDK.

The sample projects provided all seem to have been built to use 'DTC' RAM. As with a number of other users my application is too large to fit there so I am trying to use the 'external SDRAM'.

Having tried the solutions proposed in a number of other forum posts (most notably https://community.nxp.com/t5/i-MX-RT/MCUXpresso-and-RT1050-download-and-debug-in-SDRAM/m-p/896979) I can now execute my program and, if the application is flashed, I can debug the program.

However if I build and execute with 'Link application to RAM' then, once a break point is hit the application usually get stuck there.

My presumption is that this is due to my not having initialised the SDRAM correctly. The aforementioned post uses at 'RT1050_SDRAM_Init.scp as a connect script for the debugger to init SDRAM controller'. If I use this file then not surprisingly it fails.

I have no idea how to adapt this script to work on an RT1170. Has anyone done this, or can give advice on how to generate it?

Thank you for any help you can provide.

Tags (4)
0 Kudos
Reply
1 Solution
3,560 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @robert_s ,

This script is fit for RT1050/60, but not for RT1170/60. You can use attached script. Besides the script file, there is other steps you should do.

  Move the BOARD_SDRAM above SRAM_DTC_m7 in Memory details in C/C++ Build > MCU settings of properties.

  1.       Use RT1170_connect_M7_wake_M4_SDRAM_init.scp for Connect script.
  2.       Add --cachelib libm7_cache.so to Additional options.
  3.       If use USB/Ethernet/SDHC, please put DMA buffer into noncacheable area.
  4.       Add USE_SDRAM into MCU C Compiler > Preprocessor.
  5.       Select link to ram in properties->settings->Managed Linker Script
  6.       Add DATA_SECTION_IS_CACHEABLE=1 into MCU C Compiler > Preprocessor if the project is associated with a USB.
  7.       Put the heap in DTCM or a non-cacheable area if the project is associated with a USB host without freertos (bm)

 

Regards,

Jing

 

 

 

View solution in original post

2 Replies
3,561 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @robert_s ,

This script is fit for RT1050/60, but not for RT1170/60. You can use attached script. Besides the script file, there is other steps you should do.

  Move the BOARD_SDRAM above SRAM_DTC_m7 in Memory details in C/C++ Build > MCU settings of properties.

  1.       Use RT1170_connect_M7_wake_M4_SDRAM_init.scp for Connect script.
  2.       Add --cachelib libm7_cache.so to Additional options.
  3.       If use USB/Ethernet/SDHC, please put DMA buffer into noncacheable area.
  4.       Add USE_SDRAM into MCU C Compiler > Preprocessor.
  5.       Select link to ram in properties->settings->Managed Linker Script
  6.       Add DATA_SECTION_IS_CACHEABLE=1 into MCU C Compiler > Preprocessor if the project is associated with a USB.
  7.       Put the heap in DTCM or a non-cacheable area if the project is associated with a USB host without freertos (bm)

 

Regards,

Jing

 

 

 

3,545 Views
robert_s
Contributor III

Thanks @jingpan ,

I just needed to add the .scp file and it worked.

I already had steps 5, 6 and 8, but I will give the others a go.

In case it is of help I had also made the following change in board.c, I think is equivalent to the one described in <https://community.nxp.com/t5/i-MX-RT/MCUXpresso-and-RT1050-download-and-debug-in-SDRAM/m-p/896979> - with RT1170_SDRAM_NOT_CACHED defined:

#ifdef USE_SDRAM
#ifndef RT1170_SDRAM_NOT_CACHED
/* Region 9 setting: Memory with Normal type, not shareable, outer/inner write back */
MPU->RBAR = ARM_MPU_RBAR(9, 0x80000000U);
MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_64MB);
#else
MPU->RBAR = ARM_MPU_RBAR(9, 0x80000000U);
MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 1, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_64MB);
#endif /* RT1170_SDRAM_NOT_CACHED */
#endif

 

Tags (1)
0 Kudos
Reply