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.

PROCESSOR-SDK-AM65X: Demos for jailhouse hypervisor?

Part Number: PROCESSOR-SDK-AM65X
Other Parts Discussed in Thread: AM67, SYSBIOS

Hello team, 

Customer is using AM65x on their design and wondering if there any additional demos for the jailhouse hypervisor to try for TI RTOS? If not, is there an available guide/recommendations as to how to set up a jailhouse inmate?

Thanks

  • Sepeedah,

    Currently for AM65 there is a Jailhouse example included to the Linux SDK for a Linux inmate. See section 3.1.14 of http://software-dl.ti.com/processor-sdk-linux/esd/docs/06_02_00_81/linux/Foundational_Components/Virtualization/Jailhouse.html. For an RTOS inmate we don't have a direct example on the AM65, though we do on the AM57. The same process can be followed, creating an RTOS binary to load into the inmate cell.

    best regards,

    Dave

  • Thanks Dave. Can you point me to AM57 RTOS example?

  • Sepeedah,

    The AM572x Jailhouse Demo is documented just after the AM65 at the earlier link.

    The AM57 SDK download page is at http://www.ti.com/tool/PROCESSOR-SDK-AM57X 

    Best regards,

    Dave

  • Hi Dave,

    I went ahead and modified the am57 jailhouse ethercat slave demo makefile for am65. I also modified the makefile in the bios, and all the other variables for the toolchain to work properly. But the makefile got stuck, whole directory in pdk am57 is missing in pdk am67. Is there a reason why am65 doesnt have the ICSS_EMAC folder?

    5857.Makefile.txt
    EXE = ethercat_slave_demo
    
    #**** rules.mk ***************************************************************
    
    CROSS_COMPILE = $(TOOLCHAIN_PATH_A53)/bin/aarch64-elf-
    CC=$(CROSS_COMPILE)gcc
    LD=$(CROSS_COMPILE)gcc
    AR=$(CROSS_COMPILE)ar
    BIN=$(CROSS_COMPILE)objcopy
    OBJDUMP=$(CROSS_COMPILE)objdump
    BINFLAGS=-O binary
    
    OBJS = $(patsubst %.c,%.o,$(CSRCS))
    OBJS += $(patsubst %.S,%.o,$(ASRCS))
    
    # Install path for PRU-ICSS-EtherCAT_Slave
    # Update the path in the line below as needed and then uncomment the line
    IA_SDK_HOME=/home/lam/ti/ccs910/PRU-ICSS-EtherCAT_Slave_01.00.07.02
    ifeq (,$(IA_SDK_HOME))
    $(error must specify IA_SDK_HOME)
    endif
    
    CCS_COPT=-DSOC_AM65XX -Dam6548 -Dcore0 -DAARCH64 -DECAT_MII -DNO_UART_MSG_APP -DECAT_LIMITED_DEMO \
    	-O2 -Wall
    
    	
    CCS_INCDIRS=-I$(PDK_INSTALL_PATH) \
    	-I$(IA_SDK_HOME) \
    	-I$(IA_SDK_HOME)/examples \
    	-I$(IA_SDK_HOME)/protocols/ethercat_slave/include \
    	-I$(IA_SDK_HOME)/protocols/ethercat_slave/ecat_appl/EcatStack \
    	-I$(IA_SDK_HOME)/protocols/ethercat_slave/ecat_appl/idkAM65xx \
    	-I$(IA_SDK_HOME)/protocols/ethercat_slave/firmware/g_v1.0
    
    GCCOPT = -gdwarf-2 -gstrict-dwarf -Wall -mtune=cortex-a53 \
    	 -g \
    	 
    CCS_L=-DSOC_AM65XX \
     -DNO_UART_MSG_APP \
     -DECAT_LIMITED_DEMO \
     -O2 \
     -ffunction-sections \
     -fdata-sections \
     -nodefaultlibs
    
    
    LDIR=-L$(BIOS_INSTALL_PATH)/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/hard \
         -L$(IA_SDK_HOME)/third_party/protocols/ethercat_slave/stack_lib/am65xx/a53 \
    
    
    
    INCDIRS = -I$(XDC_INSTALL_PATH)/packages \
    	  -I$(BIOS_INSTALL_PATH)/packages \
    	  $(CCS_INCDIRS)
    
    XDC_OPT = -Dxdc_target_types__="gnu/targets/arm/std.h" \
    	  -Dxdc_target_name__=A53F
    
    CFLAGS = $(GCCOPT) -g $(INCDIRS) $(XDC_OPT) -mcpu=cortex-a53 \
    	 $(CCS_COPT) -D_JAILHOUSE_INMATE
    
    LDFLAGS= $(GCCOPT) -Dam6548 -Dcore0 \
         $(CCS_L) \
         -Wl,-Map,$(EXE).map -nostartfiles \
         -static -Wl,--gc-sections $(LDIR) --specs=nano.specs \
         -Wl,--defsym,CORE0=1 \
         -Wl,--defsym,STACKSIZE=0x10000 -Wl,--defsym,HEAPSIZE=0x400 \
         -Wl,--start-group \
         $(OBJS) \
         -Wl,-T$(LDS) \
         -Wl,--start-group -lrdimon -lgcc -lc \
         -lethercat_slave_stack_AM65xx_arm \
         -Wl,--end-group \
    
    #******************************************************************************
    
    VPATH = $(PDK_INSTALL_PATH)/ti/drv/pruss/soc/am65xx \
    	$(PDK_INSTALL_PATH)/ti/drv/gpio/soc/am65xx \
    	$(PDK_INSTALL_PATH)/ti/drv/uart/soc/am65xx \
    	$(IA_SDK_HOME)/examples/board/idkAM65xx \
    	$(IA_SDK_HOME)/examples/board/common \
    	$(IA_SDK_HOME)/examples/ethercat_slave \
    	$(IA_SDK_HOME)/examples/osal \
    	$(IA_SDK_HOME)/protocols/ethercat_slave/ecat_appl/idkAM65xx \
    	$(IA_SDK_HOME)/protocols/ethercat_slave/ecat_appl/EcatStack \
    	./src
    
    
    CSRCS = pruicss_soc.c GPIO_soc.c UART_soc.c \
    	board_phy.c \
    	board_misc.c board_tlk105.c board_tlkphy.c tiescutils.c \
    	tiescappl.c tiesc_soc.c tiescphy_tlk105l.c delay_us.c \
    	tiesc_fw_cir_buff.c tiescbsp.c tieschw.c \
    	tiescmiscappl.c \
    	board_jh.c TaskP_tirtos.c OSP_tirtos.c
    
    LDS = ./bios/configPkg/linker.cmd
    
    all: $(EXE).bin
    
    $(EXE).out: $(LDS) $(OBJS)
    	$(LD) $(LDFLAGS) -o $@
    
    $(EXE).bin: $(EXE).out
    	sed -i -e 's/org = 0x80000000, len = 0x80000000/org = 0x90000000, len = 0x70000000/g' $(LDS)
    	$(BIN) $(BINFLAGS) $< $@
    
    $(LDS):
    	$(MAKE) -C ./bios sysbios
    
    clean:
    	$(MAKE) -C ./bios clean
    	rm -rf *.o *.map *.a *.bin *.out *.d
    
    install: $(EXE).bin
    	cp $(EXE).bin $(INSTALL_DIR)
    
    -include ../Rules.mk
    
    

  • Steven,

    The ICSS on the AM65xx is upgraded from the AM57. The EMAC driver is common between the CPSW2G and ICSSG, and both are under the EMAC folder now. See http://software-dl.ti.com/processor-sdk-rtos/esd/docs/06_01_00_08/rtos/index_device_drv.html?highlight=csi#emac

    Currently, dual-EMAC (two endpoint MACs) are supported on the ICSSG firmware. But you should be able to leverage any of the RTOS examples in the PDK for the inmate application instead of EtherCAT.

    Best regards,

    Dave

  • Hi Dave,

    I got past the phy issue, am65 uses a different phy driver.

    we are trying to get ethercat running with jailhouse on AM65.

    the next problem i'm running into looks like is the config file.

    in the am57 config file, there's a section that defines the inmate.

    /* ================= Inmate ====================================== */
    var Cache = xdc.useModule("ti.sysbios.family.arm.a15.Cache");
    Cache.errata798870 = false;
    
    var Hwi = xdc.useModule('ti.sysbios.family.arm.gic.Hwi');
    Hwi.initGicd = false;
    
    var TimerSupport = xdc.module('ti.sysbios.family.shared.vayu.TimerSupport');
    TimerSupport.availMask = 0x0080;

    i'm assuming i need to modify the cache to be ti.sysbios.family.arm.a53.Cache but that doesnt seem to exist.

    i think what i'm missing is an updated am65xx_app.cfg file that has ethercat inmate configured.

  • Hi Dave,

    here are the updated changes I've made to the am65 cfg file, and it looks like it works.

    /* ================= Inmate ====================================== */
    var Cache = xdc.useModule("ti.sysbios.family.arm.v8a.Cache");
    
    var Hwi = xdc.useModule('ti.sysbios.family.arm.gicv3.Hwi');
    Hwi.initGicd = false;
    
    var TimerSupport = xdc.module('ti.sysbios.family.shared.vayu.TimerSupport');
    TimerSupport.availMask = 0x0080;

    The next thing i'm stuck on is, it looks like the linker.cmd and .map files aren't being generated correctly.

    The contents of the file compared to the one generated from am57 look nothing alike. Am65 looks like its missing a lot more data.

    I don't know what the these file are based off of so I'm not sure what I'm suppose to change.

  • Steven,

    Thanks for the update and I'll check on guidance for the AM65 migration and come back.

    best regards,

    Dave

  • Steven,

    I think it would make sense to start with a simpler example for the inmate and replicate a bare-metal app.

    If you review the material under "Bare-Metal Example" at http://software-dl.ti.com/processor-sdk-linux/esd/docs/06_02_00_81/linux/Foundational_Components/Virtualization/Jailhouse.htm you can see the files needed to compile and link the example. You can look to use one of the bare metal A53 apps similarly, under <install_dir>\processor_sdk_rtos_am65xx_6_01_00_08\demos\rtos_template_app\am65xx\evmAM65xx\A53\template_app\baremetal

    Best regards,

    Dave

  • Hi Dave,

    I'm working with Steven on porting EtherCAT over to the AM65x. We have had the bare metal applications running for some time now. Were you able to find out if there will be an EtherCAT demo for the AM65x available for the future and when we can expect that. If not, is there going to be an example for allocating a PRU to an inmate.

    Andrea

  • Andrea,

    Thanks for clarifying on this point as it wasn't clear to me that they were able to get a non-Linux inmate up and running.

    The EtherCAT slave application is still more complex than the RTOS examples in the SDK package so it may make sense to go through more of a progression.

    Can you confirm if they have EtherCAT slave working under RTOS directly, without Jailhouse? The current release can be run from the R5F.

    In terms of schedule, we do not have a date for porting this example.

    Best regards,

    Dave

  • Hi Dave,

    Sorry for the confusion. Yes we have already gotten RTOS EtherCAT demo running on AM65x. We wanted to see if it was possible to have RTOS EtherCAT running alongside linux.

  • Steven, 

    Thanks. No problem and I should have clarified at the outset. To confirm further, is it an option to run on the R5F and communicate to the Linux application, or they are specifically looking for Jailhouse/A53? This would be more straightforward.

    Best regards,

    Dave

  • Hi Dave,

    We were looking for jailhouse at the A53, one core for Linux and one core for EtherCAT. However, running EtherCAT on the R5F to communicate to the Linux application may be an option. 

    What would be the process to get this to work? At minimum it sounds like we would have to recompile the demo to work on the R5F since we had it compiled for the A53. 

    Thanks,

    Andrea

  • Andrea,

    I'll follow up tomorrow on this and we can consider which option to best pursue. For the Linux + R5F application there is some configuration work to ensure the resource allocation reserved through the system firmware is consistent between the Linux and RTOS applications.

    Best regards,

    Dave

  • Andrea,

    We'll work on getting this setup working on our side and provide steps. I'll update over the next couple working days as we progress.

    Best regards,

    Dave

  • Hi Dave,

    That would be fantastic, thanks for the follow up and let us know updates.

    Thank you,

    Andrea

  • Hi Dave,

    Any update on the demo/procedure to enable this?

    Thanks,

    Andrea

  • Andrea,

    Sorry for the delay and thank you for your patience. We are looking into this, and should have some guidance for you during this week.

    Best regards,

    Dave

  • Hi Dave,

    Are there any beginning steps we can start looking into?

    Thanks,

    Andrea

  • Andrea, 

    Dave assigned me to try the EtherCAT slave software on the R5F and then run it alone-side of Linux. I currently have access to a GPEVM but do not have access to a IDK nor the TwinCAT master hardware. So I am planning to:

    1. Build the standlone demo application, load and run on the R5F - I won't be able to receive/transmit any packets, but want to verify resource requests from DMSC firmware are successful without errors. may need to modify the test slightly. 

    2. Verify if system resource calls are still successful,  when linux is running. Likely we may run into resource conflict across linux and R5f. 

    3. Adjust static resource allocation, to resolve conflicts from #2.  

    Currently I successfully build the R5F .out binary and loaded to my EVM, was able to run to a sciclient message rx wait state. I am still getting familiar with the test code, and inquiring software team to confirm feasibility of verifying resource request functions on the EVM. 

    Please let me know if you see issues/mismatches on above steps against what you and Dave aligned. 

    regards

    Jian

  • Hi Jian,

    Thank you for the updates, that so far looks promising. Let me know how it progresses. Also, I've generally had success with TwinCAT installed on a spare computer for basic testing, haven't needed any special hardware for it.

    Thanks,

    Andrea

  • Hi Jian,

    Any luck with getting the Linux and EtherCAT to run?

    Thanks,

    Andrea

  • Andrea, 

    Sorry not yet. I will send an update in 2 days.

    Jian

  • Hi Jian, any update? Thanks.

  • Andrea, 

    Sorry for the extended delay. There was a similar development trying to achieve the same goal, and quite some progress was made. The final system would be:

    • EtherCAT on R5/RTOS
    • Linux on A53
    • IPC between the two OS

    Since linux support for PG2 started from SDK7.0, so we will need to work with latest Linux SDK 7.1, and likely RTOS SDK7.1 also. Currently the team is actively working on IPC. 

    Please advise if this matches to your needs. 

    regards

    jian

  • Hi Jian,

    This is what we are looking for. Please keep us updated on the progress. Is the IPC portion going to work with SDK 7.1 or do we need to wait for a future SDK release?

    Thank you,

    Andrea

  • Andrea, 

    All debug work is based on 7.1 release. So no additional SDK update needed. 

    Jian

  • Hi Jian,

    Is there an r5 ECAT example available to try? 

    Thanks,

    Andrea

  • Andrea, 

    We have patch packages available, please email me at jian-wang@ti.com for an engineering drop. I will go ahead close the ticket. 
    Jian