Jump to content
  • 0

Running Linux on Arty Microblaze, no console output


loberman

Question

Hello

Referencing this article:

http://rdepablos.merlitec.com/arty-and-linux-1-fpga

Built a Microblaze design for Arty and set the serial to 115200. All tests pass, memory tests, hello world etc, all display to the console.

I then went ahead and built a device_tree setup and copied this to the Linux kernel tree and built the kernel using a hopefully correct defconfig file but after downloading using xmd I see no output on the console after I start the processor at the correct address.

The cursor stops blinking after 20s but I dont see the kernel load.

The design appears correct with the correct boot address in the Linux kernel .config file

JTAG chain configuration
--------------------------------------------------
Device   ID Code        IR Length    Part Name
 1       0362d093           6        xc7a35t

MicroBlaze Processor Configuration :
-------------------------------------
Version............................0x24 - UnSupported Version
Optimization.......................Performance
Interconnect.......................AXI-LE
MMU Type...........................Full_MMU    *** Note
No of PC Breakpoints...............1
No of Read Addr/Data Watchpoints...0
No of Write Addr/Data Watchpoints..0
Instruction Cache Support..........on
Instruction Cache Base Address.....0x80000000
Instruction Cache High Address.....0x8fffffff
Data Cache Support.................on
Data Cache Base Address............0x80000000    *** Note
Data Cache High Address............0x8fffffff
Exceptions  Support................on
FPU  Support.......................off
Hard Divider Support...............on
Hard Multiplier Support............on - (Mul64)
Barrel Shifter Support.............on
MSR clr/set Instruction Support....on
Compare Instruction Support........on
PVR Supported......................on
PVR Configuration Type.............Full
Data Cache Write-back Support......off
Fault Tolerance Support............off
Stack Protection Support...........off

Can anybody tell me what is wrong with the kernel build, I am downloading simpleImage.artylinux prior to con

Image Name:   Linux-3.18.0-gd627f5d-dirty
Created:      Sun Nov  5 17:13:20 2017
Image Type:   MicroBlaze Linux Kernel Image (uncompressed)
Data Size:    43231110 Bytes = 42217.88 kB = 41.23 MB
Load Address: 80000000
Entry Point:  80000000
  STRIP   arch/microblaze/boot/simpleImage.artylinux
Kernel: arch/microblaze/boot/simpleImage.artylinux is ready  (#18)

I am attaching my config and DTS file

artylinux.dts

artylinux_defconfig

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

Hi @loberman,

I have not implemented petalinux on an Artix-7 fpga. I did reach out to more experience embedded linux engineers to see if they had any input. With that being said i know that we have not made a petalinux platform on the arty or on microblaze so I do not think that we will have much input with this. I did find some xilinx forum threads talking about using microblaze and petalinux here and here

thank you,

Jon

Link to comment
Share on other sites

I will use the petalinux project to compare to my design and methods, I am sure something will show me why my kernel is not booting.

The key here was to do this using a generic kernel snap from the XIlinx Linux kernel tree and build it manually.

I will document what I needed to do to make it work and thanks

Link to comment
Share on other sites

I see the same address. so I think my original design in Vivado may be missing some stuff, although all the standalone tests worked on it.

As soon as I figure out whats going on will post back here.

Back in my Xilinx Spartan6 days some 5 years ago I built the whole of the Linux Microblaze Linux kernel manually after the design was done in ISE/EDK.

I checked the usual suspects of stuff that may be missing but clearly I have missed something.

My focus now is to do the same.

Many Thanks

Laurence

Link to comment
Share on other sites

Hello

Still fighting with the Manual Build here for Microblaze on Arty. The SP605 is working fine but I did that 5 years ago with ISE 13.4, Not Vivado.

My design runs Linux fine using Petalinux but I dont want to use Petalinux,

I have moved to the Arty Z7 20 and Zynq and am now looking at a manual (non petalinux) build of Linux there.

Steps described on the Xilinx site are mostly clear but the creation of the dts lands up creating two files which I believe need to be combined into one dts file before using the script to create the dtb

Using the SDK I landed up with the below files

./Artyz20project_1.sdk/device_tree_bsp_0/pcw.dtsi
./Artyz20project_1.sdk/device_tree_bsp_0/pl.dtsi
./Artyz20project_1.sdk/device_tree_bsp_0/system-top.dts                   ********   Do these two have to be combined
./Artyz20project_1.sdk/device_tree_bsp_0/system.dts                         ********   
./Artyz20project_1.sdk/device_tree_bsp_0/skeleton.dtsi
./Artyz20project_1.sdk/device_tree_bsp_0/zynq-7000.dtsi
 

I will of course create detailed notes once I get this all working and share it back.

Building the linxu kernel and getting the board up without Petalinux is very important for me.

 

Regards

Laurence

Link to comment
Share on other sites

Hello Folks

So I have this all working now, I landed up going with Petalinux as it builds fine for both Microblaze and Zynq.

Access to the shield (IO26 to IO41 is working fine on the Arty from Microblaze using the gpio sysfs control.

I was able to figure out the numbering of the gpio to export there.

However I am having issues figuring out on the Arty Z720 pin numbering for the GPIO.

I will create a separate post for that

Thanks

Laurence

 

 

Link to comment
Share on other sites

Update on manual kernel building for Micro-blaze on Arty

So it took a long time but I managed to get this working.

I wanted to have manual control because Petalinux hides a lot of stuff and trying to debug the flash kernel load for example was very frustrating.

I could not even figure out how to turn debugging on in the fs-boot code. I made changes to the source but it reset each time so I went back to getting manual kernel builds working.

I followed this process in case others are interested

This is Very Important to NOTE, this is the LE Little Endian architecture for Microblaze

Set the ISE environment to get the microblaze compiler for le
. /opt/Xilinx/14.7/ISE_DS/settings64.sh

export CROSS_COMPILE=microblazeel-xilinx-linux-gnu-

Clone the kernel
git clone https://github.com/Xilinx/linux-xlnx.git
cd xlnx.git

Copy over device tree built using vivado, mine is called artylinux.dts to  arch/microblaze/boot/dts in the kernel tree

Dont forget to merge device_tree_bsp_0/pl.dtsi and device_tree_bsp_0/system-top.dts as created by Vivado.

Run a default config
make ARCH=microblaze mmu_defconfig

Copy over initramfs to root of build
 I used the minimal from petalinux tree and called it initramfs_minimal_le.cpio.gz
 Modify configuration and set the following

CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="initramfs_minimal_le.cpio.gz"

##
make ARCH=microblaze simpleImage.artylinux
Download image using xmd and it should all work.

Shouts out to this forum, as well as Jeff and Jon for the prior help here as well as Raul.

Next steps are get fs-boot working, then u-boot and the kernel loading from flash not using Petalinux

Following that working on getting SD card access working using the PMOD-SD.

Thanks

Laurence

Link to comment
Share on other sites

One other issue I chased for TWO WEEKS.

The block automation connects the wrong clock for Arty. This was why I had all the issues with the flash boot. !!!!

Ensure you connect it to the axi_clk.

I have it all working now, Petalinux and Full manual kernel build as well.

I will follow up next week with a proper document with screen shots if anybody thinks that would be helpful.

Its a combination of help received in this thread and lots of searching.

Arty and flsh boot/manual kernel builds are not for the impatient. Its been many weeks to get to this point.

Thanks

Laurence

 

 

Link to comment
Share on other sites

Jon

 I am still having issues it seems with writing the kernel binary to flash here for loading the kernel bin file from flash and its driving me crazy.

I am reading serial flash data using readbuffer using the example bootloader from Raul's awesome post but I keep seeing the same flips so my kernel is not booting.

The same design starts the bootloader and runs the kernel fine running out of memory its when I try load from flash that the data transferred into memory is wrong.

Its almost as if the Vivado tools are messing up the the flash write of my kernel because the reads are consistently showing the wrong data.

I tried multiple ways to write the flash

 I instrumented the code here in the boot loader and the data read sees certain bytes not matching the kernel byte stream.

Here is an example

Loading BIN image from flash @ address: 00500000
Address = 80000000 : 9400 C001 
Address = 80000004 : 9400 C800 
Address = 80000008 : 2100 FFFF 
Address = 8000000C : 9408 C802 
Address = 80000010 : 9420 8001 
Address = 80000014 : 9511 0000 
Address = 80000018 : 1508 0803 
Address = 8000001C : BC07 0050 
Address = 80000020 : B000 803C                       ******** Note Should be b000 803b
Address = 80000024 : E160 9000 
Address = 80000028 : BE0B 000C                                                         
Address = 8000002C : C960 3800 
Address = 80000030 : C960 3A00 
Address = 80000034 : B000 D00D 
Address = 80000038 : 256B FEED 
Address = 8000003C : BC0B 000C 
Address = 80000040 : 80E0 0000 
Address = 80000044 : BC2B 0028 
Address = 80000048 : 8160 0000 
Address = 8000004C : B000 803C 
Address = 80000050 : A080 0288 
Address = 80000054 : A060 7FFC 
Address = 80000058 : C987 5800 
Address = 8000005C : D984 5800 
Address = 80000060 : 316B 0004 
Address = 80000064 : BE83 FFF4 

Here is the actual kernel binary dump

simpleImage.artylinux:     file format elf32-microblazeel


Disassembly of section .text:

c0000000 <.text>:
c0000000:       9400c001        mts     rmsr, r0
c0000004:       9400c800        mts     rslr, r0
c0000008:       2100ffff        addi    r8, r0, -1
c000000c:       9408c802        mts     rshr, r8
c0000010:       94208001        mfs     r1, rmsr
c0000014:       95110000        msrclr  r8, 0
c0000018:       15080803        cmpu    r8, r8, r1
c000001c:       bc070050        beqi    r7, 80          // c000006c
c0000020:       b000803b        imm     -32709                                                                    This is the correct line
c0000024:       e160d000        lbui    r11, r0, -12288
c0000028:       be0b000c        beqid   r11, 12         // c0000034
c000002c:       c9603800        lw      r11, r0, r7
c0000030:       c9603a00        lwr     r11, r0, r7
c0000034:       b000d00d        imm     -12275
c0000038:       256bfeed        rsubi   r11, r11, -275
c000003c:       bc0b000c        beqi    r11, 12         // c0000048
c0000040:       80e00000        or      r7, r0, r0
c0000044:       bc2b0028        bnei    r11, 40         // c000006c
c0000048:       81600000        or      r11, r0, r0
c000004c:       b000803b        imm     -32709
c0000050:       a0804858        ori     r4, r0, 18520
c0000054:       a0607ffc        ori     r3, r0, 32764
c0000058:       c9875800        lw      r12, r7, r11
c000005c:       d9845800        sw      r12, r4, r11
c0000060:       316b0004        addik   r11, r11, 4
c0000064:       be83fff4        bgtid   r3, -12         // c0000058
c0000068:       3063fffc        addik   r3, r3, -4
c000006c:       80000000        or      r0, r0, r0
c0000070:       3060003f        addik   r3, r0, 63

I am at the point where I have spent so much time trying to debug this I may have to just give up,

I refuse to use Petalinux and over the years have spent a fortune with Diglient but the Arty has been a challenge to be honest.

Can somebody shed some light on what is wrong here. 

Link to comment
Share on other sites

Groan

The bitstream was at x1 and not at x4 and this was the root of the issue.

The Constraint was being ignored. It worked last week because I ran it manually

In Tcl I had used

set_property BITSTREAM.Config.SPI_BUSWIDTH 4 [current_design]

And when you use the SDK to create the bitstream it defaults to 1 and not 4

So I was programming at x1 when it was set to x4

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...