Other Parts Discussed in Thread: UNIFLASH
Tool/software:
Hello,
I am using the Industrial Comms SDK for the AM261x version 10.02.00.17 and I am trying to get the EtherCAT SubDevice example project to run in XIP mode and It is building but the application does not appear to be running.
For some background, I started with looking at the basic Hello World example and then followed the guide to enable XIP (https://software-dl.ti.com/mcu-plus-sdk/esd/AM261X/latest/exports/docs/api_guide_am261x/BOOTFLOW_XIP.html) and was able to get that to run in XIP without issue. Then I imported the EtherCAT SubDevice project for the 401_simple profile and verified that it worked correctly before trying to make any modifications.
I followed the guide to enable XIP again but this time after making all the same changes I built the code, and at first I saw a warning about "-llibsysbm.a<trgmsg.c.obj> (.text)" in the linker which I didn't see in the Hello World example, so I removed the CIO entry from the Text Segments area in the Memory Configurator. Neither with the CIO entry in the linker nor without it made any difference to how the device behaves after flashing it.
After putting the board into UART mode and using `uart_uniflash.py` to flash my board and then switching it back to OSPI mode I get the following log from the serial connection:
Starting OSPI Bootloader ... KPI_DATA: [BOOTLOADER_PROFILE] CPU Clock : 500.000 MHz KPI_DATA: [BOOTLOADER_PROFILE] Boot Media : NOR SPI FLASH KPI_DATA: [BOOTLOADER_PROFILE] Boot Media Clock : 166.667 MHz KPI_DATA: [BOOTLOADER_PROFILE] Boot Image Size : 117 KB KPI_DATA: [BOOTLOADER_PROFILE] Cores present : r5f0-0 KPI_DATA: [BOOTLOADER PROFILE] System_init : 510us KPI_DATA: [BOOTLOADER PROFILE] Drivers_open : 90us KPI_DATA: [BOOTLOADER PROFILE] LoadHsmRtFw : 6249us KPI_DATA: [BOOTLOADER PROFILE] Board_driversOpen : 4733us KPI_DATA: [BOOTLOADER PROFILE] CPU load : 4998us KPI_DATA: [BOOTLOADER PROFILE] SBL End : 3us KPI_DATA: [BOOTLOADER_PROFILE] SBL Total Time Taken : 16585us Image loading done, switching to application ...
And then the application never starts.
Are there special steps that need to be taken for EtherCAT to work in XIP? I've attached the .cfg file I used to flash the board and the example.syscfg which contains the changes I made according to the guide for enabling XIP.
For whatever reason, E2E will not let me upload the .syscfg file as a .syscfg so I changed it to .xml to allow me to upload it.
/**
* 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 "AM261x_ZFG" --part "AM2612" --package "ZFG" --context "r5fss0-0" --product "INDUSTRIAL_COMMUNICATIONS_SDK_AM261x@10.02.00"
* @v2CliArgs --device "AM2612" --package "NFBGA (ZFG)" --context "r5fss0-0" --product "INDUSTRIAL_COMMUNICATIONS_SDK_AM261x@10.02.00"
* @versions {"tool":"1.23.0+4000"}
*/
/**
* Import the modules used in this configuration.
*/
const eeprom = scripting.addModule("/board/eeprom/eeprom", {}, false);
const eeprom1 = eeprom.addInstance();
const flash = scripting.addModule("/board/flash/flash", {}, false);
const flash1 = flash.addInstance();
const ioexp = scripting.addModule("/board/ioexp/ioexp", {}, false);
const ioexp1 = ioexp.addInstance();
const led = scripting.addModule("/board/led/led", {}, false);
const led1 = led.addInstance();
const led2 = led.addInstance();
const led3 = led.addInstance();
const gpio = scripting.addModule("/drivers/gpio/gpio", {}, false);
const gpio1 = gpio.addInstance();
const i2c = scripting.addModule("/drivers/i2c/i2c", {}, false);
const i2c1 = i2c.addInstance();
const i2c2 = i2c.addInstance();
const pruicss = scripting.addModule("/drivers/pruicss/pruicss", {}, false);
const pruicss1 = pruicss.addInstance();
const ethercat = scripting.addModule("/industrial_comms/ethercat/ethercat", {}, false);
const ethercat1 = ethercat.addInstance();
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 mpu_armv76 = mpu_armv7.addInstance();
const mpu_armv77 = 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();
/**
* Write custom configuration values to the imported modules.
*/
eeprom1.$name = "CONFIG_EEPROM0";
eeprom1.i2cAddress = 0x51;
flash1.$name = "CONFIG_FLASH0";
flash1.peripheralDriver.$name = "CONFIG_OSPI0";
flash1.peripheralDriver.baudRateDiv = 8;
flash1.peripheralDriver.phyEnable = true;
flash1.peripheralDriver.OSPI.CLK.$assign = "GPIO10";
flash1.peripheralDriver.OSPI.CSn0.$assign = "GPIO62";
flash1.peripheralDriver.OSPI.DQS.$assign = "GPIO9";
flash1.peripheralDriver.OSPI.D7.$assign = "GPIO68";
flash1.peripheralDriver.OSPI.D6.$assign = "GPIO8";
flash1.peripheralDriver.OSPI.D5.$assign = "GPIO67";
flash1.peripheralDriver.OSPI.D4.$assign = "GPIO76";
flash1.peripheralDriver.OSPI.D3.$assign = "GPIO69";
flash1.peripheralDriver.OSPI.D2.$assign = "GPIO7";
flash1.peripheralDriver.OSPI.D1.$assign = "GPIO70";
flash1.peripheralDriver.OSPI.D0.$assign = "GPIO2";
flash1.peripheralDriver.OSPI.RESET_OUT0.$assign = "GPIO61";
flash1.peripheralDriver.child.$name = "drivers_ospi_v0_ospi_v0_am261x_template0";
ioexp1.$name = "CONFIG_IOEXP0";
led1.$name = "CONFIG_LED0";
led1.name = "TPIC2810";
led1.i2cAddress = 0x61;
led2.$name = "CONFIG_LED_STATUS";
led3.$name = "CONFIG_LED_ERROR";
led2.peripheralDriver = gpio1;
gpio1.pinDir = "OUTPUT";
gpio1.$name = "CONFIG_GPIO_USER_LED";
led3.peripheralDriver = gpio1;
gpio1.GPIO_n.$assign = "GPIO84";
i2c1.$name = "CONFIG_I2C1";
led1.peripheralDriver = i2c1;
i2c1.I2C.$assign = "I2C1";
i2c1.I2C.SCL.$assign = "GPIO23";
i2c1.I2C.SDA.$assign = "GPIO24";
i2c1.I2C_child.$name = "drivers_i2c_v1_i2c_v1_template0";
i2c2.$name = "CONFIG_I2C0";
eeprom1.peripheralDriver = i2c2;
ioexp1.peripheralDriver = i2c2;
i2c2.enableIntr = false;
i2c2.I2C.$assign = "I2C0";
i2c2.I2C_child.$name = "drivers_i2c_v1_i2c_v1_template1";
ethercat1.$name = "CONFIG_ETHERCAT0";
ethercat1.ethphy[0].$name = "CONFIG_ETHPHY0";
ethercat1.ethphy[0].name = "DP83826E";
ethercat1.ethphy[0].mdioPort = 1;
ethercat1.ethphy[1].$name = "CONFIG_ETHPHY1";
ethercat1.ethphy[1].name = "DP83826E";
ethercat1.ethphy[1].mdioPort = 3;
ethercat1.icss = pruicss1;
pruicss1.$name = "CONFIG_PRU_ICSS0_IO1";
pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0";
debug_log.enableCssLog = false;
debug_log.enableUartLog = true;
debug_log.uartLog.$name = "CONFIG_UART_CONSOLE";
debug_log.uartLog.child.$name = "drivers_uart_v2_uart_v2_template0";
mpu_armv71.$name = "CONFIG_MPU_REGION0";
mpu_armv71.size = 31;
mpu_armv71.accessPermissions = "Supervisor RD+WR, User RD";
mpu_armv71.attributes = "Device";
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 = 0x80000;
mpu_armv73.size = 15;
mpu_armv73.accessPermissions = "Supervisor RD+WR, User RD";
mpu_armv74.$name = "CONFIG_MPU_REGION3";
mpu_armv74.baseAddr = 0x70000000;
mpu_armv74.size = 21;
mpu_armv74.accessPermissions = "Supervisor RD+WR, User RD";
mpu_armv75.$name = "CONFIG_MPU_REGION4";
mpu_armv75.baseAddr = 0x50D00000;
mpu_armv75.size = 14;
mpu_armv75.attributes = "Device";
mpu_armv75.allowExecute = false;
mpu_armv76.$name = "CONFIG_MPU_REGION5";
mpu_armv76.baseAddr = 0x72000000;
mpu_armv76.size = 14;
mpu_armv76.attributes = "NonCached";
mpu_armv76.allowExecute = false;
mpu_armv77.$name = "CONFIG_MPU_REGION6";
mpu_armv77.baseAddr = 0x60000000;
mpu_armv77.size = 28;
mpu_armv77.accessPermissions = "Supervisor RD, User RD";
timer1.$name = "CONFIG_TIMER0";
timer1.usecPerTick = 100;
timer1.startTimer = true;
timer1.timerCallback = "OSAL_FREERTOS_callbackTimer";
default_linker1.$name = "memory_configurator_default_linker0";
general1.$name = "CONFIG_GENERAL0";
general1.stack_size = 4096;
general1.heap_size = 65536;
general1.abort_stack_size = 512;
general1.undefined_stack_size = 4096;
general1.fiq_stack_size = 4096;
general1.irq_stack_size = 8192;
general1.linker.$name = "TIARMCLANG0";
region1.$name = "MEMORY_REGION_CONFIGURATION0";
region1.memory_region.create(11);
region1.memory_region[0].type = "TCMA";
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";
region1.memory_region[1].$name = "R5F_TCMA";
region1.memory_region[1].size = 0x7FC0;
region1.memory_region[2].type = "TCMB";
region1.memory_region[2].size = 0x8000;
region1.memory_region[2].$name = "R5F_TCMB";
region1.memory_region[3].$name = "SBL";
region1.memory_region[3].auto = false;
region1.memory_region[3].size = 0x40000;
region1.memory_region[4].$name = "OCRAM";
region1.memory_region[4].auto = false;
region1.memory_region[4].manualStartAddress = 0x70080000;
region1.memory_region[4].size = 0xC0000;
region1.memory_region[5].type = "FLASH";
region1.memory_region[5].auto = false;
region1.memory_region[5].manualStartAddress = 0x60100000;
region1.memory_region[5].size = 0x80000;
region1.memory_region[5].$name = "FLASH";
region1.memory_region[6].$name = "USER_SHM_MEM";
region1.memory_region[6].auto = false;
region1.memory_region[6].size = 0x4000;
region1.memory_region[6].manualStartAddress = 0x70150000;
region1.memory_region[7].$name = "LOG_SHM_MEM";
region1.memory_region[7].auto = false;
region1.memory_region[7].manualStartAddress = 0x70154000;
region1.memory_region[7].size = 0x4000;
region1.memory_region[8].type = "CUSTOM";
region1.memory_region[8].$name = "RTOS_NORTOS_IPC_SHM_MEM";
region1.memory_region[8].auto = false;
region1.memory_region[8].manualStartAddress = 0x72000000;
region1.memory_region[8].size = 0x3E80;
region1.memory_region[9].type = "CUSTOM";
region1.memory_region[9].$name = "MAILBOX_HSM";
region1.memory_region[9].auto = false;
region1.memory_region[9].manualStartAddress = 0x44000000;
region1.memory_region[9].size = 0x3CE;
region1.memory_region[10].type = "CUSTOM";
region1.memory_region[10].$name = "MAILBOX_R5F";
region1.memory_region[10].auto = false;
region1.memory_region[10].manualStartAddress = 0x44000400;
region1.memory_region[10].size = 0x3CE;
section1.load_memory = "R5F_VECS";
section1.group = false;
section1.$name = "Vector Table";
section1.output_section.create(1);
section1.output_section[0].$name = ".vectors";
section1.output_section[0].palignment = true;
section2.load_memory = "OCRAM";
section2.$name = "Text Segments";
section2.output_section.create(6);
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;
section2.output_section[5].$name = ".cfg.rodata";
section2.output_section[5].palignment = true;
section3.$name = "Code and Read-Only Data";
section3.load_memory = "FLASH";
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.load_memory = "OCRAM";
section4.$name = "Data Segment";
section4.output_section.create(1);
section4.output_section[0].$name = ".data";
section4.output_section[0].palignment = true;
section5.load_memory = "OCRAM";
section5.$name = "Memory Segments";
section5.output_section.create(4);
section5.output_section[0].$name = ".bss";
section5.output_section[0].output_sections_start = "__BSS_START";
section5.output_section[0].output_sections_end = "__BSS_END";
section5.output_section[0].palignment = true;
section5.output_section[1].$name = ".sysmem";
section5.output_section[1].palignment = true;
section5.output_section[2].$name = ".stack";
section5.output_section[2].palignment = true;
section5.output_section[3].$name = ".threadstack";
section5.output_section[3].palignment = true;
section6.load_memory = "OCRAM";
section6.$name = "Stack Segments";
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.load_memory = "OCRAM";
section7.$name = "Initialization and Exception Handling";
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.load_memory = "USER_SHM_MEM";
section8.type = "NOLOAD";
section8.$name = "User Shared Memory";
section8.group = false;
section8.output_section.create(1);
section8.output_section[0].$name = ".bss.user_shared_mem";
section8.output_section[0].alignment = 0;
section9.load_memory = "LOG_SHM_MEM";
section9.$name = "Log Shared Memory";
section9.group = false;
section9.type = "NOLOAD";
section9.output_section.create(1);
section9.output_section[0].$name = ".bss.log_shared_mem";
section9.output_section[0].alignment = 0;
section10.load_memory = "RTOS_NORTOS_IPC_SHM_MEM";
section10.type = "NOLOAD";
section10.$name = "IPC Shared Memory";
section10.group = false;
section10.output_section.create(1);
section10.output_section[0].$name = ".bss.ipc_vring_mem";
section10.output_section[0].alignment = 0;
section11.load_memory = "MAILBOX_HSM";
section11.type = "NOLOAD";
section11.$name = "SIPC HSM Queue Memory";
section11.group = false;
section11.output_section.create(1);
section11.output_section[0].$name = ".bss.sipc_hsm_queue_mem";
section11.output_section[0].alignment = 0;
section12.load_memory = "MAILBOX_R5F";
section12.$name = "SIPC R5F Queue Memory";
section12.group = false;
section12.type = "NOLOAD";
section12.output_section.create(1);
section12.output_section[0].$name = ".bss.sipc_secure_host_queue_mem";
section12.output_section[0].alignment = 0;
/**
* 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.
*/
flash1.peripheralDriver.OSPI.$suggestSolution = "OSPI0";
i2c2.I2C.SCL.$suggestSolution = "GPIO135";
i2c2.I2C.SDA.$suggestSolution = "GPIO134";
ethercat1["PRU-ICSS0-IEP"].$suggestSolution = "PRU-ICSS0-IEP";
ethercat1["PRU-ICSS0-IEP"].PR0_IEP0_EDC_SYNC_OUT0.$suggestSolution = "GPIO119";
ethercat1["PRU-ICSS0-IEP"].PR0_IEP0_EDC_SYNC_OUT1.$suggestSolution = "GPIO124";
ethercat1["PRU-ICSS0-IEP"].PR0_IEP0_EDIO_DATA_IN_OUT30.$suggestSolution = "GPIO105";
ethercat1["PRU-ICSS0-IEP"].PR0_IEP0_EDIO_DATA_IN_OUT31.$suggestSolution = "GPIO104";
ethercat1["PRU-ICSS0"].$suggestSolution = "PRU-ICSS0";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO8.$suggestSolution = "GPIO90";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO5.$suggestSolution = "GPIO87";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO6.$suggestSolution = "GPIO91";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO4.$suggestSolution = "GPIO92";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO0.$suggestSolution = "GPIO93";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO1.$suggestSolution = "GPIO94";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO2.$suggestSolution = "GPIO95";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO3.$suggestSolution = "GPIO96";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO16.$suggestSolution = "GPIO97";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO15.$suggestSolution = "GPIO98";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO11.$suggestSolution = "GPIO99";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO12.$suggestSolution = "GPIO100";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO13.$suggestSolution = "GPIO101";
ethercat1["PRU-ICSS0"].PR0_PRU0_GPIO14.$suggestSolution = "GPIO102";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO8.$suggestSolution = "GPIO106";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO5.$suggestSolution = "GPIO103";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO6.$suggestSolution = "GPIO107";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO4.$suggestSolution = "GPIO108";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO0.$suggestSolution = "GPIO109";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO1.$suggestSolution = "GPIO110";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO2.$suggestSolution = "GPIO111";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO3.$suggestSolution = "GPIO112";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO16.$suggestSolution = "GPIO113";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO15.$suggestSolution = "GPIO114";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO11.$suggestSolution = "GPIO115";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO12.$suggestSolution = "GPIO116";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO13.$suggestSolution = "GPIO117";
ethercat1["PRU-ICSS0"].PR0_PRU1_GPIO14.$suggestSolution = "GPIO118";
ethercat1["PRU-ICSS0-MDIO"].$suggestSolution = "PRU-ICSS0-MDIO";
ethercat1["PRU-ICSS0-MDIO"].PR0_MDIO0_MDIO.$suggestSolution = "GPIO85";
ethercat1["PRU-ICSS0-MDIO"].PR0_MDIO0_MDC.$suggestSolution = "GPIO86";
debug_log.uartLog.UART.$suggestSolution = "UART0";
debug_log.uartLog.UART.RXD.$suggestSolution = "GPIO27";
debug_log.uartLog.UART.TXD.$suggestSolution = "GPIO28";
timer1.RTI.$suggestSolution = "RTI1";
