- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Microblaze : Boot Program from SDRAM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
05-08-2010 02:46 PM
Hello everybody!!
I spent 3 days on it without success and after it I decided to searching for an help.
I have a Virtex-II system with Microblaze 7.10.d and external SDRAM memory. The hardware and software system correctly working and the usual "hello world" and "blinking leds" programs work properly.
Since I plan to use linux on it, I start preparing a bootloader to be stored into BRAM. In order to perform some test, I prepare two projects in EDK: the bootloader and the SDRAM application. The bootloader waits for a "magic word" (0xDEADBEEF) from PCI bus before starting. From PCI bus I load the second application in SDRAM in the correct location (I create the bin file using mb-objcopy -O binary).
When the program receives the "magic word", the program jump to the SDRAM address. But no console output is visible...I try to manually insert the interrupt/reset/exception vectors but nothing change.
Here's the codes
//BOOTLOADER PROGRAM
#include "xparameters.h"
#include "xbasic_types.h"
#include "xgpio.h"
#include "gpio_header.h"
//================================================
void (*app_start)();
int main (void) {
#if XPAR_MICROBLAZE_0_USE_ICACHE
microblaze_init_icache_range(0, XPAR_MICROBLAZE_0_CACHE_BYTE_SIZE);
microblaze_enable_icache();
#endif
#if XPAR_MICROBLAZE_0_USE_DCACHE
microblaze_init_dcache_range(0, XPAR_MICROBLAZE_0_DCACHE_BYTE_SIZE);
microblaze_enable_dcache();
#endif
xil_printf("waiting for magic word\n");
Xuint32 magic_word=0;
do
{
magic_word = XIo_In32(XPAR_PLBV46_LOCAL_BRIDGE_0_BASEADDR+0X10)
}while(magic_word!=0xDEADBEEF);
XIo_Out32(XPAR_OPB_GPIO_0_BASEADDR,0xFFFFFFFF);
xil_printf("magic word received\n");
#if XPAR_MICROBLAZE_0_USE_DCACHE
microblaze_disable_dcache();
microblaze_init_dcache_range(0, XPAR_MICROBLAZE_0_DCACHE_BYTE_SIZE);
#endif
#if XPAR_MICROBLAZE_0_USE_ICACHE
microblaze_disable_icache();
microblaze_init_icache_range(0, XPAR_MICROBLAZE_0_CACHE_BYTE_SIZE);
#endif
app_start = 0x44000000;
app_start();
return 0;
}
// SDRAM APPLICATION
#include "xparameters.h"
#include "xbasic_types.h"
#include "xgpio.h"
int main (void) {
#if XPAR_MICROBLAZE_0_USE_ICACHE
microblaze_init_icache_range(0, XPAR_MICROBLAZE_0_CACHE_BYTE_SIZE);
microblaze_enable_icache();
#endif
#if XPAR_MICROBLAZE_0_USE_DCACHE
microblaze_init_dcache_range(0, XPAR_MICROBLAZE_0_DCACHE_BYTE_SIZE);
microblaze_enable_dcache();
#endif
xil_printf("Hello World, I'm the one in the SDRAM!!\n");
#if XPAR_MICROBLAZE_0_USE_DCACHE
microblaze_disable_dcache();
microblaze_init_dcache_range(0, XPAR_MICROBLAZE_0_DCACHE_BYTE_SIZE);
#endif
#if XPAR_MICROBLAZE_0_USE_ICACHE
microblaze_disable_icache();
microblaze_init_icache_range(0, XPAR_MICROBLAZE_0_CACHE_BYTE_SIZE);
#endif
return 0;
}
What's wrong?!? Please help me!!!
Thanks for your attention











