Wednesday 2 June 2010

Xilinx Debugger XMD - MicroBlaze & External RAM

Just a quick recipe on how to download and run an application from externally connected memory on the MicroBlaze processor.

1.) Create a project in Xilinx EDK (start with xps from the command line), including MicroBlaze with debugging enabled.

2.) If you want speed then also enable cache and select the external memory to be cached later in the setup procedure. Enabling cache makes a huge difference in speed!

3.) In EDK's Applications tab, select 'Default: microblaze_0_bootloop' to initialise the block RAMs (BRAMs). This basically creates an infinite loop one the processor comes out of reset, preventing the system to crash, enabling the Xilinx debugger (XMD) to connect to the processor.

4.) Use impact to download the bit-file. Note that after this the processor is up and running and carrying out an infinite loop.

5.) Go to the command line and start XMD:

xmd
connect mb mdm
dow myapplication.elf
run
stop

These commands are quite straight forward (once you know them ;-)). They connect to the MicroBlaze (mb) memory debugger (mdm). With that kind of control over the memory, you can then download the binary (elf) of the application and tell the processor to run it.

Note that the elf file can be compiled either from EDK Applications tab or using mb-gcc, which is the microblaze C compiler.

No comments:

Post a Comment