Hello! 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) 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 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? - 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)? 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; }