Hello,
I am working on a project were two MCU's need to communicate with each other via UART. I am using async UART. I am stuck with this problem where after
Here are some code snippets how I enable/disable the driver. It's still a bit messy because I was testing what works and what doesn't:
static int gpioCallback(const struct device *dev, struct gpio_callback *cb, uint32_t pins)
{
int err;
err = pm_device_action_run(uart_dev, PM_DEVICE_ACTION_RESUME);
if (err && err != -EALREADY)
{
// LOG_ERR("Call `pm_device_action_run` failed: %d", err);
}
if (!device_is_ready(uart_dev))
{
// LOG_ERR("Device not ready");
}
// LOG_INF("UART waked up");
} case UART_RX_RDY:
size_t offset = evt->data.rx.offset;
size = evt->data.rx.len;
memcpy(rxBuf, &evt->data.rx.buf[offset], size);
// Enable CoAP work to transmit newly received data
k_work_schedule(workCoap, K_NO_WAIT);
err = pm_device_action_run(uart_dev, PM_DEVICE_ACTION_SUSPEND);
if (err && err != -EALREADY)
{
LOG_ERR("Call `pm_device_action_run` failed: %d", err);
}
break;

