This example uses the Microblaze with the AXI interface and the UARTlite and sends a "Hello World" message to the terminal.
This application works and has the reset issue that troubled the older designs fixed. (See the older designs here.)
See: MB_16p2_15
A quick outline of the design process is given below. However, for a detailed description with screen shots of each step see the attached PDF document.
In Vivado, create a Block Design; drag the System Clock from the "Board" tab into the design; run connection automation;
Double click on the reset port and set it to Active High;
Add the Microblaze IP from the IP sources; run block automation and use 32 kB ofr Local Memory ; don't use data and instruction cache; do not run connection automation!;
Instead, by hand connect the "reset" port to the Processor System Reset's "ext_reset_in."
Drag the USB UART from the Board into the design (double click it to change the BAUD rate to 115000) and run connection automation;
Verify design; also double click on the Processor System Reset; the ext_reset_in AUTO should be set to Active High (1) for it work; (if this is not the case you must replace the Processor System Reset ip!);
Create the design Wrapper by clicking in the Block Design on the Design_1 and selecting "Create Design Wrapper";
run synthesis
File / Export / Export Hardware (do not include the bitstream)
File / Launch SDK
In SDK, create File / New / Application Project / give it a name and select the hello world project.
Back in Vivado, generate the bitstream; while it's churning along, open the a Terminal program (or use SDK) and connect to your remaining USB port.
Once the bitstream has been generated, use the hardware manager to program the board. You should see in your terminal program the "Hello World" message.
Also, each time you press the design's reset button on the BASYS board, which is the center button, BTNC, and NOT the upper red button, you should see the "Hello world" message in the terminal window.
If this outline is too brief, then read the attached PDF.
if you want to explore the capability that the embedded processor and SDK provides then modify your hello world source file in SDK so it resembles the one below. You will find the C file in your SDK's application project "src" folder. Double click on it and edit it or simply copy / paste the instructions below into it and save all your changes. Back in Vivado, Generate a Bitstream and then (re) program the board. (There's no need to update the ELF files in Vivado.)
#include <stdio.h>
#include "platform.h"
#include "xil_printf.h"
#include "microblaze_sleep.h"
int main()
{
u8 i;
init_platform();
for(i = 0; i < 10; i++)
{
xil_printf("Hello again %u\n\r",i);
MB_Sleep(1000);
}
cleanup_platform();
return 0;
}
Once you have programmed the board you should in your terminal program see the message. It updates once a second for 10 times; it also displays the current iteration number. Feel free to explore the program and change its various parameters.
This timing diagram shows (from top to bottom):
Trace 1: "reset" (port) has been released. (When BTNC is pressed, reset is high.)
Trace 2: Clocking Wizard "locked" output goes high 22 usec later. See the picture below for a more detailed view of this event.
Trace 3: Processor System Reset mb_reset goes high 10 usec aftr "reset" has been released but goes low again when "locked" goes high.
Trace 4: Processor System Reset peripheral aresetn is the opposite of trace 3.
Zooming in on the low high transition 22 usec after the reset has been released shows that the other events happen at distinct times. Once "locked" (trace 2) has gone high, 500 nsec later arestn (trace 4) goes high and about 200 nesec after this mb_reset (trace 3) goes low. The system clock is running at 100 MHz or 10 nsec.