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.

LP-AM243: EnDat: Channel2 not working on PRU Slice0 with loadshare

Part Number: LP-AM243
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi Experts,

We believe we've encountered a bug in the EnDat PRU firmware and would greatly appreciate your assistance in debugging it.

In our hardware design, we aim to connect two EnDat encoders to channels 0 and 2 of the ICSSG0-PRU0 slice. Since the encoders have different resolutions, we require the use of loadshare mode.

During our investigation, we confirmed that this configuration works correctly on the PRU1 slice of the LaunchPad. However, on the PRU0 slice, only channel 0 functions as expected. When channel 2 is activated, both channels stop working entirely.

Simple Example to reproduce error on LP-AM243, no encoders required

  • Use the launchpad without any external external boosterpack
  • Motor control sdk version: 09.02.00.11
  • Set the lauchpad via dip switch SW6 into dual motor drive mode
  • Use the endat_diagnostic example, in the sysconfig the desired channels and PRU slice 0/1 can be selected
  • If you use PRU slice 0, recompile the endat PRU firmware CCS projects, after switching the predefined symbol SLICE1 to SLICE0, then recompile motor control sdk libraries via makefile
  • To detect if endat firmware at least tries to initiate communication, you can monitor the CLK pin of the respective channel. Even with no encoder, there is one communication cycle visible
    • Slice1
      • Channel0: PRG0_PRU1_GPO0
      • Channel2: PRG0_PRU1_GPO6
    • Slice0
      • Channel0: PRG0_PRU0_GPO0
      • Channel2: PRG0_PRU0_GPO6

Measurements using PRU Slice 1

On Slice 1, any combination of channel 0 and channel 2 works on loadshare mode: (left only Channel 0 enabled, right both channels enabled)

Measurements using PRU Slice 0:

On slice 0, channel 0 standalone works (left picture). As soon as channel 2 is added, nothing works anymore (right picture). Channel 2 standalone does not work, either.

  

Interestingly, if you deactivate loadshare mode, both channels are working on slice 0. However, this is no solution for us, as we use two different encoders:

We hope this information is sufficient for you to reproduce the issue. If not, please don’t hesitate to ask for further details.

Your support would be highly appreciated, as this issue is currently delaying the commissioning of our hardware.

Sincerely, Stefan

  • Hi ,

    Are you using PRU0 firmware binaries for load share? The default binaries available in the SDK are built for PRU1.

    location: motor_control_sdk\source\position_sense\endat\firmware\multi_channel_load_share

    Thanks & regards,

    Achala Ram

  • Yes i do this as decribed: 

    • If you use PRU slice 0, recompile the endat PRU firmware CCS projects, after switching the predefined symbol SLICE1 to SLICE0, then recompile motor control sdk libraries via makefile
  • Stefan

    If it is okay for you, can you share the updated syscfg file with us?

    Regards

    Dhaval

  • Hi Dhaval, of course!

    This is the original sysconfig configuration from the example, which uses channel 0 and 2 on PRU1:

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "AM243x_ALX_beta" --part "ALX" --package "ALX" --context "r5fss0-0" --product "MOTOR_CONTROL_SDK_AM243x@09.02.00"
     * @v2CliArgs --device "AM2434" --package "FCCSP (ALX)" --context "r5fss0-0" --product "MOTOR_CONTROL_SDK_AM243x@09.02.00"
     * @versions {"tool":"1.21.0+3721"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const debug_log       = scripting.addModule("/kernel/dpl/debug_log");
    const mpu_armv7       = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
    const mpu_armv71      = mpu_armv7.addInstance();
    const mpu_armv72      = mpu_armv7.addInstance();
    const mpu_armv73      = mpu_armv7.addInstance();
    const mpu_armv74      = mpu_armv7.addInstance();
    const mpu_armv75      = mpu_armv7.addInstance();
    const timer           = scripting.addModule("/kernel/dpl/timer", {}, false);
    const timer1          = timer.addInstance();
    const default_linker  = scripting.addModule("/memory_configurator/default_linker", {}, false);
    const default_linker1 = default_linker.addInstance();
    const general         = scripting.addModule("/memory_configurator/general", {}, false);
    const general1        = general.addInstance();
    const region          = scripting.addModule("/memory_configurator/region", {}, false);
    const region1         = region.addInstance();
    const section         = scripting.addModule("/memory_configurator/section", {}, false);
    const section1        = section.addInstance();
    const section2        = section.addInstance();
    const section3        = section.addInstance();
    const section4        = section.addInstance();
    const section5        = section.addInstance();
    const section6        = section.addInstance();
    const section7        = section.addInstance();
    const section8        = section.addInstance();
    const section9        = section.addInstance();
    const section10       = section.addInstance();
    const section11       = section.addInstance();
    const section12       = section.addInstance();
    const endat           = scripting.addModule("/position_sense/endat", {}, false);
    const endat1          = endat.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    debug_log.enableUartLog        = true;
    debug_log.enableCssLog         = false;
    debug_log.uartLog.$name        = "CONFIG_UART_CONSOLE";
    debug_log.uartLog.UART.$assign = "USART0";
    
    const uart_v0_template  = scripting.addModule("/drivers/uart/v0/uart_v0_template", {}, false);
    const uart_v0_template1 = uart_v0_template.addInstance({}, false);
    uart_v0_template1.$name = "drivers_uart_v0_uart_v0_template0";
    debug_log.uartLog.child = uart_v0_template1;
    
    mpu_armv71.$name             = "CONFIG_MPU_REGION0";
    mpu_armv71.size              = 31;
    mpu_armv71.attributes        = "Device";
    mpu_armv71.accessPermissions = "Supervisor RD+WR, User RD";
    mpu_armv71.allowExecute      = false;
    
    mpu_armv72.$name             = "CONFIG_MPU_REGION1";
    mpu_armv72.size              = 15;
    mpu_armv72.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv73.$name             = "CONFIG_MPU_REGION2";
    mpu_armv73.baseAddr          = 0x41010000;
    mpu_armv73.size              = 15;
    mpu_armv73.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv74.$name             = "CONFIG_MPU_REGION3";
    mpu_armv74.accessPermissions = "Supervisor RD+WR, User RD";
    mpu_armv74.baseAddr          = 0x70000000;
    mpu_armv74.size              = 21;
    
    mpu_armv75.$name             = "CONFIG_MPU_REGION4";
    mpu_armv75.baseAddr          = 0x60000000;
    mpu_armv75.size              = 28;
    mpu_armv75.accessPermissions = "Supervisor RD, User RD";
    
    timer1.$name         = "CONFIG_TIMER0";
    timer1.intrPriority  = 0;
    timer1.timerCallback = "endat_position_loop";
    timer1.TIMER.$assign = "DMTIMER0";
    
    default_linker1.$name = "memory_configurator_default_linker0";
    
    general1.$name        = "CONFIG_GENERAL0";
    general1.linker.$name = "TIARMCLANG0";
    
    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               = 0x80000;
    region1.memory_region[5].type               = "FLASH";
    region1.memory_region[5].$name              = "FLASH";
    region1.memory_region[5].auto               = false;
    region1.memory_region[5].manualStartAddress = 0x60100000;
    region1.memory_region[5].size               = 0x80000;
    region1.memory_region[6].$name              = "USER_SHM_MEM";
    region1.memory_region[6].auto               = false;
    region1.memory_region[6].manualStartAddress = 0x701D0000;
    region1.memory_region[6].size               = 0x180;
    region1.memory_region[6].isShared           = true;
    region1.memory_region[6].shared_cores       = ["m4fss0-0","r5fss0-1","r5fss1-0","r5fss1-1"];
    region1.memory_region[7].auto               = false;
    region1.memory_region[7].manualStartAddress = 0x701D0180;
    region1.memory_region[7].size               = 0x3E80;
    region1.memory_region[7].$name              = "LOG_SHM_MEM";
    region1.memory_region[7].isShared           = true;
    region1.memory_region[7].shared_cores       = ["m4fss0-0","r5fss0-1","r5fss1-0","r5fss1-1"];
    region1.memory_region[8].auto               = false;
    region1.memory_region[8].manualStartAddress = 0x701D4000;
    region1.memory_region[8].size               = 0xC000;
    region1.memory_region[8].$name              = "RTOS_NORTOS_IPC_SHM_MEM";
    region1.memory_region[8].isShared           = true;
    region1.memory_region[8].shared_cores       = ["m4fss0-0","r5fss0-1","r5fss1-0","r5fss1-1"];
    
    section1.$name                        = "Vector Table";
    section1.load_memory                  = "R5F_VECS";
    section1.group                        = false;
    section1.output_section.create(1);
    section1.output_section[0].$name      = ".vectors";
    section1.output_section[0].palignment = true;
    
    section2.$name                        = "Text Segments";
    section2.load_memory                  = "MSRAM";
    section2.output_section.create(5);
    section2.output_section[0].$name      = ".text.hwi";
    section2.output_section[0].palignment = true;
    section2.output_section[1].$name      = ".text.cache";
    section2.output_section[1].palignment = true;
    section2.output_section[2].$name      = ".text.mpu";
    section2.output_section[2].palignment = true;
    section2.output_section[3].$name      = ".text.boot";
    section2.output_section[3].palignment = true;
    section2.output_section[4].$name      = ".text:abort";
    section2.output_section[4].palignment = true;
    
    section3.$name                        = "Code and Read-Only Data";
    section3.load_memory                  = "MSRAM";
    section3.output_section.create(2);
    section3.output_section[0].$name      = ".text";
    section3.output_section[0].palignment = true;
    section3.output_section[1].$name      = ".rodata";
    section3.output_section[1].palignment = true;
    
    section4.$name                        = "Data Segment";
    section4.load_memory                  = "MSRAM";
    section4.output_section.create(1);
    section4.output_section[0].$name      = ".data";
    section4.output_section[0].palignment = true;
    
    section5.$name                                   = "Memory Segments";
    section5.load_memory                             = "MSRAM";
    section5.output_section.create(3);
    section5.output_section[0].$name                 = ".bss";
    section5.output_section[0].palignment            = true;
    section5.output_section[0].output_sections_start = "__BSS_START";
    section5.output_section[0].output_sections_end   = "__BSS_END";
    section5.output_section[1].$name                 = ".sysmem";
    section5.output_section[1].palignment            = true;
    section5.output_section[2].$name                 = ".stack";
    section5.output_section[2].palignment            = true;
    
    section6.$name                                    = "Stack Segments";
    section6.load_memory                              = "MSRAM";
    section6.output_section.create(5);
    section6.output_section[0].$name                  = ".irqstack";
    section6.output_section[0].output_sections_start  = "__IRQ_STACK_START";
    section6.output_section[0].output_sections_end    = "__IRQ_STACK_END";
    section6.output_section[0].input_section.create(1);
    section6.output_section[0].input_section[0].$name = ". = . + __IRQ_STACK_SIZE;";
    section6.output_section[1].$name                  = ".fiqstack";
    section6.output_section[1].output_sections_start  = "__FIQ_STACK_START";
    section6.output_section[1].output_sections_end    = "__FIQ_STACK_END";
    section6.output_section[1].input_section.create(1);
    section6.output_section[1].input_section[0].$name = ". = . + __FIQ_STACK_SIZE;";
    section6.output_section[2].$name                  = ".svcstack";
    section6.output_section[2].output_sections_start  = "__SVC_STACK_START";
    section6.output_section[2].output_sections_end    = "__SVC_STACK_END";
    section6.output_section[2].input_section.create(1);
    section6.output_section[2].input_section[0].$name = ". = . + __SVC_STACK_SIZE;";
    section6.output_section[3].$name                  = ".abortstack";
    section6.output_section[3].output_sections_start  = "__ABORT_STACK_START";
    section6.output_section[3].output_sections_end    = "__ABORT_STACK_END";
    section6.output_section[3].input_section.create(1);
    section6.output_section[3].input_section[0].$name = ". = . + __ABORT_STACK_SIZE;";
    section6.output_section[4].$name                  = ".undefinedstack";
    section6.output_section[4].output_sections_start  = "__UNDEFINED_STACK_START";
    section6.output_section[4].output_sections_end    = "__UNDEFINED_STACK_END";
    section6.output_section[4].input_section.create(1);
    section6.output_section[4].input_section[0].$name = ". = . + __UNDEFINED_STACK_SIZE;";
    
    section7.$name                        = "Initialization and Exception Handling";
    section7.load_memory                  = "MSRAM";
    section7.output_section.create(3);
    section7.output_section[0].$name      = ".ARM.exidx";
    section7.output_section[0].palignment = true;
    section7.output_section[1].$name      = ".init_array";
    section7.output_section[1].palignment = true;
    section7.output_section[2].$name      = ".fini_array";
    section7.output_section[2].palignment = true;
    
    section8.$name                       = "User Shared Memory";
    section8.type                        = "NOLOAD";
    section8.load_memory                 = "USER_SHM_MEM";
    section8.group                       = false;
    section8.output_section.create(1);
    section8.output_section[0].$name     = ".bss.user_shared_mem";
    section8.output_section[0].alignment = 0;
    
    section9.$name                       = "Log Shared Memory";
    section9.load_memory                 = "LOG_SHM_MEM";
    section9.type                        = "NOLOAD";
    section9.group                       = false;
    section9.output_section.create(1);
    section9.output_section[0].$name     = ".bss.log_shared_mem";
    section9.output_section[0].alignment = 0;
    
    section10.$name                       = "IPC Shared Memory";
    section10.type                        = "NOLOAD";
    section10.load_memory                 = "RTOS_NORTOS_IPC_SHM_MEM";
    section10.group                       = false;
    section10.output_section.create(1);
    section10.output_section[0].$name     = ".bss.ipc_vring_mem";
    section10.output_section[0].alignment = 0;
    
    section11.$name                       = "Non Cacheable Memory";
    section11.load_memory                 = "NON_CACHE_MEM";
    section11.group                       = false;
    section11.type                        = "NOLOAD";
    section11.output_section.create(1);
    section11.output_section[0].$name     = ".bss.nocache";
    section11.output_section[0].alignment = 0;
    
    section12.$name                       = "Command Response ";
    section12.load_memory                 = "R5F_TCMB0";
    section12.group                       = false;
    section12.output_section.create(1);
    section12.output_section[0].$name     = ".gEnDatChInfo";
    section12.output_section[0].alignment = 4;
    
    endat1.$name                        = "CONFIG_ENDAT0";
    endat1.Booster_Pack                 = true;
    endat1.Channel_2                    = true;
    endat1.Multi_Channel_Load_Share     = true;
    endat1.PRU_ICSSG0_PRU.$assign       = "PRU_ICSSG0_PRU1";
    endat1.PRU_ICSSG0_PRU.GPO2.$assign  = "PRG0_PRU1_GPO2";
    endat1.PRU_ICSSG0_PRU.GPO1.$assign  = "PRG0_PRU1_GPO1";
    endat1.PRU_ICSSG0_PRU.GPO0.$assign  = "PRG0_PRU1_GPO0";
    endat1.PRU_ICSSG0_PRU.GPI13.$assign = "PRG0_PRU1_GPO13";
    endat1.PRU_ICSSG0_PRU.GPO8.$assign  = "PRG0_PRU1_GPO8";
    endat1.PRU_ICSSG0_PRU.GPO12.$assign = "PRG0_PRU1_GPO12";
    endat1.PRU_ICSSG0_PRU.GPO6.$assign  = "PRG0_PRU1_GPO6";
    endat1.PRU_ICSSG0_PRU.GPI11.$assign = "PRG0_PRU1_GPO11";
    endat1.ENC1_EN.$name                = "ENC1_EN";
    endat1.ENC1_EN.pu_pd                = "pu";
    endat1.ENC1_EN.GPIO_n.$assign       = "MMC1_SDWP";
    endat1.ENC2_EN.$name                = "ENC2_EN";
    endat1.ENC2_EN.pu_pd                = "pu";
    endat1.ENC2_EN.GPIO_n.$assign       = "MMC1_SDCD";
    
    const pruicss                            = scripting.addModule("/drivers/pruicss/pruicss", {}, false);
    const pruicss1                           = pruicss.addInstance({}, false);
    pruicss1.$name                           = "CONFIG_PRU_ICSS0";
    endat1.pru                               = pruicss1;
    pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0";
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD";
    debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD";
    

    And this is the file, where i switched to the PRU slice 0. Still channel 0 and 2 enabled, which does not work anymore as described above:

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "AM243x_ALX_beta" --part "ALX" --package "ALX" --context "r5fss0-0" --product "MOTOR_CONTROL_SDK_AM243x@09.02.00"
     * @v2CliArgs --device "AM2434" --package "FCCSP (ALX)" --context "r5fss0-0" --product "MOTOR_CONTROL_SDK_AM243x@09.02.00"
     * @versions {"tool":"1.21.0+3721"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const debug_log       = scripting.addModule("/kernel/dpl/debug_log");
    const mpu_armv7       = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
    const mpu_armv71      = mpu_armv7.addInstance();
    const mpu_armv72      = mpu_armv7.addInstance();
    const mpu_armv73      = mpu_armv7.addInstance();
    const mpu_armv74      = mpu_armv7.addInstance();
    const mpu_armv75      = mpu_armv7.addInstance();
    const timer           = scripting.addModule("/kernel/dpl/timer", {}, false);
    const timer1          = timer.addInstance();
    const default_linker  = scripting.addModule("/memory_configurator/default_linker", {}, false);
    const default_linker1 = default_linker.addInstance();
    const general         = scripting.addModule("/memory_configurator/general", {}, false);
    const general1        = general.addInstance();
    const region          = scripting.addModule("/memory_configurator/region", {}, false);
    const region1         = region.addInstance();
    const section         = scripting.addModule("/memory_configurator/section", {}, false);
    const section1        = section.addInstance();
    const section2        = section.addInstance();
    const section3        = section.addInstance();
    const section4        = section.addInstance();
    const section5        = section.addInstance();
    const section6        = section.addInstance();
    const section7        = section.addInstance();
    const section8        = section.addInstance();
    const section9        = section.addInstance();
    const section10       = section.addInstance();
    const section11       = section.addInstance();
    const section12       = section.addInstance();
    const endat           = scripting.addModule("/position_sense/endat", {}, false);
    const endat1          = endat.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    debug_log.enableUartLog        = true;
    debug_log.enableCssLog         = false;
    debug_log.uartLog.$name        = "CONFIG_UART_CONSOLE";
    debug_log.uartLog.UART.$assign = "USART0";
    
    const uart_v0_template  = scripting.addModule("/drivers/uart/v0/uart_v0_template", {}, false);
    const uart_v0_template1 = uart_v0_template.addInstance({}, false);
    uart_v0_template1.$name = "drivers_uart_v0_uart_v0_template0";
    debug_log.uartLog.child = uart_v0_template1;
    
    mpu_armv71.$name             = "CONFIG_MPU_REGION0";
    mpu_armv71.size              = 31;
    mpu_armv71.attributes        = "Device";
    mpu_armv71.accessPermissions = "Supervisor RD+WR, User RD";
    mpu_armv71.allowExecute      = false;
    
    mpu_armv72.$name             = "CONFIG_MPU_REGION1";
    mpu_armv72.size              = 15;
    mpu_armv72.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv73.$name             = "CONFIG_MPU_REGION2";
    mpu_armv73.baseAddr          = 0x41010000;
    mpu_armv73.size              = 15;
    mpu_armv73.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv74.$name             = "CONFIG_MPU_REGION3";
    mpu_armv74.accessPermissions = "Supervisor RD+WR, User RD";
    mpu_armv74.baseAddr          = 0x70000000;
    mpu_armv74.size              = 21;
    
    mpu_armv75.$name             = "CONFIG_MPU_REGION4";
    mpu_armv75.baseAddr          = 0x60000000;
    mpu_armv75.size              = 28;
    mpu_armv75.accessPermissions = "Supervisor RD, User RD";
    
    timer1.$name         = "CONFIG_TIMER0";
    timer1.intrPriority  = 0;
    timer1.timerCallback = "endat_position_loop";
    timer1.TIMER.$assign = "DMTIMER0";
    
    default_linker1.$name = "memory_configurator_default_linker0";
    
    general1.$name        = "CONFIG_GENERAL0";
    general1.linker.$name = "TIARMCLANG0";
    
    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               = 0x80000;
    region1.memory_region[5].type               = "FLASH";
    region1.memory_region[5].$name              = "FLASH";
    region1.memory_region[5].auto               = false;
    region1.memory_region[5].manualStartAddress = 0x60100000;
    region1.memory_region[5].size               = 0x80000;
    region1.memory_region[6].$name              = "USER_SHM_MEM";
    region1.memory_region[6].auto               = false;
    region1.memory_region[6].manualStartAddress = 0x701D0000;
    region1.memory_region[6].size               = 0x180;
    region1.memory_region[6].isShared           = true;
    region1.memory_region[6].shared_cores       = ["m4fss0-0","r5fss0-1","r5fss1-0","r5fss1-1"];
    region1.memory_region[7].auto               = false;
    region1.memory_region[7].manualStartAddress = 0x701D0180;
    region1.memory_region[7].size               = 0x3E80;
    region1.memory_region[7].$name              = "LOG_SHM_MEM";
    region1.memory_region[7].isShared           = true;
    region1.memory_region[7].shared_cores       = ["m4fss0-0","r5fss0-1","r5fss1-0","r5fss1-1"];
    region1.memory_region[8].auto               = false;
    region1.memory_region[8].manualStartAddress = 0x701D4000;
    region1.memory_region[8].size               = 0xC000;
    region1.memory_region[8].$name              = "RTOS_NORTOS_IPC_SHM_MEM";
    region1.memory_region[8].isShared           = true;
    region1.memory_region[8].shared_cores       = ["m4fss0-0","r5fss0-1","r5fss1-0","r5fss1-1"];
    
    section1.$name                        = "Vector Table";
    section1.load_memory                  = "R5F_VECS";
    section1.group                        = false;
    section1.output_section.create(1);
    section1.output_section[0].$name      = ".vectors";
    section1.output_section[0].palignment = true;
    
    section2.$name                        = "Text Segments";
    section2.load_memory                  = "MSRAM";
    section2.output_section.create(5);
    section2.output_section[0].$name      = ".text.hwi";
    section2.output_section[0].palignment = true;
    section2.output_section[1].$name      = ".text.cache";
    section2.output_section[1].palignment = true;
    section2.output_section[2].$name      = ".text.mpu";
    section2.output_section[2].palignment = true;
    section2.output_section[3].$name      = ".text.boot";
    section2.output_section[3].palignment = true;
    section2.output_section[4].$name      = ".text:abort";
    section2.output_section[4].palignment = true;
    
    section3.$name                        = "Code and Read-Only Data";
    section3.load_memory                  = "MSRAM";
    section3.output_section.create(2);
    section3.output_section[0].$name      = ".text";
    section3.output_section[0].palignment = true;
    section3.output_section[1].$name      = ".rodata";
    section3.output_section[1].palignment = true;
    
    section4.$name                        = "Data Segment";
    section4.load_memory                  = "MSRAM";
    section4.output_section.create(1);
    section4.output_section[0].$name      = ".data";
    section4.output_section[0].palignment = true;
    
    section5.$name                                   = "Memory Segments";
    section5.load_memory                             = "MSRAM";
    section5.output_section.create(3);
    section5.output_section[0].$name                 = ".bss";
    section5.output_section[0].palignment            = true;
    section5.output_section[0].output_sections_start = "__BSS_START";
    section5.output_section[0].output_sections_end   = "__BSS_END";
    section5.output_section[1].$name                 = ".sysmem";
    section5.output_section[1].palignment            = true;
    section5.output_section[2].$name                 = ".stack";
    section5.output_section[2].palignment            = true;
    
    section6.$name                                    = "Stack Segments";
    section6.load_memory                              = "MSRAM";
    section6.output_section.create(5);
    section6.output_section[0].$name                  = ".irqstack";
    section6.output_section[0].output_sections_start  = "__IRQ_STACK_START";
    section6.output_section[0].output_sections_end    = "__IRQ_STACK_END";
    section6.output_section[0].input_section.create(1);
    section6.output_section[0].input_section[0].$name = ". = . + __IRQ_STACK_SIZE;";
    section6.output_section[1].$name                  = ".fiqstack";
    section6.output_section[1].output_sections_start  = "__FIQ_STACK_START";
    section6.output_section[1].output_sections_end    = "__FIQ_STACK_END";
    section6.output_section[1].input_section.create(1);
    section6.output_section[1].input_section[0].$name = ". = . + __FIQ_STACK_SIZE;";
    section6.output_section[2].$name                  = ".svcstack";
    section6.output_section[2].output_sections_start  = "__SVC_STACK_START";
    section6.output_section[2].output_sections_end    = "__SVC_STACK_END";
    section6.output_section[2].input_section.create(1);
    section6.output_section[2].input_section[0].$name = ". = . + __SVC_STACK_SIZE;";
    section6.output_section[3].$name                  = ".abortstack";
    section6.output_section[3].output_sections_start  = "__ABORT_STACK_START";
    section6.output_section[3].output_sections_end    = "__ABORT_STACK_END";
    section6.output_section[3].input_section.create(1);
    section6.output_section[3].input_section[0].$name = ". = . + __ABORT_STACK_SIZE;";
    section6.output_section[4].$name                  = ".undefinedstack";
    section6.output_section[4].output_sections_start  = "__UNDEFINED_STACK_START";
    section6.output_section[4].output_sections_end    = "__UNDEFINED_STACK_END";
    section6.output_section[4].input_section.create(1);
    section6.output_section[4].input_section[0].$name = ". = . + __UNDEFINED_STACK_SIZE;";
    
    section7.$name                        = "Initialization and Exception Handling";
    section7.load_memory                  = "MSRAM";
    section7.output_section.create(3);
    section7.output_section[0].$name      = ".ARM.exidx";
    section7.output_section[0].palignment = true;
    section7.output_section[1].$name      = ".init_array";
    section7.output_section[1].palignment = true;
    section7.output_section[2].$name      = ".fini_array";
    section7.output_section[2].palignment = true;
    
    section8.$name                       = "User Shared Memory";
    section8.type                        = "NOLOAD";
    section8.load_memory                 = "USER_SHM_MEM";
    section8.group                       = false;
    section8.output_section.create(1);
    section8.output_section[0].$name     = ".bss.user_shared_mem";
    section8.output_section[0].alignment = 0;
    
    section9.$name                       = "Log Shared Memory";
    section9.load_memory                 = "LOG_SHM_MEM";
    section9.type                        = "NOLOAD";
    section9.group                       = false;
    section9.output_section.create(1);
    section9.output_section[0].$name     = ".bss.log_shared_mem";
    section9.output_section[0].alignment = 0;
    
    section10.$name                       = "IPC Shared Memory";
    section10.type                        = "NOLOAD";
    section10.load_memory                 = "RTOS_NORTOS_IPC_SHM_MEM";
    section10.group                       = false;
    section10.output_section.create(1);
    section10.output_section[0].$name     = ".bss.ipc_vring_mem";
    section10.output_section[0].alignment = 0;
    
    section11.$name                       = "Non Cacheable Memory";
    section11.load_memory                 = "NON_CACHE_MEM";
    section11.group                       = false;
    section11.type                        = "NOLOAD";
    section11.output_section.create(1);
    section11.output_section[0].$name     = ".bss.nocache";
    section11.output_section[0].alignment = 0;
    
    section12.$name                       = "Command Response ";
    section12.load_memory                 = "R5F_TCMB0";
    section12.group                       = false;
    section12.output_section.create(1);
    section12.output_section[0].$name     = ".gEnDatChInfo";
    section12.output_section[0].alignment = 4;
    
    endat1.$name                    = "CONFIG_ENDAT0";
    endat1.Booster_Pack             = true;
    endat1.Channel_2                = true;
    endat1.Multi_Channel_Load_Share = true;
    endat1.PRU_ICSSG0_PRU.$assign   = "PRU_ICSSG0_PRU0";
    endat1.ENC1_EN.$name            = "ENC1_EN";
    endat1.ENC1_EN.pu_pd            = "pu";
    endat1.ENC1_EN.GPIO_n.$assign   = "MMC1_SDWP";
    endat1.ENC2_EN.$name            = "ENC2_EN";
    endat1.ENC2_EN.pu_pd            = "pu";
    endat1.ENC2_EN.GPIO_n.$assign   = "MMC1_SDCD";
    
    const pruicss                            = scripting.addModule("/drivers/pruicss/pruicss", {}, false);
    const pruicss1                           = pruicss.addInstance({}, false);
    pruicss1.$name                           = "CONFIG_PRU_ICSS0";
    endat1.pru                               = pruicss1;
    pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0";
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    debug_log.uartLog.UART.RXD.$suggestSolution  = "UART0_RXD";
    debug_log.uartLog.UART.TXD.$suggestSolution  = "UART0_TXD";
    endat1.PRU_ICSSG0_PRU.GPO2.$suggestSolution  = "PRG0_PRU0_GPO2";
    endat1.PRU_ICSSG0_PRU.GPO1.$suggestSolution  = "PRG0_PRU0_GPO1";
    endat1.PRU_ICSSG0_PRU.GPO0.$suggestSolution  = "PRG0_PRU0_GPO0";
    endat1.PRU_ICSSG0_PRU.GPI13.$suggestSolution = "PRG0_PRU0_GPO13";
    endat1.PRU_ICSSG0_PRU.GPO8.$suggestSolution  = "PRG0_PRU0_GPO8";
    endat1.PRU_ICSSG0_PRU.GPO12.$suggestSolution = "PRG0_PRU0_GPO12";
    endat1.PRU_ICSSG0_PRU.GPO6.$suggestSolution  = "PRG0_PRU0_GPO6";
    endat1.PRU_ICSSG0_PRU.GPI11.$suggestSolution = "PRG0_PRU0_GPO11";
    

    Maybe you could check if you can reproduce my measurements on the launchpad.

    Best regards
    Stefan

  • Hi Stefan,

    There is a bug in the endat_diagnostic(in endat_pruss_init function). It configures wrong table entry for TXPRU0.

    You can fix this the same way as shown in the image below.

    Also, if you are using ICSSG1, please update the values as given below:

    ICSSG0:

    • SLICE0 → 0x250
    • SLICE1 → 0x258

    ICSSG1:

    • SLICE0 → 0xA50
    • SLICE1 → 0xA58

    Thanks & regards,

    Achala Ram 

  • Hi Achala, this works!
    Thank you for the quick investigation!

    Regards, Stefan