just getting familiar with the new [to me] Necto C AI [for pic32] ecosystem...I'm doing a simple UART read/echo (from examples) and I seem to be getting a General Exception issue (drops into the __GenExcept() handler)...
Here is my simple code. It dies in the uart_open call...All vanilla setup on Fision Pic32 v8 board.
Thoughts?
~Kam
Code: Select all
#include "MikroSDK.Board"
#include "MikroSDK.MikroBus"
#include "MikroSDK.Driver.UART"
#include "MikroSDK.Hal.GPIO"
uart_t uart;
uart_config_t uart_cfg;
static uint8_t buffer[16];
static uint8_t size;
static uint8_t uart_rx_buffer[256];
static uint8_t uart_tx_buffer[256];
void application_init(void)
{
// take default conf
uart_configure_default(&uart_cfg);
uart_cfg.rx_pin = USB_UART_RX;
uart_cfg.tx_pin = USB_UART_TX;
uart_cfg.tx_ring_size = sizeof(uart_tx_buffer);
uart_cfg.rx_ring_size = sizeof(uart_rx_buffer);
// lets open and catch any errors...
if(uart_open(&uart, &uart_cfg) == UART_ERROR)
{
while (1)
{
asm nop;
}
}
uart_set_baud(&uart, 115200);
uart_println(&uart, "Starting echo:");
}
void application_task(void)
{
size = uart_read(&uart, buffer, sizeof(buffer));
if(size)
{
uart_write(&uart, buffer, size);
}
}
void main(void)
{
application_init();
while (1)
{
application_task();
}
}