Hi all,
I am trying to drive a GPIO pin directily from a bare metal program running on the R5F of an TE0802, without routing it through the FPGA, but directly using MIO18 instead, which goes to the Grove connector. The A53 is only running the boot loader.
I have reconfigured the Trenz HW specification in Vivado to disable I2C and enable GPIO on MIO18 and MIO19. However, the following code does not work, the pin is always high, any ideas?
#define GPIO_PIN 18
#define GPIO_OUTPUT_DIR 1
#define GPIO_LOW 0
#define GPIO_HIGH 1
XGpioPs gpio;
XGpioPs_Config *gpio_cfg = XGpioPs_LookupConfig(GPIO_DEVICE_ID);
int gpio_status = XGpioPs_CfgInitialize(&gpio, gpio_cfg, gpio_cfg->BaseAddr);
if (gpio_status != XST_SUCCESS) {
printf("ERROR: could not initialize gpio driver \r\n");
}
XGpioPs_SetDirectionPin(&gpio, GPIO_PIN, GPIO_OUTPUT_DIR);
XGpioPs_SetOutputEnablePin(&gpio, GPIO_PIN, 1);
while(1) {
usleep(50000);
XGpioPs_WritePin(&gpio, GPIO_PIN, GPIO_LOW);
usleep(50000);
XGpioPs_WritePin(&gpio, GPIO_PIN, GPIO_HIGH);
}