Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Host access to physical COM ports #2326

Merged
merged 9 commits into from May 5, 2021

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented May 4, 2021

This PR extends the Host serial port emulation to include local physical devices using the --device command-line option. For example:

make run HOST_UART_OPTIONS="--uart=0 --device=/dev/ttyUSB0"

The --device option must follow the --uart option. Another example:

make run HOST_UART_OPTIONS="--uart=0 --device=/dev/ttyUSB0 --uart=1 --device=/dev/ttyUSB1"

The port is opened when uart_init gets called. The default baud rate is whatever the application has requested. This can be overridden as follows:

make run HOST_UART_OPTIONS="--uart=0 --device=/dev/ttyUSB0 --baud=921600"

@mikee47 mikee47 mentioned this pull request May 4, 2021
@slaff slaff added this to the 4.3.1 milestone May 5, 2021
@mikee47
Copy link
Contributor Author

mikee47 commented May 5, 2021

@slaff I've added [TEMPORARY] commit for a way to test this more easily. Should remove that before merge :-)

.gitmodules Outdated Show resolved Hide resolved
Sming/Arch/Host/Components/hostlib/options.h Show resolved Hide resolved
@slaff
Copy link
Contributor

slaff commented May 5, 2021

@mikee47 Are you planning to add something more here?

@mikee47
Copy link
Contributor Author

mikee47 commented May 5, 2021

@slaff Just remove temporary commit and done.

@slaff slaff changed the title [WIP] Enable Host access to physical COM ports Enable Host access to physical COM ports May 5, 2021
@slaff slaff mentioned this pull request May 5, 2021
5 tasks
@slaff slaff merged commit 1123cdf into SmingHub:develop May 5, 2021
@mikee47 mikee47 deleted the feature/host-uart branch May 8, 2021 08:49
slaff pushed a commit that referenced this pull request Sep 27, 2021
This PR extends the Host serial port emulation to include local physical devices using the `--device` command-line option. For example:

```
make run HOST_UART_OPTIONS="--uart=0 --device=/dev/ttyUSB0"
```

The `--device` option must follow the `--uart` option. Another example:

```
make run HOST_UART_OPTIONS="--uart=0 --device=/dev/ttyUSB0 --uart=1 --device=/dev/ttyUSB1"
```

The port is opened when `uart_init` gets called. The default baud rate is whatever the application has requested. This can be overridden as follows:

```
make run HOST_UART_OPTIONS="--uart=0 --device=/dev/ttyUSB0 --baud=921600"
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants