This repository has been archived by the owner on Aug 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
added args to simulavr to define serial device #3
Open
pat1
wants to merge
20
commits into
Traumflug:traumflug
Choose a base branch
from
pat1:traumflug
base: traumflug
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This enhances encapsulation and simplifies code, both of which are generally considered to be a good thing.
About every tool on this planet uses a lowercase v for "verbose", do it here, too.
This example is extremely simple, it does nothing fancy, breath taking or showing advanced coding skills. It also depends on neither TCL nor Python. It's purpose is to exercise the UART serial port and to show how to make this port available in a simulation _without_ altering the binary. The code is tested on real hardware already and works just as expected.
For now this is a proof of concept. Storing parameters works fine, reading them back, too, but instead of being used, they're simple written to the console. For now the parameters are device type and cpu frequency, but the concept can be extended easily to all other command line parameters. The proof is applied to the simple_serial example. The point of this strategy is to avoid the neccessity to run simulavr with more command line parameters than just the name of the ELF file. At compilation time we know best for which device we compile, after all.
Substantial part of this patch is a move from accessing protected properties of class AvrDevice directly to using their Getters.
This makes the ELf file slightly bigger, but reading it more simple and failure-proof.
avr-gcc has been seen to set the length field to zero. Clearly a bug, but ignoring bugs doesn't help.
Applied to the simple_serial example, but no action yet, just the info transport.
This class moves serial output to a file, to a special file or to stdout. While there's special_output_port already, using an UI device neither changes the AVR code nor does it influence AVR behaviour.
Once I found out on how it's done, it was surprisingly simple. Even better for the user: No need for TCL, no need for Python, no need for Swig, just add a single, simple macro to your AVR source code.
Almost the same as SIMINFO_SERIAL_IN(), but the other direction.
Just like the Rx counterpart, this is for communications between a file/special file/console and the actually simulated UART. Works beautifully.
Just as the Rx counterpart, you can now connect to the console, a pipe file or even a serial device file of the host. All without additional scripting and languages, just a macro in the AVR source code.
0b2e965
to
076ca5c
Compare
3e1b746
to
0f64e17
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
after problems with #1 and #2 I use this patch to try simulavr with arduino elf and use the "classic" serial monitor on stdin/stdout