This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MCU-PLUS-SDK-AM243X: Trouble writing block (Error -1065)

Part Number: MCU-PLUS-SDK-AM243X

Hi,

The project is based on the multi-core FreeRTOS empty example. The board is AM243x Launchpad.

The board has the NULL bootloader. I used Code Composer Studio to launch target AM243x_XDS110.ccxml. I connected core R5FSS1-1 core then reset CPU. When I load the program on the core I get the following on console:

Fullscreen
1
2
3
MAIN_Cortex_R5_1_1: Trouble Writing Memory Block at 0x701faeb0 on Page 0 of Length 0x3028: (Error -1065 @ 0x701FCEB0) Unable to access device memory. Verify that the memory address is in valid memory. If error persists, confirm configuration, power-cycle board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 12.6.0.00029)
MAIN_Cortex_R5_1_1: File Loader: Verification failed: Target failed to write 0x701FAEB0
MAIN_Cortex_R5_1_1: GEL: File: C:\<I removed this part of the path>\empty_am243x-lp_r5fss1-1_freertos_ti-arm-clang\Debug\empty_am243x-lp_r5fss1-1_freertos_ti-arm-clang.out: Load failed.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
example.syscfg shows that I did not exceed MSRAM area. In example.syscfg, core R5FSS1-1's MSRAN starts at 0x0701FFFFF 0x701E0000 and ends at 0x0701FFFFF. Datasheet shows that MSRAM_256K7_RAM ends at 0x0701FFFFF.

I searched and the following seems similar to my issue: link and link.

I solved the problem by reducing core R5FSS0-0's MSRAM and shifting all cores' MSRAMs' start addresses, but I do not know why this worked.

I need to know the reason the error occurred.

  • Sorry I accidently made it related to another question.

  • Hello Sherif,

    I am looking at your queries and you may expect reply in one or two days .

    Regards,

    Anil.

  • Hello Sherif,

    I am trying to reproduce the issue on my side.

    Please let me know which version of MCU+SDK you are using ?

    The project is based on the multi-core FreeRTOS empty example.

    A multi core example means you are using a system_freertos example from the below path 

    C:\ti\mcu_plus_sdk_am243x_09_01_00_41\examples\empty\am243x-lp

    The 0x701faeb0 address is specific to DMSC core related part and we should not modify this address space .

    I assume that you have updated linker command file to use this address space in R5F1_1 core Application .

    Did you modify any linker command files in your application ?

    If you modify linker command file then this issue will come .

    Regards,

    Anil.

  • Edit: Correct MSRAM's start address.

  • In C:\ti, there is a folder with the name mcu_plus_sdk_am243x_09_01_00_41. Is this the version? Also there is a folder with the name ccs1260. I upgraded CCS to 1.2.7.0 today and the problem exists when I reset the project to the commit before fixing the issue.

    I did not modify the linker file, but I modified the memory regions in example.syscfg.

    Memory regions part of example.syscfg of each core at the time of the bug:

    • R5FSS0-0: 
      Fullscreen
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      region1.$name = "MEMORY_REGION_CONFIGURATION0";
      region1.memory_region.create(9);
      region1.memory_region[0].type = "TCMA_R5F";
      region1.memory_region[0].$name = "R5F_VECS";
      region1.memory_region[0].size = 0x40;
      region1.memory_region[0].auto = false;
      region1.memory_region[1].type = "TCMA_R5F";
      region1.memory_region[1].$name = "R5F_TCMA";
      region1.memory_region[1].size = 0x7FC0;
      region1.memory_region[2].type = "TCMB_R5F";
      region1.memory_region[2].$name = "R5F_TCMB0";
      region1.memory_region[2].size = 0x8000;
      region1.memory_region[3].$name = "NON_CACHE_MEM";
      region1.memory_region[3].auto = false;
      region1.memory_region[3].manualStartAddress = 0x70060000;
      region1.memory_region[3].size = 0x8000;
      region1.memory_region[4].$name = "MSRAM";
      region1.memory_region[4].auto = false;
      region1.memory_region[4].manualStartAddress = 0x70080000;
      region1.memory_region[4].size = 0x110000;
      region1.memory_region[5].type = "FLASH";
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    • R5FSS0-1:
      Fullscreen
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      region1.$name = "MEMORY_REGION_CONFIGURATION0";
      region1.memory_region.create(6);
      region1.memory_region[0].type = "TCMA_R5F";
      region1.memory_region[0].$name = "R5F_VECS";
      region1.memory_region[0].auto = false;
      region1.memory_region[0].size = 0x40;
      region1.memory_region[1].type = "TCMA_R5F";
      region1.memory_region[1].$name = "R5F_TCMA";
      region1.memory_region[1].size = 0x7FC0;
      region1.memory_region[2].type = "TCMB_R5F";
      region1.memory_region[2].$name = "R5F_TCMB0";
      region1.memory_region[2].size = 0x8000;
      region1.memory_region[3].$name = "NON_CACHE_MEM";
      region1.memory_region[3].auto = false;
      region1.memory_region[3].manualStartAddress = 0x70068000;
      region1.memory_region[3].size = 0x8000;
      region1.memory_region[4].$name = "MSRAM";
      region1.memory_region[4].auto = false;
      region1.memory_region[4].size = 0x20000;
      region1.memory_region[4].manualStartAddress = 0x701A0000;
      region1.memory_region[5].type = "FLASH";
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    • R5FSS1-0:
      Fullscreen
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      region1.$name = "MEMORY_REGION_CONFIGURATION0";
      region1.memory_region.create(6);
      region1.memory_region[0].type = "TCMA_R5F";
      region1.memory_region[0].$name = "R5F_VECS";
      region1.memory_region[0].auto = false;
      region1.memory_region[0].size = 0x40;
      region1.memory_region[1].type = "TCMA_R5F";
      region1.memory_region[1].$name = "R5F_TCMA";
      region1.memory_region[1].size = 0x7FC0;
      region1.memory_region[2].type = "TCMB_R5F";
      region1.memory_region[2].$name = "R5F_TCMB0";
      region1.memory_region[2].size = 0x8000;
      region1.memory_region[3].$name = "NON_CACHE_MEM";
      region1.memory_region[3].auto = false;
      region1.memory_region[3].manualStartAddress = 0x70070000;
      region1.memory_region[3].size = 0x8000;
      region1.memory_region[4].$name = "MSRAM";
      region1.memory_region[4].auto = false;
      region1.memory_region[4].manualStartAddress = 0x701C0000;
      region1.memory_region[4].size = 0x20000;
      region1.memory_region[5].type = "FLASH";
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    • R5FSS1-1:
      Fullscreen
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      region1.$name = "MEMORY_REGION_CONFIGURATION0";
      region1.memory_region.create(6);
      region1.memory_region[0].type = "TCMA_R5F";
      region1.memory_region[0].$name = "R5F_VECS";
      region1.memory_region[0].auto = false;
      region1.memory_region[0].size = 0x40;
      region1.memory_region[1].type = "TCMA_R5F";
      region1.memory_region[1].$name = "R5F_TCMA";
      region1.memory_region[1].size = 0x7FC0;
      region1.memory_region[2].type = "TCMB_R5F";
      region1.memory_region[2].$name = "R5F_TCMB0";
      region1.memory_region[2].size = 0x8000;
      region1.memory_region[3].$name = "NON_CACHE_MEM";
      region1.memory_region[3].auto = false;
      region1.memory_region[3].manualStartAddress = 0x70078000;
      region1.memory_region[3].size = 0x8000;
      region1.memory_region[4].$name = "MSRAM";
      region1.memory_region[4].auto = false;
      region1.memory_region[4].size = 0x20000;
      region1.memory_region[4].manualStartAddress = 0x701E0000;
      region1.memory_region[5].type = "FLASH";
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    • M4FSS0-0:
      Fullscreen
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      region1.$name = "MEMORY_REGION_CONFIGURATION0";
      region1.memory_region.create(3);
      region1.memory_region[0].type = "RAM0_M4F";
      region1.memory_region[0].$name = "M4F_VECS";
      region1.memory_region[0].size = 0x200;
      region1.memory_region[1].type = "RAM0_M4F";
      region1.memory_region[1].$name = "M4F_IRAM";
      region1.memory_region[1].size = 0x2FE00;
      region1.memory_region[1].auto = false;
      region1.memory_region[1].manualStartAddress = 0x200;
      region1.memory_region[2].type = "DRAM_M4F";
      region1.memory_region[2].$name = "M4F_DRAM";
      region1.memory_region[2].size = 0x10000;
      region1.memory_region[2].auto = false;
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Memory regions part of example.syscfg of each core after fixing the bug:

    • R5FSS0-0: 
      Fullscreen
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      region1.$name = "MEMORY_REGION_CONFIGURATION0";
      region1.memory_region.create(9);
      region1.memory_region[0].type = "TCMA_R5F";
      region1.memory_region[0].$name = "R5F_VECS";
      region1.memory_region[0].size = 0x40;
      region1.memory_region[0].auto = false;
      region1.memory_region[1].type = "TCMA_R5F";
      region1.memory_region[1].$name = "R5F_TCMA";
      region1.memory_region[1].size = 0x7FC0;
      region1.memory_region[2].type = "TCMB_R5F";
      region1.memory_region[2].$name = "R5F_TCMB0";
      region1.memory_region[2].size = 0x8000;
      region1.memory_region[3].$name = "NON_CACHE_MEM";
      region1.memory_region[3].auto = false;
      region1.memory_region[3].manualStartAddress = 0x70060000;
      region1.memory_region[3].size = 0x8000;
      region1.memory_region[4].$name = "MSRAM";
      region1.memory_region[4].auto = false;
      region1.memory_region[4].manualStartAddress = 0x70080000;
      region1.memory_region[4].size = 0x100000;
      region1.memory_region[5].type = "FLASH";
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    • R5FSS0-1:
      Fullscreen
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      region1.$name = "MEMORY_REGION_CONFIGURATION0";
      region1.memory_region.create(6);
      region1.memory_region[0].type = "TCMA_R5F";
      region1.memory_region[0].$name = "R5F_VECS";
      region1.memory_region[0].auto = false;
      region1.memory_region[0].size = 0x40;
      region1.memory_region[1].type = "TCMA_R5F";
      region1.memory_region[1].$name = "R5F_TCMA";
      region1.memory_region[1].size = 0x7FC0;
      region1.memory_region[2].type = "TCMB_R5F";
      region1.memory_region[2].$name = "R5F_TCMB0";
      region1.memory_region[2].size = 0x8000;
      region1.memory_region[3].$name = "NON_CACHE_MEM";
      region1.memory_region[3].auto = false;
      region1.memory_region[3].manualStartAddress = 0x70068000;
      region1.memory_region[3].size = 0x8000;
      region1.memory_region[4].$name = "MSRAM";
      region1.memory_region[4].auto = false;
      region1.memory_region[4].size = 0x20000;
      region1.memory_region[4].manualStartAddress = 0x70190000;
      region1.memory_region[5].type = "FLASH";
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    • R5FSS1-0:
      Fullscreen
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      region1.$name = "MEMORY_REGION_CONFIGURATION0";
      region1.memory_region.create(6);
      region1.memory_region[0].type = "TCMA_R5F";
      region1.memory_region[0].$name = "R5F_VECS";
      region1.memory_region[0].auto = false;
      region1.memory_region[0].size = 0x40;
      region1.memory_region[1].type = "TCMA_R5F";
      region1.memory_region[1].$name = "R5F_TCMA";
      region1.memory_region[1].size = 0x7FC0;
      region1.memory_region[2].type = "TCMB_R5F";
      region1.memory_region[2].$name = "R5F_TCMB0";
      region1.memory_region[2].size = 0x8000;
      region1.memory_region[3].$name = "NON_CACHE_MEM";
      region1.memory_region[3].auto = false;
      region1.memory_region[3].manualStartAddress = 0x70070000;
      region1.memory_region[3].size = 0x8000;
      region1.memory_region[4].$name = "MSRAM";
      region1.memory_region[4].auto = false;
      region1.memory_region[4].size = 0x20000;
      region1.memory_region[4].manualStartAddress = 0x701B0000;
      region1.memory_region[5].type = "FLASH";
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    • R5FSS1-1:
      Fullscreen
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      region1.$name = "MEMORY_REGION_CONFIGURATION0";
      region1.memory_region.create(6);
      region1.memory_region[0].type = "TCMA_R5F";
      region1.memory_region[0].$name = "R5F_VECS";
      region1.memory_region[0].auto = false;
      region1.memory_region[0].size = 0x40;
      region1.memory_region[1].type = "TCMA_R5F";
      region1.memory_region[1].$name = "R5F_TCMA";
      region1.memory_region[1].size = 0x7FC0;
      region1.memory_region[2].type = "TCMB_R5F";
      region1.memory_region[2].$name = "R5F_TCMB0";
      region1.memory_region[2].size = 0x8000;
      region1.memory_region[3].$name = "NON_CACHE_MEM";
      region1.memory_region[3].auto = false;
      region1.memory_region[3].manualStartAddress = 0x70078000;
      region1.memory_region[3].size = 0x8000;
      region1.memory_region[4].$name = "MSRAM";
      region1.memory_region[4].auto = false;
      region1.memory_region[4].size = 0x20000;
      region1.memory_region[4].manualStartAddress = 0x701D0000;
      region1.memory_region[5].type = "FLASH";
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    • M4FSS0-0:
      Fullscreen
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      region1.$name = "MEMORY_REGION_CONFIGURATION0";
      region1.memory_region.create(3);
      region1.memory_region[0].type = "RAM0_M4F";
      region1.memory_region[0].$name = "M4F_VECS";
      region1.memory_region[0].size = 0x200;
      region1.memory_region[1].type = "RAM0_M4F";
      region1.memory_region[1].$name = "M4F_IRAM";
      region1.memory_region[1].size = 0x2FE00;
      region1.memory_region[1].auto = false;
      region1.memory_region[1].manualStartAddress = 0x200;
      region1.memory_region[2].type = "DRAM_M4F";
      region1.memory_region[2].$name = "M4F_DRAM";
      region1.memory_region[2].size = 0x10000;
      region1.memory_region[2].auto = false;
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  • Hello Sherif,

    As mentioned in the above image, the R5F1_1 core address starts from 0x70140000

    And not from 0x701E0000 and this address space belongs to sysfw and users can't use it.

    The error is clearly saying that CCS can't access the address space since this address space is accessed by SYSFW.

    In the not issue case, you have been configured start addess from 0x701D0000 which is again used for IPC communication and if you are trying to use it for application IPC does not work.

    Region1.memory_region[4].manualStartAddress = 0x701D0000;

    Please don't change any MPU settings and start address of each core which are correctly defined and there are no issues.

    Please look at the chapter below for more details for memory layout 

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/09_02_00_50/exports/docs/api_guide_am243x/MEMORY_MAP.html

    Regards,

    S.Anil.

  • Please don't change any MPU settings and start address of each core which are correctly defined and there are no issues.

    In the link:

    Below picture shows the memory layout details of MSRAM for an application using all the cores, along with Linux. If an application is using only one core, then it can use the banks reserved for other cores.

    Does it mean redistributing the areas R5F0_0, R5F0_1, R5F1_0, R5F1_1 and Unallocated (Starting from 0x70180000) in MSRAM (As shown in the image) among the R5 cores is not allowed?

    The project needs increasing the MSRAM of R5FSS0-0.

    If using Unallocated (Starting from 0x70180000) is not allowed, is it allowed to change the R5 cores distribution of the areas R5F0_0, R5F0_1, R5F1_0 and R5F1_1?

  • Below picture shows the memory layout details of MSRAM for an application using all the cores, along with Linux. If an application is using only one core, then it can use the banks reserved for other cores.

    Hello Sherif,

    The address 0x70180000 is not allocated to any core or SYSFW. So, you can use this memory also in R5F application and there are no issues if you use the memory from 0x70180000 to 0x701C0000.  

    Does it mean redistributing the areas R5F0_0, R5F0_1, R5F1_0, R5F1_1 and Unallocated (Starting from 0x70180000) in MSRAM (As shown in the image) among the R5 cores is not allowed?

    This is allowable and most users don't touch this memory layout. If you want to re-define the memory start and end addresses, you can modify it accordingly to your application.

    Make sure that IPC and SYSFW memories you can't change.

    Regards,

    Anil.

  • Hi,

    I've another question about this topic. Can I use the Unallocated Area (From 0x701C0000 to 0x701D0000)?

    Thanks.

  • Hello Sherif,

    The mentioned memory does not belongs to any allocated area, so you can use it .

    Make sure that the end address should not be the same as 0x701D0000 since the same starting address should be used for the user's shared memory. 

    Use end address like (0x701D0000 - 0x10) for unallocated memory. So, that it will not overlap with any other memory regions.

    Regards,

    Anil.

  • Hello Sherif,

    I am closing this thread and open new thread for new queries .

    Regards,

    Anil.