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

--server gdb requires a crossover uart to be present #26

Closed
zyp opened this issue Apr 28, 2020 · 1 comment
Closed

--server gdb requires a crossover uart to be present #26

zyp opened this issue Apr 28, 2020 · 1 comment

Comments

@zyp
Copy link
Contributor

zyp commented Apr 28, 2020

Executing wishbone-tool with --server gdb without a crossover uart present results in an error. The following code snippet from config.rs seems to be missing the if-statement for ServerKind::Terminal or whatever it is called:

            if server_kind.contains(&ServerKind::GDB) {
                // You asked for --server gdb but no vexriscv jtag interfaces is found in the csr.csv file it should complain.
                if !register_mapping.contains_key("vexriscv_debug") {
                    return Err(ConfigError::InvalidConfig(
                        "GDB specified but no vexriscv address present in csv file".to_owned(),
                    ));
                }
                // You asked for --server terminal but no uart is found in the csr.csv file it should complain.
                if !(register_mapping.contains_key("uart_xover_rxtx")
                    && register_mapping.contains_key("uart_xover_rxempty")
                    && register_mapping.contains_key("uart_xover_ev_pending"))
                {
                    return Err(ConfigError::InvalidConfig(
                        "Terminal specified, but no xover uart addresses present in csv file"
                            .to_owned(),
                    ));
                }
            }
@xobs xobs closed this as completed in 61ea6fc Apr 29, 2020
xobs added a commit that referenced this issue Apr 29, 2020
Previously, we would only validate the `uart_xover` keys were present if
the user specified a GDB server.  This could result in a situation where
the user provided a csr-csv without a uart, but still wanted to run a
terminal.

In this case, `wishbone-tool` would fall back on its default, hardcoded
values of 0xe0001800, which is incorrect.

With this patch, specifying `-s terminal --csr-csv [file.csv]` when the
csv file has no `uart_xover` registers will now throw an error.

Furthermore, with this patch, the `-s gdb` option required a uart, which
would prevent a user from opening a gdb server on a device without a
uart.

This fixes #26.

Signed-off-by: Sean Cross <sean@xobs.io>
@xobs
Copy link
Member

xobs commented Apr 29, 2020

Good catch. I think this is a big enough issue to warrant a new minor release.

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

No branches or pull requests

2 participants