From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Ormaetxea Xabier <xormaetxea@ikerlan.es>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Launching Standalone in QEMU-Microblaze
Date: Mon, 3 Jul 2017 11:12:00 +0200 [thread overview]
Message-ID: <20170703091200.GF2201@toto> (raw)
In-Reply-To: <B1DA44315104F94D9F3F23C74275EA9D71DB63@Ikerlan-12.ikerlan.es>
On Mon, Jul 03, 2017 at 07:23:23AM +0000, Ormaetxea Xabier wrote:
> Hello!
Hi!
>
> I'm trying to run QEMU-Microblaze (Little-endian) with a standalone app in some different ways, but none of them works for me:
>
>
> 1) I have created my own .DTB from my system design (.HDF), just a microblaze connected to the Uartlite AXI, leds, interrupt controller, and a gpio. Using the board support package I've made a simple c-based program (at the end of the message):
>
> Run it with ./qemu-system-microblazeel -M microblaze-fdt-plnx -dtb system-top.dtb -kernel fibonacci.elf (-s -S) #(-s -S just to debug it)
>
> Invalid MicroBlaze version number: (null) #Don't think it's a problem
> Bar ram offset 9000528f
> Aborted (core dumped)
This indicates that you've linked your standalone app to some RAM you expect
to exist at around 0x90005000, but there's none.
You'll need to check that you are linking your standalone program correctly.
The baremetal BSP needs to match the HW.
>
>
> 2) I use a mb.dtb that I found on the internet. Same c-based program. Run it with the debugger:
>
> ./qemu-system-microblazeel -M microblaze-fdt-plnx -dtb mb.dtb -kernel fibonacci.elf (-s -S)
>
> Lets my debug it (doesn't fail booting), but in the first step:
> Bad ram pointer
>
> I suppose this isn't my option cause the .dtb is created for another microblaze-based design.
>
>
> 3) I use the same design (.HDF), but run it for the Spartan 3a dsp 1800 option:
>
> ./qemu-system-microblazeel -kernel fibonacci.elf (-s -S)
>
> Runs "properly" -> I mean properly because I can follow on the debugger that the steps are correctly made:
> _start -> _start1 -> main -> fibonacci -> xil_printf -> xil_printf ... -> xil_printf -> _exit
>
> But doesn't print nothing. And doesn't write in memory as asked (*addrPtr = 0x150) :
> In the qemu shell:
> (qemu) x 0xC0000000
> C0000000: 0x00000000 #When it should be 0x00000150
Try adding the -serial stdio commandline option to QEMU.
>
>
> 4) Modifying my system design to be similar to the Spartan board design:
> MEMORY_BASEADDR 0x90000000
> FLASH_BASEADDR 0xa0000000
> INTC_BASEADDR 0x81800000
> TIMER_BASEADDR 0x83c00000
> UARTLITE_BASEADDR 0x84000000
> ETHLITE_BASEADDR 0x81000000
> I get exactly the same result as in the (3) case.
>
> So here they go my questions:
>
> - Am I doing it right? Is this the method of running a standalone program over a microblaze?
Kind of but I get the impression that your bare-metal application is targeting
different hardware than what you are instructing QEMU to create.
>
> - How can I make the program print something?
>
> - Im not sure if the problem is that it doesn't write on memory, or I am the one who fails reading it from the shell, because if I change the writing position to (0x84000008, uart status position) I get the error (qemu: hardware error: write to UART STATUS?) -> that means im writing (or trying, at least). How can I write on memory (and read after it, so I know it works)?
I didn't quite understand why you wrote to 0xC0000000?
The spartan design in QEMU has nothing at that address.
Try 0x90000000 instead.
Best regards,
Edgar
>
> Thank you in advance! Really appreciate your Job! (I'm sorry if my problem it's a simple one, I'm new at it)
>
> #include <stdio.h>
> #include "platform.h"
> #include "xil_printf.h"
>
> void fibonacci(int d){
> u32 a=1;
> u32 b=0;
> u32 em=0;
> u32 *addrPtr = 0xC0000000;
>
> for(int num=0; num<d; num++){
> for(int i=0; i<a; i++){
> }
> for(int c=0; c<b; c++){
> }
> em = a+b;
> xil_printf(em);
> *addrPtr = 0x150;
> addrPtr+=1;
> b=a;
> a=em;
> }
> }
>
>
> int main()
> {
> init_platform();
> int i=35;
> fibonacci(i);
> cleanup_platform();
> return 0;
> }
prev parent reply other threads:[~2017-07-03 9:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-03 7:23 [Qemu-devel] Launching Standalone in QEMU-Microblaze Ormaetxea Xabier
2017-07-03 9:12 ` Edgar E. Iglesias [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170703091200.GF2201@toto \
--to=edgar.iglesias@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=xormaetxea@ikerlan.es \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.