I cannot get my solution to send data through the serial port.
I use the serial application to work on the instance 1.
static void sleep_handler(void)
{
__WFE();
__SEV();
__WFE();
}
#define SERIAL_FIFO_TX_SIZE 1
#define SERIAL_FIFO_RX_SIZE 1
#define SERIAL_BUFF_TX_SIZE 128
#define SERIAL_BUFF_RX_SIZE 128
NRF_SERIAL_UART_DEF(serial1_uarte, 1);
NRF_SERIAL_BUFFERS_DEF(serial1_buffs, SERIAL_BUFF_TX_SIZE, SERIAL_BUFF_RX_SIZE);
NRF_SERIAL_QUEUES_DEF(serial1_queues, SERIAL_FIFO_TX_SIZE, SERIAL_FIFO_RX_SIZE);
NRF_SERIAL_CONFIG_DEF(serial1_config, NRF_SERIAL_MODE_DMA,
&serial1_queues, &serial1_buffs, NULL, sleep_handler);
NRF_SERIAL_DRV_UART_CONFIG_DEF(m_uarte1_drv_config,
MODBUS_RX_PIN, MODBUS_TX_PIN,
0, 0,
NRF_UART_HWFC_DISABLED, NRF_UART_PARITY_EXCLUDED,
NRF_UART_BAUDRATE_9600,
UART_DEFAULT_CONFIG_IRQ_PRIORITY);
ret = nrf_serial_init(&serial1_uarte, &m_uarte1_drv_config, &serial1_config);
APP_ERROR_CHECK(ret);
static char tx_message[] = "Hello nrf_serial!\n\r";
ret = nrf_serial_write(&serial1_uarte,
tx_message,
strlen(tx_message),
NULL,
1000);//NRF_SERIAL_MAX_TIMEOUT);
nrf_serial_flush(&serial1_uarte, 50);
This does not send any data.on the serial bus. I have een reading many thread but i cannot find the solution. While this is my own device, i know that data can be sent.
I have a big project fie when data get sent and it is working fine. I cannot not figure out what i miss on this new project to make it all work.
Please help.