Notice: We have migrated to GitLab launching 2024-05-01 see here:

Changes between Version 8 and Version 9 of Boards/Zynq - Zedboard

02/09/17 02:10:49 (7 years ago)
Chris Johns

Add an example session.


  • Boards/Zynq - Zedboard

    v8 v9  
    1861861. The RTEMS executable is stripped of any debugging information and converted to a binary image and then compressed. Stripping the executable or debugging information does not effect your ability to debug the application because debugging uses the ELF image which still contains the debugging information.
    1871871. The host tool `mkimage` is built as part of U-Boot. You can find it under `toos/mkimage`. You need to copy it somewhere in your path or add a path so it can be executed.
     189= RTEMS Libbsd Debugger Application =
     191The RTEMS Libbsd package builds an RTEMS Debugger application. This test application lets you connect to the running RTEMS application using GDB.
     193You can find the application in the `rtems-libbsd` build tree:
     196$ ls -las build/arm-rtems4.12-xilinx_zynq_zedboard/debugger01.exe                                                                                                                                                                                                                                                                                                                   
     19719745 -rwxr-xr-x  1 chris  user  20171796 Dec 23 14:39 build/arm-rtems4.12-xilinx_zynq_zedboard/debugger01.exe
     200Convert this executable to the U-Boot image format using the script above and copy to the TFTP server then boot the board:
     203U-Boot SPL 2016.05-00598-gb2f1858-dirty (Jun 04 2016 - 15:32:53)
     204mmc boot
     205Trying to boot from MMC1
     206reading system.dtb
     207reading uImage
     208spl_load_image_fat: error reading image uImage, err - -1
     209reading u-boot.img
     210reading u-boot.img
     213U-Boot 2016.05-00598-gb2f1858-dirty (Aug 05 2016 - 08:30:10 +1000)
     215Model: Zynq MicroZED Board
     216Board: Xilinx Zynq
     217DRAM:  ECC disabled 1 GiB
     218MMC:   sdhci@e0100000: 0
     219SF: Detected S25FL128S_64K with page size 256 Bytes, erase size 64 KiB, total 16 MiB
     220*** Warning - bad CRC, using default environment
     222In:    serial@e0001000
     223Out:   serial@e0001000
     224Err:   serial@e0001000
     225Model: Zynq MicroZED Board
     226Board: Xilinx Zynq
     227Net:   ZYNQ GEM: e000b000, phyaddr 0, interface rgmii-id
     229Warning: ethernet@e000b000 (eth0) using random MAC address - fa:69:35:9e:04:2f
     230eth0: ethernet@e000b000
     231reading uEnv.txt
     232162 bytes read in 10 ms (15.6 KiB/s)
     233Importing environment from mmc ...
     234Checking if uenvcmd is set ...
     235Running uenvcmd ...
     236Booting RTEMS XxX from net
     237ethernet@e000b000 Waiting for PHY auto negotiation to complete...... done
     238BOOTP broadcast 1
     239BOOTP broadcast 2
     240DHCP client bound to address (257 ms)
     241Using ethernet@e000b000 device
     242TFTP from server; our IP address is
     243Filename 'zed/rtems.img'.
     244Load address: 0x2000000
     245Loading: #################################################################
     246         ##
     247         9 MiB/s
     249Bytes transferred = 976253 (ee57d hex)
     250## Booting kernel from Legacy Image at 02000000 ...
     251   Image Name:   RTEMS
     252   Image Type:   ARM RTEMS Kernel Image (gzip compressed)
     253   Data Size:    976189 Bytes = 953.3 KiB
     254   Load Address: 00104000
     255   Entry Point:  00104000
     256   Verifying Checksum ... OK
     257   Uncompressing Kernel Image ... OK
     258## Transferring control to RTEMS (at address 00104000) ...
     259*** LIBBSD DEBUGGER 1 TEST ***
     261RTEMS Shell on /dev/console. Use 'help' to list commands.
     262[/] # nexus0: <RTEMS Nexus device>
     263cgem0: <Cadence CGEM Gigabit Ethernet Interface> on nexus0
     264miibus0: <MII bus> on cgem0
     265e1000phy0: <Marvell 88E1512 Gigabit PHY> PHY 0 on miibus0
     266e1000phy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
     267cgem0: Ethernet address: fa:69:35:9e:04:2f
     268zy7_slcr0: <Zynq-7000 slcr block> on nexus0
     269notice: cgem0: link state changed to DOWN
     270add host gateway cgem0
     271add net default: gateway
     272rtems-db: remote running
     273rtems-db: tcp remote: listing on port: 1122
     274notice: cgem0: link state changed to UP
     277The U-Boot DHCP address may not be the RTEMS IP address. In my case I have a static IP configured in LibBSD:
     280[/] # cat /etc/rc.conf
     281cat /etc/rc.conf
     282cat: /etc/rc.conf: No such file or directory
     283[/] # ifconfig
     285cgem0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
     286        options=80008<VLAN_MTU,LINKSTATE>
     287        ether fa:69:35:9e:04:2f
     288        inet netmask 0xffffff00 broadcast
     289        inet6 fe80::f869:35ff:fe9e:42f%cgem0 prefixlen 64 scopeid 0x1
     290        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
     291        media: Ethernet autoselect (1000baseT <full-duplex>)
     292        status: active
     293lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
     294        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
     295        inet netmask 0xffffff00
     296        inet6 ::1 prefixlen 128
     297        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
     298        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
     301The `ifconfig` command shows the IP address is ``. We can use this to connect GDB. On the development host run GDB using:
     304$ arm-rtems4.12-gdb -nx build/arm-rtems4.12-xilinx_zynq_zedboard/debugger01.exe
     305GNU gdb (GDB) 7.12
     306Copyright (C) 2016 Free Software Foundation, Inc.
     307License GPLv3+: GNU GPL version 3 or later <>
     308This is free software: you are free to change and redistribute it.
     309There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
     310and "show warranty" for details.
     311This GDB was configured as "--host=x86_64-freebsd10.3 --target=arm-rtems4.12".
     312Type "show configuration" for configuration details.
     313For bug reporting instructions, please see:
     315Find the GDB manual and other documentation resources online at:
     317For help, type "help".
     318Type "apropos word" to search for commands related to "word"...
     319Reading symbols from build/arm-rtems4.12-xilinx_zynq_zedboard/debugger01.exe...done.
     320(gdb) target remote
     321Remote debugging using
     322_Thread_Priority_update (queue_context=0x2866c0) at /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/score/src/threadchangepriority.c:344
     323344       n = queue_context->Priority.update_count;
     324(gdb)  info thread
     325  Id   Target Id         Frame
     326* 1    Thread 1.167837697 (UI1  (0a010001), priority(c:254 r:254), stack(s: 32768 a:0x429448), state(DELAY SUSP Wisig)) _Thread_Priority_update (queue_context=0x2866c0) at /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/score/src/threadchangepriority.c:344
     327  2    Thread 1.167837698 (SHLL (0a010002), priority(c:  1 r:  1), stack(s: 32768 a:0x431c08), state(SUSP)) _Thread_Priority_update (queue_context=0x2866c0) at /opt/work/chris/rtems/kernel/rtems.git/c/src/../../cpukit/score/src/threadchangepriority.c:344
     328(gdb) kill
     329Kill the program being debugged? (y or n) y
     330(gdb) q
     3341. The `-nx` is being used to stop loading any `.gdbinit` files. This done when testing the GDB connection. For a real development environment you should create a suitable `.gdbinit` file.
     3352. The remote port on the RTEMS target is `1122`. You can configure this in the RTEMS application.
     3363. Killing the session using the `kill` command reboots the target. If you have updated the executable on the TFTP before running this command a new version of the application will be download.