|
All checks were successful
build / build-test (push) Successful in 23s
|
||
|---|---|---|
| .gitea/workflows | ||
| src | ||
| target | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| memory-m0.x | ||
| memory.x | ||
| openocd.cfg | ||
| README.md | ||
| RUSTROVER_SETUP.md | ||
RustRover Setup for Infineon Traveo II Debugging
This document provides instructions for setting up RustRover to replicate the VSCode debugging experience for Infineon Traveo II microcontrollers.
Prerequisites
- RustRover IDE installed
- GNU Arm Embedded Toolchain installed at
C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin - OpenOCD installed and available in PATH
- ST-Link debugger connected to your target hardware
Project Structure
The converted configurations support two target architectures:
- Cortex-M7:
thumbv7em-none-eabiwithtraveo-cyt4bffeature - Cortex-M0+:
thumbv6m-none-eabiwithtraveo-cyt2b7feature
Run/Debug Configurations
The following configurations have been created in .idea/runConfigurations/:
Debug Configurations
-
Debug Traveo (Cortex-M7)
- OpenOCD configuration:
interface/stlink.cfg;target/stm32f7x.cfg - GDB port: 3333
- Builds with:
thumbv7em-none-eabitarget andtraveo-cyt4bffeature
- OpenOCD configuration:
-
Debug Traveo (Cortex-M0+)
- OpenOCD configuration:
interface/stlink.cfg;target/stm32f0x.cfg - GDB port: 3333
- Builds with:
thumbv6m-none-eabitarget andtraveo-cyt2b7feature
- OpenOCD configuration:
-
Attach to OpenOCD
- For connecting to an already running OpenOCD instance
- GDB port: 3333
Build Configurations
-
Build Traveo (Cortex-M7)
- Command:
cargo build --target thumbv7em-none-eabi --features traveo-cyt4bf
- Command:
-
Build Traveo (Cortex-M0+)
- Command:
cargo build --target thumbv6m-none-eabi --features traveo-cyt2b7
- Command:
Setup Instructions
1. Open Project in RustRover
- Launch RustRover
- Open the project directory
- Ensure Cargo.toml is detected as a Rust project
2. Configure Toolchains
- Go to File > Settings > Languages & Frameworks > Rust
- Ensure the correct toolchain is selected for embedded development
- Add the GNU Arm Embedded Toolchain to your system PATH if not already present
3. Import Run Configurations
The run configurations are already created in .idea/runConfigurations/. They should be automatically detected by RustRover.
4. Verify OpenOCD Installation
- Open a terminal in RustRover
- Run
openocd --versionto verify installation - Ensure ST-Link drivers are installed
5. Hardware Setup
- Connect your ST-Link debugger to the target board
- Ensure proper power supply and connections
- Verify the target board is recognized by OpenOCD
Usage
Building
- Select the appropriate build configuration from the run configurations dropdown
- Click the run button or press Shift+F10
- The project will build for the selected target architecture
Debugging
- Select the appropriate debug configuration (Cortex-M7 or Cortex-M0+)
- Click the debug button or press Shift+F9
- RustRover will:
- Build the project with the appropriate features
- Start OpenOCD with the correct configuration
- Launch the debugger and connect to the target
Attaching to Running OpenOCD
- Start OpenOCD manually in a terminal:
openocd -f interface/stlink.cfg -f target/stm32f7x.cfg -c "adapter speed 1000" -c "init" -c "reset init" -c "cortex_m reset_config sysresetreq" - Select "Attach to OpenOCD" configuration in RustRover
- Click debug to connect to the running OpenOCD instance
Troubleshooting
Common Issues
-
OpenOCD not found
- Ensure OpenOCD is installed and in your system PATH
- Restart RustRover after installing OpenOCD
-
ST-Link not recognized
- Check ST-Link drivers installation
- Verify USB connections
- Try different USB port
-
Target not found
- Check target board power and connections
- Verify OpenOCD configuration matches your hardware
- Check console output for error messages
-
Build errors
- Ensure all required features are available in Cargo.toml
- Check that the correct toolchain is being used
- Verify target architecture matches your hardware
Debug Console
Open the Debug console in RustRover to see detailed output from OpenOCD and GDB. This can help diagnose connection and configuration issues.
Advanced Configuration
Customizing OpenOCD Arguments
To modify OpenOCD behavior, edit the run configuration and adjust the OPENOCD_SERVER_ARGS field:
- Current:
--command "adapter speed 1000" --command "init" --command "reset init" --command "cortex_m reset_config sysresetreq" - Modify adapter speed, initialization commands, or reset configuration as needed
Adding New Targets
To add support for additional Traveo II devices:
- Add the feature to Cargo.toml
- Create a new build configuration with the appropriate target and features
- Create a corresponding debug configuration with the matching OpenOCD config files
- Update this documentation
Comparison with VSCode
| Feature | VSCode (cortex-debug) | RustRover |
|---|---|---|
| Extension/Plugin | cortex-debug extension | Built-in Embedded Development |
| Configuration | launch.json + tasks.json | XML run configurations |
| OpenOCD Integration | Through cortex-debug | Native OpenOCD support |
| Build Integration | Tasks system | Cargo command configurations |
| Debugging Features | GDB integration | Full GDB debugging support |
The RustRover configurations provide equivalent functionality to the VSCode setup while leveraging RustRover's native embedded development capabilities.