My project is an AVB extension board that will act as a 8 channels talker unit. It will fit into an existing 8 channels mic preamp that have a web based wifi configuration page.
I used the xCORE-200 Multichannel Audio Platform as reference design and AN00202 (Gigabit Ethernet AVB endpoint example using I2S master) as base code. I modified the code to disable the listener and to add a SPI slave interface to communicate with the mic preamp processor. This seems to work fine now.
When this extension board is fitted, we want to disable the wifi module and use the AVB extension card ethernet interface instead. Wifi module uses UART lines, so I need to make an UART to TCP socket bridge into the XMOS.
When I compile my app, I get the following constraint check report:
The UART library example gives the following code:Constraint check for tile[0]:
Cores available: 8, used: 7 . OKAY
Timers available: 10, used: 7 . OKAY
Chanends available: 32, used: 28 . OKAY
Memory available: 262144, used: 95632 . OKAY
(Stack: 23924, Code: 60808, Data: 10900)
Constraints checks PASSED.
Constraint check for tile[1]:
Cores available: 8, used: 8 . OKAY
Timers available: 10, used: 8 . OKAY
Chanends available: 32, used: 27 . OKAY
Memory available: 262144, used: 110516 . OKAY
(Stack: 79116, Code: 22060, Data: 9340)
Constraints checks PASSED.
Code: Select all
int main() {
interface uart_rx_if i_rx;
interface uart_tx_if i_tx;
input_gpio_if i_gpio_rx[1];
output_gpio_if i_gpio_tx[1];
par {
on tile[0]: output_gpio(i_gpio_tx, 1, p_uart_tx, null);
on tile[0]: uart_tx(i_tx, null,
115200, UART_PARITY_NONE, 8, 1,
i_gpio_tx[0]);
on tile[0].core[0] : input_gpio_with_events(i_gpio_rx, 1, p_uart_rx, null);
on tile[0].core[0] : uart_rx(i_rx, null, RX_BUFFER_SIZE,
115200, UART_PARITY_NONE, 8, 1,
i_gpio_rx[0]);
on tile[0]: app(i_tx, i_rx);
}
return 0;
}
Code: Select all
on tile[1]: [[distribute]] output_gpio(i_gpio_tx, 1, p_uart_tx, null);
on tile[1]: [[distribute]] uart_tx(i_tx, null, 115200, UART_PARITY_NONE, 8, 1, i_gpio_tx[0]);
on tile[1]: par {
uart_rx(i_rx, null, RX_BUFFER_SIZE, 115200, UART_PARITY_NONE, 8, 1, i_gpio_rx[0]);
input_gpio_with_events(i_gpio_rx, 1, p_uart_rx, null);
};
on tile[1]: uart_tcp_bridge(i_tx, i_rx);
uart_tcp_bridge is for now only an UART loopback:xcc1: terminated due to internal unrecoverable error
Code: Select all
void uart_tcp_bridge(client uart_tx_if uart_tx, client uart_rx_if uart_rx) {
while(1) {
select {
case uart_rx.data_ready():
uint8_t data = uart_rx.read();
uart_tx.write(data);
break;
}
}
}