A custom Cargo runner that runs Rust firmware in the [renode] emulator.
cargo run
.Cargo.toml
.variants
, allows multiple configs
To install renode-run
, use cargo install renode-run
.
```toml [package.metadata.renode] name = 'my-script' description = 'my renode script - ${FOOKEY} works' machine-name = 'my-machine' using-sysbus = true renode = '${HOME}/repos/forks/renode/renode' environment-variables = [ ['FOOKEY', 'FOOVAL'], ["MYENV", "MYVAL"], ] init-commands = [ 'logLevel -1 i2c2', ] variables = [ '$tap?="renode-tap0"', # Set random board UNIQUE ID ''' python "import _random" python "rand = _random.Random()"
$id1 = `python "print rand.getrandbits(32)"`
$id2 = `python "print rand.getrandbits(32)"`
$id3 = `python "print rand.getrandbits(32)"`
''',
] platform-descriptions = [ '@platforms/boards/stm32f4discovery-kit.repl', 'path/to/devboard.repl', '< ${SOMETHING}/otherdevboard.repl', ''' phy3: Network.EthernetPhysicalLayer @ ethernet 3 Id1: 0x0000 Id2: 0x0000 ''', ''' wss: Python.PythonPeripheral @ sysbus 0x50070000 size: 0x10 initable: true filename: "${ORIGIN}/sensor_models/wss.py" ''', ] pre-start-commands = [ ''' emulation CreateSwitch "switch" connector Connect sysbus.ethernet switch emulation CreateTap $tap "tap" connector Connect host.tap switch ''', ''' logFile @/tmp/logfile.log true logLevel 3 file ''', 'emulation LogEthernetTraffic', 'machine StartGdbServer 3333', ] reset = ''' sysbus LoadELF $bin sysbus WriteDoubleWord 0x1FFF7A10 $id1 sysbus WriteDoubleWord 0x1FFF7A14 $id2 sysbus WriteDoubleWord 0x1FFF7A18 $id3 ''' ```
Licensed under either of
Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.