Cannot read properly from UART with Thingy 91

Hi.

We are working on a project that needs to read several bytes from the UART using Thingy 91. Connectivity bridge is flashed in the 52840 SoC but the main project in the 9160 only manages to read 7 bytes from the UART. I've attached a sample that replicates the problem including a simple program in go which reads 2 files and sends them to the specified serial port (indicated as first argument). I've also recently updated the firmware.

6545.test.rar

Parents Reply Children
  • Hi,

    MarioDLH said:
    It's like it won't work if a serial connection isn't detected at the moment the example starts runnning.

    Sorry for the delay. Try to add something like this:

    	/* Data Terminal Ready - check if host is ready to communicate */
    	while (!dtr) {
    		ret = uart_line_ctrl_get(dev, UART_LINE_CTRL_DTR, &dtr);
    		if (ret) {
    			LOG_ERR("Failed to get Data Terminal Ready line state: %d",
    				ret);
    			continue;
    		}
    		k_msleep(100);
    	}

    Example usage here.

Related