xilinx_zynq_a9_qemu RTEMS6 no console input/output

Christian MAUDERER christian.mauderer at embedded-brains.de
Fri Feb 19 08:45:22 UTC 2021


Hello Heinz,

Am 19.02.21 um 09:31 schrieb junkes:
> I'll try your suggested approach. Maybe this will bring us closer to the 
> matter.
> 
> In the meantime, with your setup it works great. Only too well ;-)

Good to hear.

> e.g. ticker.exe restarts itself automatically again and again endlessly.

The restart depends on the options for qemu. If you used the script from 
debug/qemu.sh:

If you start the script just like it is, it assumes that you want to 
connect a gdb. In that case qemu is started with parameters that restart 
after the application terminates.

If you want to run an application without gdb, you have to pass "-p 0" 
to the script. This disables the gdb port and sets the -no-reboot option 
of qemu.

> fileio.exe also endlessly, no input is accepted.
> Everything seems to run "too fast". Problem with delays/timing?

I think some of the simulator BSPs have an option that enable some kind 
of time laps as soon as the idle routine is reached.

In the new waf build system it's the option CLOCK_DRIVER_USE_FAST_IDLE 
in the config.ini.

I'm not 100% sure how it would have been disabled in the old build 
system. I assume you have to pass CLOCK_DRIVER_USE_FAST_IDLE=0 to the 
configure call.

Best regards

Christian

> 
> Heinz
> 
> On 2021-02-19 08:39, Christian MAUDERER wrote:
>> Hello Heinz,
>>
>> Am 19.02.21 um 07:53 schrieb junkes:
>>> Hello Christian,
>>>
>>> I checked with gdb.
>>>
>>> start with
>>> sudo ~/QEMU/rtems/6/bin/qemu-system-arm -M xilinx-zynq-a9 -S -s -m 
>>> 256M -no-reboot -serial null -serial mon:stdio  -nographic -kernel 
>>> ./arm-rtems6/c/xilinx_zynq_a9_qemu/testsuites/samples/fileio.exe
>>>
>>> other terminal:
>>>
>>> $ ~/QEMU/rtems/6/bin/arm-rtems6-gdb 
>>> ./arm-rtems6/c/xilinx_zynq_a9_qemu/testsuites/samples/fileio.exe
>>> GNU gdb (GDB) 10.1.90.20210205-git
>>> ...
>>>
>>> For help, type "help".
>>> Type "apropos word" to search for commands related to "word"...
>>> Reading symbols from 
>>> ./arm-rtems6/c/xilinx_zynq_a9_qemu/testsuites/samples/fileio.exe...
>>> (gdb) target rem localhost:1234
>>> Remote debugging using localhost:1234
>>> bsp_start_vector_table_end ()
>>>      at 
>>> ../../../../../../../../../kernel/c/src/lib/libbsp/arm/xilinx-zynq/../../../../../../bsps/arm/shared/start/start.S:192 
>>> 192        mov    r0, #0
>>> (gdb) c
>>> Continuing.
>>>                           <---- no output
>>> ^C
>>> Program received signal SIGINT, Interrupt.
>>> bsp_vector_table_begin ()
>>>      at 
>>> ../../../../../../../../../kernel/c/src/lib/libbsp/arm/xilinx-zynq/../../../../../../bsps/arm/shared/start/start.S:73 
>>> 73        ldr    pc, .Lhandler_addr_undef
>>> (gdb) bt
>>> #0  bsp_vector_table_begin ()
>>>      at 
>>> ../../../../../../../../../kernel/c/src/lib/libbsp/arm/xilinx-zynq/../../../../../../bsps/arm/shared/start/start.S:73 
>>> #1  0x0010481c in zynq_mmu_config_table ()
>>> Backtrace stopped: previous frame identical to this frame (corrupt 
>>> stack?)
>>> (gdb)
>>
>> That looks a bit like there has ben either an exception or the code
>> hasn't been load. Can you try the following gdb commands:
>>
>> # Reset the system and load binary
>> monitor system_reset
>> load
>>
>> # Set some useful breakpoints (maybe you have to skip some libbsd ones)
>> b _ARM_Exception_default
>> b _ARMV4_Exception_data_abort_default
>> b bsp_interrupt_handler_default
>> b bsp_reset
>> b _Internal_error_Occurred
>> b _Terminate
>>
>> # run program
>> continue
>>
>> If you reach one of the breakpoints do a `bt` like you did above.
>>
>>>
>>> Same behavior on MVME2500 with RTEMS6:
>>>
>>> VME2500=> run rtems_myTests
>>> reading mvme2500.dtb
>>> 12363 bytes read in 13 ms (928.7 KiB/s)
>>> Speed: 1000, full duplex
>>> Using eTSEC1 device
>>> TFTP from server 141.14.128.9; our IP address is 141.14.128.89
>>> Filename 'ticker.img'.
>>> Load address: 0x10000000
>>> Loading: #####
>>>           6.4 MiB/s
>>> done
>>> Bytes transferred = 60182 (eb16 hex)
>>> WARNING: adjusting available memory to 30000000
>>> ## Booting kernel from Legacy Image at 10000000 ...
>>>     Image Name:   RTEMS
>>>     Created:      2021-02-18  20:18:21 UTC
>>>     Image Type:   PowerPC Linux Kernel Image (gzip compressed)
>>>     Data Size:    60118 Bytes = 58.7 KiB
>>>     Load Address: 00004000
>>>     Entry Point:  00004000
>>>     Verifying Checksum ... OK
>>> ## Flattened Device Tree blob at 20000000
>>>     Booting using the fdt blob at 0x20000000
>>>     Uncompressing Kernel Image ... OK
>>>     Loading Device Tree to 03ff9000, end 03fff04a ... OK
>>>
>>> no further output ...
>>
>> That's odd. Especially because it is an entirely different target.
>>
>> Best regards
>>
>> Christian
>>
>>>
>>> Will now try your install target ...
>>>
>>> Heinz
>>>
>>>
>>> On 2021-02-18 22:28, Christian Mauderer wrote:
>>>> Hello Heinz,
>>>>
>>>> On 18/02/2021 21:38, junkes wrote:
>>>>> Hallo Christian,
>>>>> thank you for testing. This is "my procedure":
>>>>
>>>> hm. There doesn't seem to be a big difference to mine. If you are
>>>> interested, take a look at the install target in the Makefile in:
>>>>
>>>> https://gitlab.com/c-mauderer/rtems-simulation-environment
>>>>
>>>> It's basically just building the same stuff. Differences:
>>>>
>>>> I use the waf based build system for the BSP. But that shouldn't
>>>> really matter at the moment. But note that you might have to switch
>>>> somewhen in the near future because it is planned to remove the old
>>>> autoconf / automake based build system.
>>>>
>>>> Beneath that I use a qemu build from the upstream sorces because the
>>>> version from RSB doesn't build cleanly on Arch Linux (something about
>>>> docs). But I tried it with the binary build by RSB and that works too.
>>>>
>>>> I'll think a bit about it and let you know when I find something other
>>>> that might be a problem. But at the moment, I'm running out of ideas.
>>>>
>>>> Maybe you can try to attach a gdb to your qemu and see whether the
>>>> application runs and only doesn't produce output?
>>>>
>>>> Best regards
>>>>
>>>> Christian
>>>>
>>>>>
>>>>> ### Installation RTEMS6 / EPICS7 (xilinx_zynq_a9_qemu)
>>>>>
>>>>> Installation RTEMS6 and EPICS 7 incl. rtems tools, kernel, bsp and 
>>>>> libbsd
>>>>>
>>>>> ubuntu 20.04.1
>>>>>
>>>>> ---
>>>>>
>>>>> **Installing rtems source builder and build rtems-powerpc tools**
>>>>>
>>>>>      mkdir QEMU
>>>>>      cd QEMU
>>>>>      git clone https://github.com/RTEMS/rtems-source-builder.git rsb
>>>>>      cd rsb
>>>>>      git checkout master
>>>>>      git pull
>>>>>      cd rtems
>>>>>      ../source-builder/sb-set-builder --prefix=$HOME/QEMU/rtems/6 
>>>>> 6/rtems-arm
>>>>>
>>>>> RTEMS Source Builder - Set Builder, 6 (61dcadee0825)
>>>>>   Command Line: ../source-builder/sb-set-builder 
>>>>> --prefix=/home/junkes/QEMU/rtems/6 6/rtems-arm
>>>>>   Python: 2.7.18 (default, Aug  4 2020, 11:16:42) [GCC 9.3.0]
>>>>> Build Set: 6/rtems-arm
>>>>> Build Set: 6/rtems-autotools.bset
>>>>> Build Set: 6/rtems-autotools-internal.bset
>>>>> config: tools/rtems-autoconf-2.69-1.cfg
>>>>> package: autoconf-2.69-x86_64-linux-gnu-1
>>>>> script:  1: #!/bin/sh
>>>>> script:  2: # ___build_pre as set up in defaults.py
>>>>> script:  3: # Save the original path away.
>>>>> script:  4: export SB_ORIG_PATH=${PATH}
>>>>> script:  5: # Directories
>>>>> script:  6: SB_PREFIX="/home/junkes/QEMU/rtems/6"
>>>>> script:  7: SB_PREFIX_CLEAN=$(echo "/home/junkes/QEMU/rtems/6" | 
>>>>> /bin/sed -e 's/^\///')
>>>>> script:  8: SB_SOURCE_DIR="/home/junkes/QEMU/rsb/rtems/sources"
>>>>> script:  9: 
>>>>> SB_BUILD_DIR="/home/junkes/QEMU/rsb/rtems/build/autoconf-2.69-x86_64-linux-gnu-1" 
>>>>> script: 10: # host == build, use build; host != build, host uses 
>>>>> host and build uses build
>>>>> ...
>>>>> ...
>>>>> installing: expat-2.1.0-x86_64-linux-gnu-1 -> 
>>>>> /home/junkes/QEMU/rtems/6
>>>>> installing: gmp-6.1.0-x86_64-linux-gnu-1 -> /home/junkes/QEMU/rtems/6
>>>>> installing: arm-rtems6-gdb-e1a808d-x86_64-linux-gnu-1 -> 
>>>>> /home/junkes/QEMU/rtems/6
>>>>> installing: arm-rtems6-binutils-c0034ac-x86_64-linux-gnu-1 -> 
>>>>> /home/junkes/QEMU/rtems/6
>>>>> installing: 
>>>>> arm-rtems6-gcc-eb15f76-newlib-d4a756f-x86_64-linux-gnu-1 -> 
>>>>> /home/junkes/QEMU/rtems/6
>>>>> installing: rtems-tools-90342feb4dd63d188ce945adfb0a7694a42a65cd-1 
>>>>> -> /home/junkes/QEMU/rtems/6
>>>>> cleaning: expat-2.1.0-x86_64-linux-gnu-1
>>>>> cleaning: gmp-6.1.0-x86_64-linux-gnu-1
>>>>> cleaning: arm-rtems6-gdb-e1a808d-x86_64-linux-gnu-1
>>>>> cleaning: arm-rtems6-binutils-c0034ac-x86_64-linux-gnu-1
>>>>> cleaning: arm-rtems6-gcc-eb15f76-newlib-d4a756f-x86_64-linux-gnu-1
>>>>> cleaning: rtems-tools-90342feb4dd63d188ce945adfb0a7694a42a65cd-1
>>>>> Build Sizes: usage: 9.360GB total: 2.750GB (sources: 796.541MB, 
>>>>> patches: 66.634KB, installed 1.972GB)
>>>>> installing: 6/rtems-arm -> /home/junkes/QEMU/rtems/6
>>>>> clean staging: 6/rtems-arm
>>>>> Staging Size: 5.291MB
>>>>> Build Set: Time 0:34:44.211033
>>>>>
>>>>> Build qemu-server:
>>>>>      ../source-builder/sb-set-builder 
>>>>> --prefix=/home/junkes/QEMU/rtems/6 devel/qemu.bset
>>>>>
>>>>> Add to $HOME/.bashrc:
>>>>>
>>>>>      #RTEMS development
>>>>>      export RTEMS_VERSION=6
>>>>>      export RTEMS_ARCH=arm-rtems${RTEMS_VERSION}
>>>>>      export RTEMS_BSP=xilinx_zynq_a9_qemu
>>>>>      export RTEMS_ROOT=${HOME}/QEMU/rtems/${RTEMS_VERSION}
>>>>>      export PATH=${RTEMS_ROOT}/bin:${PATH}
>>>>>      export 
>>>>> RTEMS_MAKEFILE_PATH=${RTEMS_ROOT}/${RTEMS_ARCH}/${RTEMS_BSP}
>>>>>      export RTEMS_SHARE_PATH=${RTEMS_ROOT}/share/rtems${RTEMS_VERSION}
>>>>>
>>>>>
>>>>> **Installing rtems kernel and bootstrap**
>>>>>
>>>>>      cd; cd QEMU
>>>>>      git clone https://github.com/RTEMS/rtems.git kernel
>>>>>      cd kernel;
>>>>>      git checkout master
>>>>>      git pull
>>>>>      ./bootstrap -c && ./rtems-bootstrap
>>>>>
>>>>> output:
>>>>>
>>>>>   removing automake generated Makefile.in files
>>>>> removing configure files
>>>>> removing aclocal.m4 files
>>>>> RTEMS Bootstrap, 1.0
>>>>>        1/119: autoreconf: configure.ac
>>>>>        2/119: autoreconf: testsuites/configure.ac
>>>>>        3/119: autoreconf: testsuites/smptests/configure.ac
>>>>>        4/119: autoreconf: testsuites/fstests/configure.ac
>>>>>        5/119: autoreconf: testsuites/ada/configure.ac
>>>>>        6/119: autoreconf: testsuites/benchmarks/configure.ac
>>>>>        7/119: autoreconf: testsuites/libtests/configure.ac
>>>>>        8/119: autoreconf: testsuites/rhealstone/configure.ac
>>>>>        9/119: autoreconf: testsuites/psxtests/configure.ac
>>>>>       10/119: autoreconf: testsuites/psxtmtests/configure.ac
>>>>>       11/119: autoreconf: testsuites/sptests/configure.ac
>>>>>       12/119: autoreconf: testsuites/mptests/configure.ac
>>>>>       13/119: autoreconf: testsuites/samples/configure.ac
>>>>>       14/119: autoreconf: testsuites/tmtests/configure.ac
>>>>>       15/119: autoreconf: c/configure.ac
>>>>>
>>>>>      ...
>>>>>      110/119: autoreconf: 
>>>>> c/src/lib/libbsp/powerpc/mvme3100/configure.ac
>>>>>      111/119: autoreconf: 
>>>>> c/src/lib/libbsp/powerpc/haleakala/configure.ac
>>>>>      112/119: autoreconf: 
>>>>> c/src/lib/libbsp/powerpc/mpc8260ads/configure.ac
>>>>>      113/119: autoreconf: 
>>>>> c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
>>>>>      114/119: autoreconf: c/src/lib/libbsp/powerpc/qoriq/configure.ac
>>>>>      115/119: autoreconf: 
>>>>> c/src/lib/libbsp/powerpc/gen5200/configure.ac
>>>>>      116/119: autoreconf: 
>>>>> c/src/lib/libbsp/powerpc/qemuppc/configure.ac
>>>>>      117/119: autoreconf: c/src/lib/libbsp/powerpc/virtex/configure.ac
>>>>>      118/119: autoreconf: 
>>>>> c/src/lib/libbsp/powerpc/virtex4/configure.ac
>>>>>      119/119: autoreconf: cpukit/configure.ac
>>>>>      Bootstrap time: 0:00:27.754820
>>>>>
>>>>>      cd; cd QEMU
>>>>>      mkdir -p build/b-xilinx_zynq_a9_qemu/
>>>>>      cd build/b-xilinx_zynq_a9_qemu/
>>>>>      ../../kernel/configure --prefix=$HOME/QEMU/rtems/6 
>>>>> --target=arm-rtems6 --enable-rtemsbsp=xilinx_zynq_a9_qemu 
>>>>> --enable-posix --enable-c++ --disable-networking --enable-tests
>>>>>
>>>>> config.log:
>>>>>
>>>>>      This file contains any messages produced by compilers while
>>>>>      running configure, to aid debugging if configure makes a mistake.
>>>>>
>>>>>      It was created by rtems configure 6.0.0, which was
>>>>>      generated by GNU Autoconf 2.69.  Invocation command line was
>>>>>
>>>>>        $ ../../kernel/configure --prefix=/home/junkes/QEMU/rtems/6 
>>>>> --target=arm-rtems6 --enable-rtemsbsp=xilinx_zynq_a9_qemu 
>>>>> --enable-posix --enable
>>>>>      -c++ --disable-networking --enable-tests
>>>>>
>>>>>      ## --------- ##
>>>>>      ## Platform. ##
>>>>>      ## --------- ##
>>>>>
>>>>>      hostname = Krikkit
>>>>>      uname -m = x86_64
>>>>>      uname -r = 5.8.0-43-generic
>>>>>      uname -s = Linux
>>>>>      uname -v = #49~20.04.1-Ubuntu SMP Fri Feb 5 09:57:56 UTC 2021
>>>>>
>>>>>      /usr/bin/uname -p = x86_64
>>>>>      /bin/uname -X     = unknown
>>>>>      ...
>>>>>
>>>>>      make -j17 all
>>>>>      make install
>>>>>
>>>>> rtems-libbsd
>>>>>      cd;cd QEMU
>>>>>      cd rtems-libbsd
>>>>>      git remote -v
>>>>>      origin    https://github.com/RTEMS/rtems-libbsd.git (fetch)
>>>>>      origin    https://github.com/RTEMS/rtems-libbsd.git (push)
>>>>>      git checkout master
>>>>>      git pull
>>>>>      git checkout 6-freebsd-12
>>>>>      git submodule init
>>>>>      git submodule update rtems_waf
>>>>>      ./waf configure --prefix=$HOME/QEMU/rtems/6 
>>>>> --rtems-bsps=arm/xilinx_zynq_a9_qemu --buildset=buildset/default.ini
>>>>>      ./waf
>>>>>      ./waf install
>>>>>
>>>>>
>>>>> qemu-testing:
>>>>>
>>>>> no ouptut and must be killed by other terminal:
>>>>>
>>>>> $ qemu-system-arm -no-reboot -serial null -serial mon:stdio -net 
>>>>> none -nographic -M xilinx-zynq-a9 -m 256M -kernel 
>>>>> arm-rtems6/c/xilinx_zynq_a9_qemu/testsuites/samples/hello.exe
>>>>> qemu-system-arm: warning: nic cadence_gem.0 has no peer
>>>>> qemu-system-arm: warning: nic cadence_gem.1 has no peer
>>>>>
>>>>>
>>>>> On 2021-02-18 21:10, Christian Mauderer wrote:
>>>>>> Hello Heinz,
>>>>>>
>>>>>> Odd. I just tested it with the current master of rtems, libbsd, rtems
>>>>>> source builder and qemu and it worked fine. The only thing that I had
>>>>>> to change compared to your command was adding the "-serial null"
>>>>>> before the second "-serial mon:stdio". Note that it's "null" and not
>>>>>> "none" like for network. I made that mistake when trying to adapt 
>>>>>> your
>>>>>> command line the first time and received no output.
>>>>>>
>>>>>> Beneath that I have an
>>>>>>
>>>>>>     export QEMU_AUDIO_DRV=none
>>>>>>
>>>>>> in my script that starts qemu. I'm not sure why and it seems that it
>>>>>> is no longer necessary. But maybe you want to try it.
>>>>>>
>>>>>> If both don't help:
>>>>>>
>>>>>> Which version of rtems are you using and how do you configure your
>>>>>> BSP? Which version of qemu are you using?
>>>>>>
>>>>>> On 18/02/2021 18:21, Heinz Junkes wrote:
>>>>>>> Thanks, unfortunately I also have the same behavior with -serial 
>>>>>>> null -serial on:stdio.
>>>>>>> So I use it with RTEMS5 which worked so far.
>>>>>>>
>>>>>>> I had found this in the mail list and tried it ;-)
>>>>>>
>>>>>> The patch below seems to be for the xilinx_zynqmp* BSP and not for 
>>>>>> the
>>>>>> xilinx_zynq_a9_qemu.
>>>>>>
>>>>>> Best regards
>>>>>>
>>>>>> Christian
>>>>>>
>>>>>>>
>>>>>>> Heinz
>>>>>>>
>>>>>>> Qemu's machine definition uses the second UART in the memory map 
>>>>>>> as the
>>>>>>> primary UART. This follows from the hardware itself where the second
>>>>>>> UART in the memory map is UART 0. This switches the tester to 
>>>>>>> using the
>>>>>>> correct UART.
>>>>>>> ---
>>>>>>> tester/rtems/testing/bsps/xilinx_zynqmp_ilp32.ini | 2 +-
>>>>>>> tester/rtems/testing/bsps/xilinx_zynqmp_lp64.ini  | 2 +-
>>>>>>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>>>>>>
>>>>>>> diff --git a/tester/rtems/testing/bsps/xilinx_zynqmp_ilp32.ini 
>>>>>>> b/tester/rtems/testing/bsps/xilinx_zynqmp_ilp32.ini
>>>>>>> index 5ff0e86..35869ed 100644
>>>>>>> --- a/tester/rtems/testing/bsps/xilinx_zynqmp_ilp32.ini
>>>>>>> +++ b/tester/rtems/testing/bsps/xilinx_zynqmp_ilp32.ini
>>>>>>> @@ -35,4 +35,4 @@
>>>>>>> bsp           = xilinx_zynqmp_ilp32
>>>>>>> arch          = aarch64
>>>>>>> tester        = %{_rtscripts}/qemu.cfg
>>>>>>> -bsp_qemu_opts = %{qemu_opts_base} -serial null -serial mon:stdio 
>>>>>>> -machine xlnx-zcu102 -m 4096
>>>>>>> +bsp_qemu_opts = %{qemu_opts_base} -serial mon:stdio -machine 
>>>>>>> xlnx-zcu102 -m 4096
>>>>>>> diff --git a/tester/rtems/testing/bsps/xilinx_zynqmp_lp64.ini 
>>>>>>> b/tester/rtems/testing/bsps/xilinx_zynqmp_lp64.ini
>>>>>>> index 8db82b6..cd2d268 100644
>>>>>>> --- a/tester/rtems/testing/bsps/xilinx_zynqmp_lp64.ini
>>>>>>> +++ b/tester/rtems/testing/bsps/xilinx_zynqmp_lp64.ini
>>>>>>> @@ -35,4 +35,4 @@
>>>>>>> bsp           = xilinx_zynqmp_lp64
>>>>>>> arch          = aarch64
>>>>>>> tester        = %{_rtscripts}/qemu.cfg
>>>>>>> -bsp_qemu_opts = %{qemu_opts_base} -serial null -serial mon:stdio 
>>>>>>> -machine xlnx-zcu102 -m 4096
>>>>>>> +bsp_qemu_opts = %{qemu_opts_base} -serial mon:stdio -machine 
>>>>>>> xlnx-zcu102 -m 4096
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> users mailing list
>>>>>>> users at rtems.org
>>>>>>> http://lists.rtems.org/mailman/listinfo/users
>>>>>>>
>>>>> _______________________________________________
>>>>> users mailing list
>>>>> users at rtems.org
>>>>> http://lists.rtems.org/mailman/listinfo/users
>>>>>
>>>
>>
>> -- 
>> --------------------------------------------
>> embedded brains GmbH
>> Herr Christian MAUDERER
>> Dornierstr. 4
>> 82178 Puchheim
>> Germany
>> email: christian.mauderer at embedded-brains.de
>> phone: +49-89-18 94 741 - 18
>> fax:   +49-89-18 94 741 - 08
>>
>> Registergericht: Amtsgericht München
>> Registernummer: HRB 157899
>> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
>> Unsere Datenschutzerklärung finden Sie hier:
>> https://embedded-brains.de/datenschutzerklaerung/

-- 
--------------------------------------------
embedded brains GmbH
Herr Christian MAUDERER
Dornierstr. 4
82178 Puchheim
Germany
email: christian.mauderer at embedded-brains.de
phone: +49-89-18 94 741 - 18
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the users mailing list