Even I added all the depended library for uart program running.
So, the error generated on the bulid up following,
'../src/uart_new_one.xc: Error: Undefined reference to '__i_uart_rx_if_wait_for_data_and_read' (possible inline definition without external definition)
../src/uart_new_one.xc: Error: Undefined reference to '_i.input_gpio_if.input_gpio_1bit_with_events._c0.event_when_pins_eq'
../src/uart_new_one.xc: Error: Undefined reference to '_i.input_gpio_if.input_gpio_1bit_with_events._c0.input'
../src/uart_new_one.xc: Error: Undefined reference to '_i.input_gpio_if.input_gpio_1bit_with_events._c0.input_and_timestamp'
../src/uart_new_one.xc: Error: Undefined reference to '_i.output_gpio_if.output_gpio.0.output'
../src/uart_new_one.xc: Error: Undefined reference to '_i.output_gpio_if.output_gpio.0.output_and_timestamp'
../src/uart_new_one.xc: Error: Undefined reference to '_i.uart_tx_if.uart_tx.0.write'
../src/uart_new_one.xc: Error: Undefined reference to 'input_gpio_1bit_with_events'
../src/uart_new_one.xc: Error: Undefined reference to 'input_gpio_1bit_with_events.dynalloc_maxchanends'
../src/uart_new_one.xc: Error: Undefined reference to 'input_gpio_1bit_with_events.dynalloc_maxcores'
../src/uart_new_one.xc: Error: Undefined reference to 'input_gpio_1bit_with_events.dynalloc_maxtimers'
../src/uart_new_one.xc: Error: Undefined reference to 'input_gpio_1bit_with_events.fini'
../src/uart_new_one.xc: Error: Undefined reference to 'input_gpio_1bit_with_events.init.0'
../src/uart_new_one.xc: Error: Undefined reference to 'input_gpio_1bit_with_events.init.0.savedstate'
../src/uart_new_one.xc: Error: Undefined reference to 'input_gpio_1bit_with_events.init.1'
../src/uart_new_one.xc: Error: Undefined reference to 'input_gpio_1bit_with_events.select.enable'
../src/uart_new_one.xc: Error: Undefined reference to 'output_gpio'
../src/uart_new_one.xc: Error: Undefined reference to 'output_gpio.dynalloc_maxchanends'
../src/uart_new_one.xc: Error: Undefined reference to 'output_gpio.dynalloc_maxcores'
../src/uart_new_one.xc: Error: Undefined reference to 'output_gpio.dynalloc_maxtimers'
../src/uart_new_one.xc: Error: Undefined reference to 'output_gpio.init.0'
../src/uart_new_one.xc: Error: Undefined reference to 'output_gpio.init.0.savedstate'
../src/uart_new_one.xc: Error: Undefined reference to 'output_gpio.init.1'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_rx'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_rx.dynalloc_maxchanends'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_rx.dynalloc_maxcores'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_rx.dynalloc_maxtimers'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_rx.fini'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_rx.init.0'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_rx.init.0.savedstate'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_rx.init.1'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_rx.select.enable'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_tx'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_tx.dynalloc_maxchanends'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_tx.dynalloc_maxcores'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_tx.dynalloc_maxtimers'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_tx.init.0'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_tx.init.0.savedstate'
../src/uart_new_one.xc: Error: Undefined reference to 'uart_tx.init.1
help me out this problem.
Even I tested one independent program it compiled perfectly but it gives wrong on UART port. So, i also post that program. So, tell me where actually mistake on the program or any other thing,
Code: Select all
#include <xs1.h>
#include <platform.h>
#include <stdlib.h>
#define BIT_RATE 115200
#define BIT_TIME XS1_TIMER_HZ / BIT_RATE
void txByte(unsigned char);
unsigned char rxByte(void);
//port RXD = XS1_PORT_1L;// X0D35 =>> 19 pin
//port TXD = XS1_PORT_1I;// X0D24 =>> 20 pin
port TXD = XS1_PORT_1L;// X0D35 =>> 19 pin
port RXD = XS1_PORT_1I;// X0D24 =>> 20 pin
unsigned char array[] = "I l you/n";
int main()
{
//unsigned char c;
int i;
while (1)
{
//for (i = 0; i < 10; i++)
//array[i] = rxByte();
for (i = 0; i < 10; i++)
txByte(array[i]);
}
return 0;
}
unsigned char rxByte(void)
{
unsigned data = 0, time;
int i;
unsigned char c;
// Wait for stop bit
RXD when pinseq (1) :> int _;
// wait for start bit
RXD when pinseq (0) :> int _ @ time;
time += BIT_TIME + (BIT_TIME >> 1);
// sample each bit in the middle.
for (i = 0; i < 8; i += 1)
{
RXD @ time :> >> data;
time += BIT_TIME;
}
// reshuffle the data.
c = (unsigned char) (data >> 24);
return {c};
}
void txByte(unsigned char c)
{
unsigned int time, data;
data = (unsigned int)c;
// get current time from port with force out.
TXD <: 1 @ time;
// Start bit.
TXD <: 0;
// Data bits.
for (int i = 0; i < 8; i += 1)
{
time += BIT_TIME;
TXD @ time <: >> data;
}
// two stop bits
time += BIT_TIME;
TXD @ time <: 1;
time += BIT_TIME;
TXD @ time <: 1;
}
Thanks for advance.