You need to log in to create posts and topics.

Cooperation with an external editor and debugger (e.g. Platformio)

PreviousPage 3 of 3
Quote from kordik on September 5, 2024, 12:54 pm

Yes, I use Simulide 1.1.0 R1912 (installed from Debian repositories). By the way, moving and renaming hex/elf file can be probably done using the python script, which is in the top directory ("extra_script.py"). The script can be configured to run post-compiled actions. In my case it creates the .lst file, I hope that the renaming can be done similarly.

Yes, that seems a good idea.
But you probably don't need to move the files if you use buildPath="../.pio/build/nanoatmega328"

You can also run commands from simulide before debug start.
Instead of:

    <step 
        command="avr-gcc"
        arguments=" -v"
    />

You can rename, move files or whatever.
Or call an script specific for debugging in Simulide.

You can add several steps if you want, have a look at simulide/data/codeeditor/compilers/compilers/avrgcc.xml.

More info about compiler.xml here (scrolling down a bit):
https://simulide.com/p/compiler/#compiling

I used following settings in the xml file:

<compiler name="Avrgcc-2" type="avrgcc" buildPath="../.pio/build/nanoatmega328/" >
    <step 
        command="avr-gcc"
        arguments=" -v"
    />
    <step 
        command="echo"
        arguments=" Copying hex and elf files..."
    />
    <step 
        command="cp"
        arguments=" $buildPathfirmware.elf $buildPath$fileName.elf"
    />
    <step 
        command="cp"
        arguments=" $buildPathfirmware.hex $buildPath$fileName.hex"
    />
</compiler>

 

and the debugging works.

 

 

Great!

Note that the first "step" is not needed if you add other steps.
That one is a "dummy" step, because 1.1.0 will not start Debugger if there is no command to execute.
In Development version it will work with no steps at all.

Also I forgot to mention that you don't need to generate .lst file in this case (you commented something about the python script doing it).
Simulide has support for avr-gcc and will use the elf file.
I think you already realized, but could be useful for others reading this.

Yes, I noticed that the lst file is not necessary, so the pio project can be without the post-compile python script. The only requirement is to compile the project in a debug mode.

I am looking forward to the new version of Simulide.

Best regards, J. Kordik

arcachofo has reacted to this post.
arcachofo
PreviousPage 3 of 3