• 0
emarte

Problem wih Arty S7-50 mapping I/o Pins

Question

Hello All!

I have a Arty S7-50 Rev B Board. I am trying to control a mobile robot . I am also using a camera and to talk to both of them I need either I2c or serial communication.

So far I created my system using microblaze with no problem. I tested leds, buttons, uart communication etc. 

My problem comes when I try to map pins other than buttons, leds or switch. I haven't been able to put the system to work. 

Quote

Edit: I am not been able to map signals to other pins. I need communication like I2C or serial and I can't signals out. I can't even get simple signals liked led to other ports.

I Tried testing all I could think of before coming to the forums. I saved the project as another one, Created a new one from scratch etc etc and nothing so far. It have been many days if not weeks working in this part. I am pretty confidence about my design and about what I have to do with the robot. What I can't not is get signals out. So at this moment I'll give you some print screen of what I have. I could have some mistakes but it have been a lot of copy and paste and change so I got nowhere to go. I hope some of you could point me on where or how to go.

 

image.png.b9180b2089c3b51f967919238ec9c14f.png

I have this system with all this IP but at the beginning I was testing one by one. I need wither 2 uartlite o 1 I2c working.

image.png.d1d3fa2adb20031dfab050d568c515ee.png

I know the microblaze, gpio0, timer and interrupt is working.

image.thumb.png.7ddce07a9afadaafbe6c5d1f111679b7.png

 

Constraints: I had played a lot with this, this is the las I got.

## Switches
set_property -dict { PACKAGE_PIN H14   IOSTANDARD LVCMOS33 } [get_ports { sw[0] }]; #IO_L20N_T3_A19_15 Sch=sw[0]
set_property -dict { PACKAGE_PIN H18   IOSTANDARD LVCMOS33 } [get_ports { sw[1] }]; #IO_L21P_T3_DQS_15 Sch=sw[1]
set_property -dict { PACKAGE_PIN G18   IOSTANDARD LVCMOS33 } [get_ports { sw[2] }]; #IO_L21N_T3_DQS_A18_15 Sch=sw[2]
set_property -dict { PACKAGE_PIN M5    IOSTANDARD SSTL135 } [get_ports { sw[3] }]; #IO_L6N_T0_VREF_34 Sch=sw[3]

## Buttons
set_property -dict { PACKAGE_PIN G15   IOSTANDARD LVCMOS33 } [get_ports { btn[0] }]; #IO_L18N_T2_A23_15 Sch=btn[0]
set_property -dict { PACKAGE_PIN K16   IOSTANDARD LVCMOS33 } [get_ports { btn[1] }]; #IO_L19P_T3_A22_15 Sch=btn[1]
set_property -dict { PACKAGE_PIN J16   IOSTANDARD LVCMOS33 } [get_ports { btn[2] }]; #IO_L19N_T3_A21_VREF_15 Sch=btn[2]
set_property -dict { PACKAGE_PIN H13   IOSTANDARD LVCMOS33 } [get_ports { btn[3] }]; #IO_L20P_T3_A20_15 Sch=btn[3]

## Pmod Header JA
#//set_property -dict { PACKAGE_PIN L17   IOSTANDARD LVCMOS33 } [get_ports { jap }]; #IO_L4P_T0_D04_14 Sch=ja_p[1]
set_property -dict { PACKAGE_PIN L17   IOSTANDARD LVCMOS33 } [get_ports { led2 }]; #IO_L4P_T0_D04_14 Sch=ja_p[1]

## Pmod Header JD
##//set_property -dict { PACKAGE_PIN V15   IOSTANDARD LVCMOS33 } [get_ports { jap }]; #IO_L20N_T3_A07_D23_14 Sch=jd1/ck_io[33]

set_property -dict { PACKAGE_PIN T13   IOSTANDARD LVCMOS33 } [get_ports { tx_1 }]; #IO_L21P_T3_DQS_14 Sch=jd2/ck_io[32]
set_property -dict { PACKAGE_PIN R11   IOSTANDARD LVCMOS33 } [get_ports { rx_1 }]; #IO_L21N_T3_DQS_A06_D22_14 Sch=jd3/ck_io[31]
set_property -dict { PACKAGE_PIN T11   IOSTANDARD LVCMOS33 } [get_ports { tx_0 }]; #IO_L23N_T3_A02_D18_14 Sch=jd9/ck_io[27]
set_property -dict { PACKAGE_PIN U11   IOSTANDARD LVCMOS33 } [get_ports { rx_0 }]; #IO_L24P_T3_A01_D17_14 Sch=jd10/ck_io[26]

set_property -dict { PACKAGE_PIN V15   IOSTANDARD LVCMOS33 } [get_ports { leds[0] }]; #IO_L16N_T2_A27_15 Sch=led[2]
set_property -dict { PACKAGE_PIN U12   IOSTANDARD LVCMOS33 } [get_ports { leds[1] }]; #IO_L17P_T2_A26_15 Sch=led[3]
set_property -dict { PACKAGE_PIN V13   IOSTANDARD LVCMOS33 } [get_ports { leds[2] }]; #IO_L17N_T2_A25_15 Sch=led[4]
set_property -dict { PACKAGE_PIN T12   IOSTANDARD LVCMOS33 } [get_ports { leds[3] }]; #IO_L18P_T2_A24_15 Sch=led[5]

## USB-UART Interface
set_property -dict { PACKAGE_PIN R12   IOSTANDARD LVCMOS33 } [get_ports { uart_rxd_out }]; #IO_25_14 Sch=uart_rxd_out
set_property -dict { PACKAGE_PIN V12   IOSTANDARD LVCMOS33 } [get_ports { uart_txd_in }]; #IO_L24N_T3_A00_D16_14 Sch=uart_txd_in

## ChipKit I2C
set_property -dict { PACKAGE_PIN J14   IOSTANDARD LVCMOS33 } [get_ports { ck_scl }]; #IO_L24N_T3_RS0_15 Sch=ck_scl
set_property -dict { PACKAGE_PIN J13   IOSTANDARD LVCMOS33 } [get_ports { ck_sda }]; #IO_L24P_T3_RS1_15 Sch=ck_sda

## Configuration options, can be used for all designs
set_property BITSTREAM.CONFIG.CONFIGRATE 50 [current_design]
set_property CONFIG_VOLTAGE 3.3 [current_design]
set_property CFGBVS VCCO [current_design]
set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design]
set_property CONFIG_MODE SPIx4 [current_design]

## SW3 is assigned to a pin M5 in the 1.35v bank. This pin can also be used as
## the VREF for BANK 34. To ensure that SW3 does not define the reference voltage
## and to be able to use this pin as an ordinary I/O the following property must
## be set to enable an internal VREF for BANK 34. Since a 1.35v supply is being
## used the internal reference is set to half that value (i.e. 0.675v). Note that
## this property must be set even if SW3 is not used in the design.
set_property INTERNAL_VREF 0.675 [get_iobanks 34]

 

Schematic Elaborated Design: From what I see eveything it is fine, isn't it ?

image.thumb.png.4105dde965d547df10359b41a3c5f8f9.png

 

I/O Pots on Schematic

image.thumb.png.b3703f81195e6e1ee3bb84e2f3f9103a.png

 

I/O Ports on Synthesized Design

 

image.thumb.png.d8672ef207e77b8a9c65a9363d0ff62c.png

 

Code of Sliding LEDS using timer on LEDS: This is funny, these are some sliding leds. It does not matter where I put / map this pins on contraints, this always light the leds. I was tring to map this in pmod header JD but it just ligh the leds.

Spoiler



/******************************************************************************
*
* Copyright (C) 2002 - 2014 Xilinx, Inc.  All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* Use of the Software is limited solely to applications:
* (a) running on a Xilinx device, or
* (b) that interact with a Xilinx device through a bus or interconnect.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* XILINX  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of the Xilinx shall not be used
* in advertising or otherwise to promote the sale, use or other dealings in
* this Software without prior written authorization from Xilinx.
*
******************************************************************************/
/*****************************************************************************/
/**
* @file  xtmrctr_low_level_example.c
*
* This file contains a design example using the Timer Counter (XTmrCtr)
* low level driver and hardware device in a polled mode.
*
* @note
*
* None
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver   Who  Date	 Changes
* ----- ---- -------- -----------------------------------------------
* 1.00b jhl  02/13/02 First release
* 1.00b sv   04/26/05 Minor changes to comply to Doxygen and coding guidelines
* 2.00a ktn  10/30/09 Updated the example as the macros in the driver are
*                     renamed by removing _m in the definition.
*                     Minor changes as per coding guidelines are done.
* 4.2   ms   01/23/17 Added xil_printf statement in main function to
*                     ensure that "Successfully ran" and "Failed" strings
*                     are available in all examples. This is a fix for
*                     CR-965028.
*</pre>
******************************************************************************/

/***************************** Include Files *********************************/

/*#include "xparameters.h"
#include "xstatus.h"
#include "xtmrctr_l.h"
#include "xil_printf.h"*/

#include <stdio.h>
//#include "platform.h"
#include "xparameters.h"
#include "xstatus.h"
#include "xintc.h"
#include "xil_exception.h"
#include "xtmrctr.h"
#include "xgpio.h"
#include "xil_printf.h"



/************************** Constant Definitions *****************************/

/*
 * The following constants map to the XPAR parameters created in the
 * xparameters.h file. They are only defined here such that a user can easily
 * change all the needed parameters in one place.
 */


#define LED 0x01   /* Assumes bit 0 of GPIO is connected to an LED  */

/*
 * The following constants map to the XPAR parameters created in the
 * xparameters.h file. They are defined here such that a user can easily
 * change all the needed parameters in one place.
 */
#define GPIO_EXAMPLE_DEVICE_ID  XPAR_GPIO_0_DEVICE_ID
#define GPIO_EXAMPLE_DEVICE_ID2  XPAR_GPIO_2_DEVICE_ID

/*
 * The following constant is used to wait after an LED is turned on to make
 * sure that it is visible to the human eye.  This constant might need to be
 * tuned for faster or slower processor speeds.
 */
#define LED_DELAY     10000000

/*
 * The following constant is used to determine which channel of the GPIO is
 * used for the LED if there are 2 channels supported.
 */
#define LED_CHANNEL 1
#define TMRCTR_BASEADDR		XPAR_TMRCTR_0_BASEADDR

/*
 * This example only uses the 1st of the 2 timer counters contained in a
 * single timer counter hardware device
 */
#define TIMER_COUNTER_0	 0

/**************************** Type Definitions *******************************/


/***************** Macros (Inline Functions) Definitions *********************/


/************************** Function Prototypes ******************************/

int delay_int(u32 TmrCtrBaseAddress, u8 TimerCounter);
void delay_ms(int value);

/************************** Variable Definitions *****************************/


/*****************************************************************************/
/**
* This function is the main function of the Tmrctr low level example.
*
* @param	None.
*
* @return	XST_SUCCESS to indicate success, else XST_FAILURE to indicate
*		a Failure.
*
* @note		None.
*
*
*****************************************************************************/


/**************************** Type Definitions *******************************/


/***************** Macros (Inline Functions) Definitions *********************/

#ifdef PRE_2_00A_APPLICATION

/*
 * The following macros are provided to allow an application to compile that
 * uses an older version of the driver (pre 2.00a) which did not have a channel
 * parameter. Note that the channel parameter is fixed as channel 1.
 */
#define XGpio_SetDataDirection(InstancePtr, DirectionMask) \
        XGpio_SetDataDirection(InstancePtr, LED_CHANNEL, DirectionMask)

#define XGpio_DiscreteRead(InstancePtr) \
        XGpio_DiscreteRead(InstancePtr, LED_CHANNEL)

#define XGpio_DiscreteWrite(InstancePtr, Mask) \
        XGpio_DiscreteWrite(InstancePtr, LED_CHANNEL, Mask)

#define XGpio_DiscreteSet(InstancePtr, Mask) \
        XGpio_DiscreteSet(InstancePtr, LED_CHANNEL, Mask)

#endif


XGpio Gpio; /* The Instance of the GPIO Driver */


int main(void)
{
	int Status;
	int cuenta;

	/* Initialize the GPIO driver */
		Status = XGpio_Initialize(&Gpio, GPIO_EXAMPLE_DEVICE_ID);
		if (Status != XST_SUCCESS) {
			xil_printf("Gpio Initialization Failed\r\n");
			return XST_FAILURE;
		}

		/* Set the direction for all signals as inputs except the LED output */
		XGpio_SetDataDirection(&Gpio, LED_CHANNEL, 0);

/*
		Status = XGpio_Initialize(&Gpio, GPIO_EXAMPLE_DEVICE_ID2);
				if (Status != XST_SUCCESS) {
					xil_printf("Gpio Initialization Failed \r\n");
					return XST_FAILURE;
				}

				/* Set the direction for all signals as inputs except the LED output */
				//XGpio_SetDataDirection(&Gpio, LED_CHANNEL, 0);


while(1)
{



	//while(1)
	{
			{
		  	Xil_Out32(XPAR_AXI_GPIO_2_BASEADDR, 1);
		    delay_ms(1000);
		  	Xil_Out32(XPAR_AXI_GPIO_2_BASEADDR, 0);
		  	delay_ms(1000);
			}
	}

	cuenta=0;
			while(cuenta<16)
			{
		  	Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, cuenta);
		    delay_ms(200);
		  	cuenta++;
			}

	cuenta=0;
		while(cuenta<5)
		{
	  	Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 1);
	    delay_ms(200);
	  	Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 2);
	  	delay_ms(200);
	    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 4);
	    delay_ms(200);
	    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 8);
	    delay_ms(200);
	    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 0);
	    delay_ms(200);
		}

		cuenta=0;
			while(cuenta<5)
			{
		  	Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 8);
		    delay_ms(200);
		  	Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 4);
		  	delay_ms(200);
		    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 2);
		    delay_ms(200);
		    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 1);
		    delay_ms(500);
		    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 0);
		    delay_ms(200);
		    cuenta++;
			}


			cuenta=0;
				while(cuenta<5)
				{
			  	Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 9);
			    delay_ms(200);
			  	Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 6);
			  	delay_ms(200);
			    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 9);
			    delay_ms(200);
			    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 0);
			    delay_ms(200);
			    cuenta++;
				}


				cuenta=0;
					while(cuenta<5)
					{
				  	Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 1);
				    delay_ms(200);
				  	Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 3);
				  	delay_ms(200);
				    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 7);
				    delay_ms(200);
				    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 15);
				    delay_ms(200);
				    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 0);
				    delay_ms(200);
				    cuenta++;
					}


					cuenta=0;
						while(cuenta<5)
						{
					  	Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 1);
					    delay_ms(200);
					  	Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 3);
					  	delay_ms(200);
					    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 7);
					    delay_ms(200);

					    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 15);
					    				    delay_ms(200);
					    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 7);
					    delay_ms(200);
					    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 3);
					    delay_ms(200);
					    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 1);
					    				    delay_ms(200);
					    Xil_Out32(XPAR_AXI_GPIO_0_BASEADDR, 0);
					    delay_ms(200);
					    cuenta++;
						}
}
		/*
	 * Run the Timer Counter - Low Level example .
	 */
	/*delay_ms(500);
	if (Status != XST_SUCCESS) {
		xil_printf("Tmrctr lowlevel Example Failed\r\n");
		return XST_FAILURE;
	}

	xil_printf("Successfully ran Tmrctr lowlevel Example edwin\r\n");
	return XST_SUCCESS;
*/
}

/*****************************************************************************/
/**
* This function does a minimal test on the timer counter device and
* the low level driver as a design example.  The purpose of this function is
* to illustrate how to use the XTmrCtr low level driver.
*
*
* @param	TmrCtrBaseAddress is the base address of the device.
* @param	TmrCtrNumber is the timer counter of the device to operate on.
*		Each device may contain multiple timer counters.
*		The timer number is a zero based number with a range of
*		0 - (XTC_DEVICE_TIMER_COUNT - 1).
*
* @return	XST_SUCCESS to indicate success, else XST_FAILURE to indicate
*		a Failure.
*
* @note
*
* This function contains a loop which waits for the value of a timer counter
* to change.  If the hardware is not working correctly, this function may not
* return.
*
****************************************************************************/
int delay_int(u32 TmrCtrBaseAddress, u8 TmrCtrNumber)
{
	u32 Value1;
	u32 Value2;
	u32 ControlStatus;


	/*
	 * Clear the Control Status Register
	 */



	XTmrCtr_SetControlStatusReg(TmrCtrBaseAddress, TmrCtrNumber,0x0);

	/*
	 * Set the value that is loaded into the timer counter and cause it to
	 * be loaded into the timer counter
	 */
	//XTmrCtr_SetLoadReg(TmrCtrBaseAddress, TmrCtrNumber, 0xDEADBEEF);
	XTmrCtr_SetLoadReg(TmrCtrBaseAddress, TmrCtrNumber, 0xFFFE7962 );
	XTmrCtr_LoadTimerCounterReg(TmrCtrBaseAddress, TmrCtrNumber);

	/*
	 * Clear the Load Timer bit in the Control Status Register
	 */
	ControlStatus = XTmrCtr_GetControlStatusReg(TmrCtrBaseAddress,
						 TmrCtrNumber);
	XTmrCtr_SetControlStatusReg(TmrCtrBaseAddress, TmrCtrNumber,
				 ControlStatus & (~XTC_CSR_LOAD_MASK));

	/*
	 * Get a snapshot of the timer counter value before it's started
	 * to compare against later
	 */
	Value1 = XTmrCtr_GetTimerCounterReg(TmrCtrBaseAddress, TmrCtrNumber);

	/*
	 * Start the timer counter such that it's incrementing by default
	 */
	XTmrCtr_Enable(TmrCtrBaseAddress, TmrCtrNumber);

	/*
	 * Read the value of the timer counter and wait for it to change,
	 * since it's incrementing it should change, if the hardware is not
	 * working for some reason, this loop could be infinite such that the
	 * function does not return
	 */
	while (1) {
		Value2 = XTmrCtr_GetTimerCounterReg(TmrCtrBaseAddress, TmrCtrNumber);

		if (Value2==0) {
			break;
		}
	}


	/*
	 * Disable the timer counter such that it stops incrementing
	 */
	XTmrCtr_Disable(TmrCtrBaseAddress, TmrCtrNumber);

	return XST_SUCCESS;
}




void delay_ms(int value)
{
	int count=0;

	while(count<value)
	{
	delay_int(TMRCTR_BASEADDR, TIMER_COUNTER_0);
			count++;
	}
}

 


 

Serial Test: Here the USB serial workf fine with the PC but the other 2 are sending nothing.

Spoiler



/*
 * SERIALTES.C
 *
 *  Created on: Sep 1, 2018
 *      Author: E.Marte
 */


/*
 * Transmision.c
 *
 *  Created on: Aug 30, 2018
 *      Author: E.Marte
 */


/*CONSTRAINTS]
set_property IOSTANDARD LVCMOS33 [get_ports usb_uart_bc127_rxd]
set_property IOSTANDARD LVCMOS33 [get_ports usb_uart_bc127_txd]
set_property PACKAGE_PIN U11 [get_ports usb_uart_bc127_txd]
set_property PACKAGE_PIN V16 [get_ports usb_uart_bc127_rxd]
*/
//
//[SOURCE CODE]
#include "xparameters.h"
#include "xstatus.h"
#include "xuartlite.h"
#include "xil_printf.h"



//[XPARAMETERS]
/* Definitions for peripheral AXI_UARTLITE_0 */
/*#define XPAR_AXI_UARTLITE_0_BASEADDR 0x40600000
#define XPAR_AXI_UARTLITE_0_HIGHADDR 0x4060FFFF
#define XPAR_AXI_UARTLITE_0_DEVICE_ID 0
#define XPAR_AXI_UARTLITE_0_BAUDRATE 9600
#define XPAR_AXI_UARTLITE_0_USE_PARITY 0
#define XPAR_AXI_UARTLITE_0_ODD_PARITY 0
#define XPAR_AXI_UARTLITE_0_DATA_BITS 8

/* Definitions for peripheral AXI_UARTLITE_1 */
/*#define XPAR_AXI_UARTLITE_1_BASEADDR 0x40610000
#define XPAR_AXI_UARTLITE_1_HIGHADDR 0x4061FFFF
#define XPAR_AXI_UARTLITE_1_DEVICE_ID 1
#define XPAR_AXI_UARTLITE_1_BAUDRATE 9600
#define XPAR_AXI_UARTLITE_1_USE_PARITY 0
#define XPAR_AXI_UARTLITE_1_ODD_PARITY 0
#define XPAR_AXI_UARTLITE_1_DATA_BITS 8

/******************************************************************/
/* Canonical definitions for peripheral AXI_UARTLITE_0 */
/*#define XPAR_UARTLITE_0_DEVICE_ID XPAR_AXI_UARTLITE_0_DEVICE_ID
#define XPAR_UARTLITE_0_BASEADDR 0x40600000
#define XPAR_UARTLITE_0_HIGHADDR 0x4060FFFF
#define XPAR_UARTLITE_0_BAUDRATE 9600
#define XPAR_UARTLITE_0_USE_PARITY 0
#define XPAR_UARTLITE_0_ODD_PARITY 0
#define XPAR_UARTLITE_0_DATA_BITS 8
/* Canonical definitions for peripheral AXI_UARTLITE_1 */
/*#define XPAR_UARTLITE_1_DEVICE_ID XPAR_AXI_UARTLITE_1_DEVICE_ID
#define XPAR_UARTLITE_1_BASEADDR 0x40610000
#define XPAR_UARTLITE_1_HIGHADDR 0x4061FFFF
#define XPAR_UARTLITE_1_BAUDRATE 9600
#define XPAR_UARTLITE_1_USE_PARITY 0
#define XPAR_UARTLITE_1_ODD_PARITY 0
#define XPAR_UARTLITE_1_DATA_BITS 8



/* Definitions for peripheral AXI_UARTLITE_2 */
/*#define XPAR_AXI_UARTLITE_2_BASEADDR 0x40620000
#define XPAR_AXI_UARTLITE_2_HIGHADDR 0x4062FFFF
#define XPAR_AXI_UARTLITE_2_DEVICE_ID 2
#define XPAR_AXI_UARTLITE_2_BAUDRATE 9600
#define XPAR_AXI_UARTLITE_2_USE_PARITY 0
#define XPAR_AXI_UARTLITE_2_ODD_PARITY 0
#define XPAR_AXI_UARTLITE_2_DATA_BITS 8


/************************** Constant Definitions *****************************/
#define UARTLITE_DEVICE_ID_0 XPAR_UARTLITE_0_DEVICE_ID
#define UARTLITE_DEVICE_ID_1 XPAR_UARTLITE_1_DEVICE_ID
#define UARTLITE_DEVICE_ID_2 XPAR_UARTLITE_2_DEVICE_ID

#define TEST_BUFFER_SIZE 16
int UartLitePolledExample(u16 DeviceId);

/************************** Variable Definitions *****************************/
XUartLite UartLite_0; /* Instance of the UartLite Device */
XUartLite UartLite_1; /* Instance of the UartLite Device */
XUartLite UartLite_2; /* Instance of the UartLite Device */

/*
* The following buffers are used in this example to send and receive data
* with the UartLite.
*/
u8 SendBuffer[TEST_BUFFER_SIZE]; /* Buffer for Transmitting Data */
u8 RecvBuffer[TEST_BUFFER_SIZE]; /* Buffer for Receiving Data */
int main(void) {
int Status;
/*
* Run the UartLite polled example, specify the Device ID that is
* generated in xparameters.h
*/
Status = XUartLite_Initialize(&UartLite_0, UARTLITE_DEVICE_ID_0);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
if (Status != XST_SUCCESS) {
xil_printf("Uartlite polled Example Failed \r\n");
return XST_FAILURE;
}
Status = XUartLite_Initialize(&UartLite_1, UARTLITE_DEVICE_ID_1);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
if (Status != XST_SUCCESS) {
xil_printf("Uartlite polled Example Failed\r\n");
return XST_FAILURE;
}

Status = XUartLite_Initialize(&UartLite_2, UARTLITE_DEVICE_ID_2);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
if (Status != XST_SUCCESS) {
xil_printf("Uartlite polled Example Failed\r\n");
return XST_FAILURE;
}
xil_printf("Successfully ran Uartlite polled Example\r\n");
//XUartLite_Send(&UartLite_0, SendBuffer, TEST_BUFFER_SIZE);
int temp = 80000;
int simplecounter = 0;
char links[] = "DIGILENT DIGILENT\n\0";
char linksx[] = "ARTY ARTY ARTY ARTY\n\0";
char linksx2[] = "ARTY okis uart 2\n\0";
while (1) {
if (1) {
xil_printf("Cha Cha Cha.... %d\r\n", simplecounter++);
XUartLite_Send(&UartLite_0, &links, TEST_BUFFER_SIZE);
XUartLite_Send(&UartLite_1, &linksx, TEST_BUFFER_SIZE);
XUartLite_Send(&UartLite_1, &linksx2, TEST_BUFFER_SIZE);
while(temp>0)
{
	temp--;
}

temp = 80000;
}
}
return XST_SUCCESS;
}

 


 

I2C selftest. The selftest failed, I know it fails on XIic_SelfTest

Spoiler



/******************************************************************************
*
* Copyright (C) 2002 - 2014 Xilinx, Inc.  All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* Use of the Software is limited solely to applications:
* (a) running on a Xilinx device, or
* (b) that interact with a Xilinx device through a bus or interconnect.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* XILINX  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of the Xilinx shall not be used
* in advertising or otherwise to promote the sale, use or other dealings in
* this Software without prior written authorization from Xilinx.
*
******************************************************************************/
/******************************************************************************/
/**
* @file xiic_selftest_example.c
*
* This file contains a example for using the IIC hardware device and
* XIic driver.
*
* @note
*
* None
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver   Who  Date	 Changes
* ----- ---- -------- -----------------------------------------------
* 1.00a sv   05/09/05 Initial release for TestApp integration.
* 2.00a sdm  09/22/09 Updated to use the HAL APIs, replaced call to
*		      XIic_Initialize API with XIic_LookupConfig and
*		      XIic_CfgInitialize. Minor changes made as per
*		      coding guidelines.
* 3.4   ms   01/23/17 Added xil_printf statement in main function to
*                     ensure that "Successfully ran" and "Failed" strings
*                     are available in all examples. This is a fix for
*                     CR-965028.
* </pre>
*
*******************************************************************************/

#include "xparameters.h"
#include "xiic.h"
#include "xil_printf.h"

/************************** Constant Definitions ******************************/

/*
 * The following constants map to the XPAR parameters created in the
 * xparameters.h file. They are defined here such that a user can easily
 * change all the needed parameters in one place.
 */
#ifndef TESTAPP_GEN
#define IIC_DEVICE_ID	   XPAR_IIC_0_DEVICE_ID
#endif

/**************************** Type Definitions ********************************/


/***************** Macros (Inline Functions) Definitions **********************/


/************************** Function Prototypes *******************************/

int IicSelfTestExample(u16 DeviceId);

/************************** Variable Definitions ******************************/

/*
 * The following are declared globally so they are zeroed and so they are
 * easily accessible from a debugger.
 */
XIic Iic; /* The driver instance for IIC Device */


/******************************************************************************/
/**
* Main function to call the example. This function is not included if the
* example is generated from the TestAppGen test tool.
*
* @param	None.
*
* @return	XST_SUCCESS if successful, XST_FAILURE if unsuccessful.
*
* @note		None.
*
******************************************************************************/
#ifndef TESTAPP_GEN
int main(void)
{
	int Status;

	/*
	 * Run the example, specify the device ID that is generated in
	 * xparameters.h.
	 */
	Status = IicSelfTestExample(IIC_DEVICE_ID);
	if (Status != XST_SUCCESS) {
		xil_printf("IIC selftest Example Failed\r\n");
		return XST_FAILURE;
	}

	xil_printf("Successfully ran IIC selftest Example\r\n");
	return XST_SUCCESS;

}
#endif

/*****************************************************************************/
/**
*
* This function does a selftest on the IIC device and XIic driver as an
* example.
*
* @param	DeviceId is the XPAR_<IIC_instance>_DEVICE_ID value from
*		xparameters.h.
*
* @return	XST_SUCCESS if successful, XST_FAILURE if unsuccessful.
*
* @note		None.
*
****************************************************************************/
int IicSelfTestExample(u16 DeviceId)
{
	int Status;
	XIic_Config *ConfigPtr;	/* Pointer to configuration data */

	/*
	 * Initialize the IIC driver so that it is ready to use.
	 */
	ConfigPtr = XIic_LookupConfig(DeviceId);
	if (ConfigPtr == NULL) {
		xil_printf("IIC selftest uno\r\n");
		return XST_FAILURE;
	}

	Status = XIic_CfgInitialize(&Iic, ConfigPtr, ConfigPtr->BaseAddress);
	if (Status != XST_SUCCESS) {
		xil_printf("IIC selftest dos\r\n");
		return XST_FAILURE;
	}


	/*
	 * Perform a self-test to ensure that the hardware was built
	 * correctly.
	 */
	Status = XIic_SelfTest(&Iic);
	if (Status != XST_SUCCESS) {
		xil_printf("IIC selftest tres\r\n");
		return XST_FAILURE;
	}

	return XST_SUCCESS;
}


 

This board is brand new, I only have it for a few weeks. I havent connected anything to the ports. I measured pins either with a tester or with a analog discovery so not short ciruits or similar have been produced.

Any help would be apreciated.

Edwin

Edited by JColvin
added spoiler boxes for visual compactness

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0
17 hours ago, emarte said:

Sometimes we need a little push from somebody else or even leaving the project for a few hours or days

You probably haven't yet grasped the importance or depth of this little epiphany yet. I'd need more than my fingers to count the number of times that the solution to a problem that had been eluding me for days, or longer, roused me from a deep sleep in the dead of night like a thunder clap. Just trying to explain one's understanding of a problem to another person often turns on the light bulb in one's head so that a path to resolution reveals itself.  The brain is a marvellous and still mostly mystical piece of anatomy; for some of us more so than others. I think that it's ability to be self-aware sometimes gets in its own way...

I encourage you to figure out what the issue was when the time is right so that it becomes enmeshed into a far corner of your memory and perhaps pop up in the future to save you hours of frustration when you repeat it.

Edited by zygot

Share this post


Link to post
Share on other sites
  • 1

@emarte,

I feel your pain.

Here's my suggestion for step 1:

Look at the Vivado pin report after the configuration file has been generated and check it against the schematic for the Genesys2 as well as the xdc file in your project. If everything doesn't match;  fix it. Regardless, reply to this post.

No matter how many times I write this ( and it's been a lot of times ) I feel compelled to say it again. Whenever you have a new design that uses IO pins check the pint report against the constraints file and the schematic before configuring hardware. Help stamp out smoking in the FPGA development workplace! ( Yes, I know; you can damage your FPGA device without the dramatic aromatic and visual clues)

Share this post


Link to post
Share on other sites
  • 0

Thanks Zygot!

I am checking! I would think I did all that but I will slowly check all again as you mention. I will wait for anybody reply that may bring some light.

Thanks for taking the time.

Edwin

 

 

Share this post


Link to post
Share on other sites
  • 0

Dear Zygot I am just updating about my case. 

 

Sometimes we need a little push from somebody else or even leaving the project for a few hours or days. I tried to calm down as I was getting to the panic state just becasue  nothing was working as it was supposed to do. I read carefully your message, although what you told me is what I do anyways,  I tried to be open mind, So I started from scratch, testing the simple I/O, testing the Simple hello world and changing bit by bit. I am really not sure What I was missing or what I was doing wrong but my system is back on again. I am so happy Now! I spent like a week, even thinking during the night, what could have been the reason? what can I do different ? But anyways, I will post later on with updates of the project.

 

cheers!

Share this post


Link to post
Share on other sites
  • 0

Hi @emarte,

Here  is the Arty-S7 resource center with a few different demos/examples. Here is a forum thread that discusses using multiple Uartlite IP Cores. Could you attach a full screen shot of your block design as well as your wrapper and xdc file. Here is an forum thread discussing interrupts.

thank you,

Jon

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now