cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
VictorEmelin
Visitor
Visitor
618 Views
Registered: ‎04-15-2020

Hello World on ZCU111 with Xen, QEMU, and baremetal app on domu

Jump to solution

Hello, I'm trying to print from baremetal app to dom0/Xen petalinux console. Also using QEMU. So basically I tried to adopt this instruction: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842536/XEN+EL1+Baremetal+DomU Yes, I know that there is a typo in this instruction:

&uart1 {

I've created app using bitstream from ZCU111 BSP and I use petalinux 2019.1

As I know this bitstream doesn't have uart1, so I tried uart0, but it even breaks dom0 console.

I also tried different options in device tree file :

 

xen,xen-bootargs = "com1=115200,8n1 console=vga,com1 sync_console console=dtuart dtuart=serial0 dom0_mem=1G bootscrub=0 maxcpus=1 timer_slop=0";
xen,dom0-bootargs = "console=tty0 console=hvc0 earlycon=xen earlyprintk=xen maxcpus=1 clk_ignore_unused";

 

Sometimes it breaks dom0 console, sometimes it does nothing.

Also I tried to use HYPERVISOR_console_io() in my app. but it also doesn't work. And I was adding some options in .cfg file like vuart = "sbsa_uart" etc. Also tried QEMU with nographic argument.

 

So I have no idea which set of options and arguments I should use. I accept any way to print "Hello World" with all this QEMU, Xen, Petalinux and baremetal app.

Ussualy I have just this:

 

root@xilinx-zcu111-2019_1:~# xl list
Name                                        ID   Mem VCPUs	State	Time(s)
Domain-0                                     0  1024     1     r-----     918.1
root@xilinx-zcu111-2019_1:~# tftp -g -r hello_world.cfg 10.0.2.2
root@xilinx-zcu111-2019_1:~# tftp -g -r xapp_hello_world_el1.bin 10.0.2.2
root@xilinx-zcu111-2019_1:~# xl create -c hello_world.cfg
Parsing config from hello_world.cfg

 

 

 

0 Kudos
1 Solution

Accepted Solutions
VictorEmelin
Visitor
Visitor
545 Views
Registered: ‎04-15-2020

Finally I did it with this lib https://dornerworks.com/blog/boost-your-product-capabilities-using-a-virtual-console-with-xen/ that comes with Xilinx SDK in "xen_console.h"

I don't even need any extra parameters in .cfg file.

View solution in original post

0 Kudos
5 Replies
VictorEmelin
Visitor
Visitor
546 Views
Registered: ‎04-15-2020

Finally I did it with this lib https://dornerworks.com/blog/boost-your-product-capabilities-using-a-virtual-console-with-xen/ that comes with Xilinx SDK in "xen_console.h"

I don't even need any extra parameters in .cfg file.

View solution in original post

0 Kudos
deeptuuk
Visitor
Visitor
306 Views
Registered: ‎12-02-2020

 

I meet the same question,and i also use the xen_console.h, but thing goes wrong again

 

root@petalinux:~# xl list
Name ID Mem VCPUs State Time(s)
Domain-0 0 1024 1 r----- 196.5
hello_world 1 8 1 r----- 17.8
root@petalinux:~# xl console hello_world

and this is my cfg

#Guest name
name = "hello_world"
# Kernel image to boot
kernel = "/boot/cpu1_test.bin"
# Kernel command line options - Allocate 8MB
memory = 8
# Number of VCPUS
vcpus = 1
# Pin to CPU 0
cpus = [1]

 

can you help me, or show me your code and dts

thank youuuuuuuu!

0 Kudos
VictorEmelin
Visitor
Visitor
300 Views
Registered: ‎04-15-2020

As I remember, if you need output in virt console you just have to initialize it with init_console() function and use printk()

Also you attaches to console after creation with "xl console" comand. Instead try to create domU and imediatly attach to console with "xl create -c <cfg file>" command

0 Kudos
deeptuuk
Visitor
Visitor
298 Views
Registered: ‎12-02-2020

Thank you so much,

I find my problem is the linker address, and now my problem solved, it works well

Thank you again!!!!!!!!!!!

0 Kudos
deeptuuk
Visitor
Visitor
259 Views
Registered: ‎12-02-2020

hi VictorEmelin

I want to use baremetal to control ps led, and i use the example, but it didn't work

below is my code 

 

#include <stdio.h>
//#include "platform.h"
//#include "xil_printf.h"
#include <xen_console.h>
#include "xgpiops.h"
#include "sleep.h"

#define GPIO_DEVICE_ID XPAR_XGPIOPS_0_DEVICE_ID

/*
* The following are declared globally so they are zeroed and can be
* easily accessible from a debugger.
*/
XGpioPs Gpio; /* The driver instance for GPIO Device. */

int main()
{
//init_platform();
init_console();

int Status;
XGpioPs_Config *ConfigPtr;

//print("Hello World\n\r");
/* Initialize the GPIO driver. */
ConfigPtr = XGpioPs_LookupConfig(GPIO_DEVICE_ID);

Status = XGpioPs_CfgInitialize(&Gpio, ConfigPtr,
ConfigPtr->BaseAddr);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}

/*
* Set the direction for the pin to be output and
* Enable the Output enable for the LED Pin.
*/
XGpioPs_SetDirectionPin(&Gpio, 44, 1);
XGpioPs_SetOutputEnablePin(&Gpio, 44, 1);

while(1){
/* Set the GPIO output to be low. */
XGpioPs_WritePin(&Gpio, 44, 0x0);
printk("This is cpu_01 low! \n");
sleep(1) ;
/* Set the GPIO output to be high. */
XGpioPs_WritePin(&Gpio, 44, 0x1);
printk("This is cpu_01 high! \n");
sleep(1) ;
}

//cleanup_platform();
return 0;
}

 

can you help me 

appreciate you!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0 Kudos