PlatformIO-Renode-Demos
PlatformIO-Renode-Demos copied to clipboard
STM32Cube issues
Hi, first of all thanks for these demo projects! I successfully used the STM32 Arduino demo. I'm in the process of setting up Renode in an STM32Cube based project, but I'm stuck.
To check if this is a general issue or if this is specific to my existing project, I used your STM32 Arduino project as a base, changed the framework from Arduino to STM32cube and swapped the arduino-specific main.cpp to a trivial STM32Cube based main. The code compiles just fine, however on launching the debugger, I get
[...]
PlatformIO: Initializing remote target...
.pioinit:13: Error in sourced command file:
in the debug console, and that's it. Renode does not launch anymore, and the debugger does not connect.
TBH, I'm at a loss here. Something specific about the STM32Cube framework seems to change how the debug process is initiated, and I haven't yet learned about the finer details of how that works. I'm not sure where that .pioinit file is located, and since there are no further errors, I'm not sure how to continue analyzing the issue.
Can you give me any pointers? Have you used Renode successfully with the STM32Cube framework?
Alright, by running pio debug --interface=gdb -- -x .pioinit, I was able to get the error message that I thought was probably missing: (gdb) Remote communication error. Target disconnected.: Success.
So the issue really is that Renode is not running. If I trigger an upload by myself to launch Renode, I can then successfully connect the debugger either on the shell or in VS Code to the running Renode instance. This is not necessary with the Arduino STM32 example though, so I'm not sure what the difference might be that causes the example to launch Renode before connecting GDB.
It's been a while since I've used PIO and Renode together so something might have changed in the meantime.
If you find an error and could send a PR, I'd look into it.