[RT1170]How to debug a dual core project within SDRAM

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

[RT1170]How to debug a dual core project within SDRAM

[RT1170]How to debug a dual core project within SDRAM

    Compared with the RT10xx series, the i.MX RT117x has an additional M4 core, which makes multi-core collaboration possible. The general practice of multi-core operation is to run in independent program data space and communicate through a shared memory space. For example, in the official SDK routine, the M7 code runs in Flash, while the M4 code runs in SRAM, and they communicate from each other via a shared SRAM space, which can ensure the maximum performance. However, during the development stage, customers may need to put both the M7 and M4 codes in external SDRAM for debugging. Although this will affect some performance, it will not perform too many erase and write operations on the flash, which also has certain practical significance.

    The following is a detailed explanation of how to load a dual core project to SDRAM for debugging. The following example comes from the official SDK dual core demo -  rpmsg_lite_pingpong .

    Because the default system boots from the M7 core, the usual practice is to load the M4 code by the M7, and then kick off the M4 core by M7 as well. Therefore, most of the changes are in the M7 project settings. The specific steps are as follows:

  1. M7 project settings:
    1. Add two memory space definitions, BOARD_SDRAM and SDRAM. BOARD_SDRAM section is used for M7 to store the data, while SDRAM section is used for M4's code. It should be noted that the location of BOARD_SDRAM should be next to BOARD_FLASH where is the default data section of the project. Kan_Li_3-1733206037604.png

       

    2. Add macro definition to enable SDRAM initialization code Kan_Li_4-1733206070263.png

       

    3. Select the following option to move the application code originally placed in BOARD_FLASH into BOARD_SDRAM. Kan_Li_5-1733206103496.png

       

    4. In the multi-core setup, set the M4 code location to the SDRAM space defined previously.  Kan_Li_6-1733206164211.png

       

    5. Replace the startup script in the debugger configuration with the version with SDRAM initialization support.  Kan_Li_7-1733206208506.png

       

    6. And add the following debug option:  

      --cachelib libm7_cache.so  

      Kan_Li_8-1733206246297.png

       

    7. Finally, update the M4 core startup address in the M7 code to the starting address of the SDRAM section defined previously: Kan_Li_9-1733206267899.png

       

  2. The changes to the M4 project are much simpler. 
    1. Add SDRAM memory space definition. The starting address and size should be consistent with the SDRAM space definition in the M7 project.  Kan_Li_10-1733206454697.png

       

  3. With the above steps, you can debug the code of M7 and M4 in SDRAM at the same time!  Kan_Li_11-1733206476981.pngKan_Li_12-1733206499843.png

     

     

評価なし
バージョン履歴
最終更新日:
‎12-05-2024 10:40 PM
更新者: