Hello!
This is my first post here and hopefully I don't break any forum rules! I am a software engineer by profession but I am starting to learn FPGAs.
I have an ArtyZ7-10 board. I have been trying these past couple of days to get a simple bare metal program to work. The program is a simple Hello World that is sent over the UART communication every 5 seconds. Below is my block design
It's a pretty simple block diagram using the ZYNQ7 PS. I have enabled UART1 as seen below (well also UART0 but ignoring that for now)
My code is below (using the example Hello World program)
/******************************************************************************
* Copyright (C) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
* SPDX-License-Identifier: MIT
******************************************************************************/
/*
* helloworld.c: simple test application
*
* This application configures UART 16550 to baud rate 9600.
* PS7 UART (Zynq) is not initialized by this application, since
* bootrom/bsp configures it to baud rate 115200
*
* ------------------------------------------------
* | UART TYPE BAUD RATE |
* ------------------------------------------------
* uartns550 9600
* uartlite Configurable only in HW design
* ps7_uart 115200 (configured by bootrom/bsp)
*/
#include <stdio.h>
#include "sleep.h"
#include "platform.h"
#include "xil_printf.h"
int main()
{
init_platform();
// Please just keep printing out something. Or print anything at all please
while (1) {
printf("Hello World!\r\n");
usleep(5000000);
}
cleanup_platform();
return 0;
}
Now when I tested this why the Arty board connected up (the jumpers are on the JTAG and I am using an external 15v power supply), it programs the board correctly, but then nothing seems to happen. The RX led does not send anything. I downloaded the out of box demo code. I first switched out my design with that and it didn't work. I then switched out my generated ps7_init.tcl file with the out of box demo's ps7_init.tcl file and it worked. Using the same out of box ps7_init.tcl file, I switched back to my bitstream design and it still worked.
So I am having trouble understanding why the out of box ps7_init file would work but my generated one won't set up UART correctly. I have created a wrapper in my design and I did export it out to the XSA file and imported that correctly. Any time I make a change to the design (which really doesn't happen), I regenerate the wrapper and then re-export and then update the XSA reference in Vitis.
Does anyone have an idea of where I am going wrong? Again I am pretty new to the realm of FPGAs and hardware so I am sorry if I ask any dumb questions.
EDIT: I should also note that I do have my serial terminal set up correctly. I am using Tera Term. I can provide my ps7_init file upon request but I don't know how much help that would be.