Unable to Connect to SAME51 Board from Android

I’m running custom firmware on a SAME51 board and connecting it to Android via USB serial. I am unable to connect to the device using RealDash. The CAN monitor says “Not connected”, “Connecting” and never shows me any frames.

I am able to access the device using a serial terminal app and see valid frames coming across. So I know that Android recognizes the device and can read from it.

I have tested the code by connecting a TTL cable to the board. RealDash is able to use this cable just fine.

Any idea what might be causing this problem with the USB connection? It works with other software on the Android device and works with my Windows PC just fine. It’s only when running RealDash that it fails to work.

One thing to note. Android does ask for permission to allow my terminal software to access the USB device when I run it. However, there is no permissions popup when running RealDash. Could this be a permissions problem?

I’m running Android 11.

I sent a debug log just now, at 23:58 PST. Is there any way I can view the debug log myself instead of just uploading it to you?

I was able to get at the logs:

18.1.2022, 01:36:41.959: SerialComms::Starting task: Task_Open
18.1.2022, 01:36:41.959: SerialComms(Android)::OpenComms - device CANBed M4 (SAME51G19A)
18.1.2022, 01:36:41.963: MIK3Y: connect: CANBed M4 (SAME51G19A), serialNumber: 1003,32811, baud: 115200, vid: 0, pid: 0
18.1.2022, 01:36:41.963: MIK3Y: Parsed vid: 1003, pid: 32811, sn:
18.1.2022, 01:36:41.963: SERIAL: Searching for serial device: CANBed M4 (SAME51G19A), , 1003, 32811
18.1.2022, 01:36:41.964: SERIAL: no serial devices found
18.1.2022, 01:36:41.964: MIK3Y: returning CONNECT_STATUS_FAILED
18.1.2022, 01:36:41.964: SerialComms::OpenCompleteImmediate - status:0
18.1.2022, 01:36:41.964: SerialComms::ThreadProc: calling observer OnSerialDisconnected
18.1.2022, 01:36:41.964: ValueInput::OnSerialError(SerialComms)
18.1.2022, 01:36:41.964: SerialComms::Reconnect : adapter CANBed M4 (SAME51G19A)
18.1.2022, 01:36:41.970: SerialComms(Android)::CloseComms
18.1.2022, 01:36:41.970: MIK3Y: close, entering
18.1.2022, 01:36:41.970: MIK3Y: close, leaving

It’s looking for the correct device but it’s logging “no serial devices found”. It still works via my terminal app.

I saw this in the Android logs as well:

01-18 00:58:35.116  3584 29526 I NUTS    : 00:58:35.116 logfile.cpp(103)(tid:0x57dcfcc0) : NUTS_INFO - 18.1.2022, 00:58:35.116: SERIAL: Exception in findSerialDevice: java.lang.SecurityException: User has not given 10274/com.napko.RealDash permission to access device /dev/bus/usb/001/002

So my initial theory might have merit - RealDash doesn’t have permission to access the USB devices even if it can list them all. Any idea if there is a way to fix this?

I have some more information. I’ve read in some other threads that you expect a popup whenever a USB device is plugged into the tablet to ask if RealDash should always handle that connection. I do not get a popup when I plug in the Arduino. But I do get this popup when I plug in my TTL cable (which works). I’m not sure if this is relevant but it seems like it might be.