apache / apache/nuttx

[BUG] RN2483 hangs on read

Open
#17,273 5 comments 0 reactions 0 assignees View on GitHub
Arch: arm64 Area: Drivers OS: Mac Type: Bug
Dominant language
C
Stars
4k
Forks
1.7k
Avg merge
1d 17h
Merged PRs (30d)
237

Description

### Description / Steps to reproduce the issue

The RN2483 with the `rn2xx3` driver hangs on read

The following is the problematic part, situated in `rn2xx3_read()`
```
ret = file_read(&priv->uart, &hex_byte, 2);
if (ret < 2)
{
goto early_ret;
}
```

The device seems to always return 1 byte of data instead of 2, thus hanging the system

Switching to a double single byte read fixed the issue
```
ret = file_read(&priv->uart, &hex_byte, 1);
if (ret < 1)
{
goto early_ret;
}
ret = file_read(&priv->uart, &hex_byte[1], 1);
if (ret < 1)
{
goto early_ret;
}
```

I do not find this to be an elegant solution, is there a different read function that could wait until the buffer is full?

### On which OS does this issue occur?

[OS: Mac]

### What is the version of your OS?

MacOS 15.6.1

### NuttX Version

releases/12.12

### Issue Architecture

[Arch: arm64]

### Issue Area

[Area: Drivers]

### Host information

_No response_

### Verification

- [x] I have verified before submitting the report.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.