Hello. I am new to the Xilinx platform and I'm getting started using a TE0715-04-73E33-A board plugged into a TE0701-05 carrier card.
The first thing I did was run 'Hello World' by loading the prebuilt hardware definition (test_board_04_30_3e_1gb.xsa) in Vitis 2022.2 and loading the hello world example. This worked fine and was able to output to Tera Term with no issues.
Next, I want to do a blinking LED using the code (below) but it doesn't work because 'XPAR_GPIO0_BASEADDR' is not defined.
Do I need to create my own hardware definition in Vivardo and add the axi_gpio_0 block? If so which board interfaces am I supposed to set? The board interfaces are: asio, p1a, p1b, p2a, p2b, p2c, p3 but I can't find where these are defined.
I really appreciate the help. Thank you.
#include <stdio.h>
#include <xstatus.h>
#include "platform.h"
#include "xil_printf.h"
#include "xgpiops.h"
#include "xparameters.h"
#include "sleep.h"
XGpioPs gpio;
void gpio_init()
{
XGpioPs_Config *gpioConfig;
gpioConfig = XGpioPs_LookupConfig(XPS_GPIO_BASEADDR); //XPAR_GPIO0_BASEADDR
if(gpioConfig==NULL) xil_printf("GPIO Config Error...");
int status =XGpioPs_CfgInitialize(&gpio, gpioConfig, gpioConfig->BaseAddr);
if (status==XST_SUCCESS) xil_printf("GPIO initialization Successful...\r\n");
XGpioPs_SetDirectionPin(&gpio, 7, 1);
XGpioPs_SetOutputEnablePin(&gpio, 7, 1);
}
int main()
{
init_platform();
gpio_init();
while(1)
{
XGpioPs_WritePin(&gpio, 7, 1);
sleep(1);
XGpioPs_WritePin(&gpio, 7, 0);
sleep(1);
}
return 0;
}
Hi,
you want to change MIO7 (Zynq PS IO) --> Green LED1 (Designator D2)?
This is connected to PS MIO, please check this example:
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841744/Gpio-PS+standalone+driver
--> https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/gpiops
MIO GPIO are activated on the reference design.
You can import this examples over Vitis Platform Board Support Package for standalone applications.
br
John
br
John