Building and compiling from within Geany seems to be useful - avoids typing or having several terminals open for different scripts.
However, uploading from Geany ... aaam ... not a good idea.
It opens a new terminal every time and thus one must type the pw every time ... my keyboard and fingertips already showing wear-n-tear.![Smile :)]()
Now there is a way to pass the PW to sudo in a script but as far as I can see, it's a security risk. Your choice though.
Running a single script for compiling and uploading in a terminal is perhaps the best. Just hit the up-cursor and enter. Pw entry is only needed if the terminal timed out.
If one just wants to see if it compiles without errors, would use the Compile (as earlier) in Geany. If one wants to also upload, a script could be run in a terminal; something like:
#!/bin/bash
#compile and upload using .elf/picoprobe;
# modify it to your liking / need as per Mike**K's entry
# this script is in the root dir of the project
# if compilation fails, the script stops else uploads
# in case of a new project, just copy/paste it
# tested OK on Linux Mint 20; build in Geany: cmake 3.30
cd build
# -j12: use 12 cores for building
if (! make -j12); then
echo "Error while building!"
else
echo "Build OK, starting upload"
c="program "
c+=$(find ./ -maxdepth 1 -name "*.elf")
c+=" reset exit"
sudo openocd -f interface/picoprobe.cfg -f target/rp2040.cfg -c "$c"
fi
Really, we would like a REAL IDE. Wouldn't have this issue.
Note: Using something as a code-text editor and the Arduino 2 IDE for compiling / uploading is also available.
I just don't like the Arduino IDE. I used to edit the core libraries to my liking. In V2 they are now closed; and it uses MS code.
Also, I'm not interested being involved and being a suffering third party in someone else's war.
C++ always will be free and open.
HAVE FUN!
However, uploading from Geany ... aaam ... not a good idea.
It opens a new terminal every time and thus one must type the pw every time ... my keyboard and fingertips already showing wear-n-tear.

Now there is a way to pass the PW to sudo in a script but as far as I can see, it's a security risk. Your choice though.
Running a single script for compiling and uploading in a terminal is perhaps the best. Just hit the up-cursor and enter. Pw entry is only needed if the terminal timed out.
If one just wants to see if it compiles without errors, would use the Compile (as earlier) in Geany. If one wants to also upload, a script could be run in a terminal; something like:
#!/bin/bash
#compile and upload using .elf/picoprobe;
# modify it to your liking / need as per Mike**K's entry
# this script is in the root dir of the project
# if compilation fails, the script stops else uploads
# in case of a new project, just copy/paste it
# tested OK on Linux Mint 20; build in Geany: cmake 3.30
cd build
# -j12: use 12 cores for building
if (! make -j12); then
echo "Error while building!"
else
echo "Build OK, starting upload"
c="program "
c+=$(find ./ -maxdepth 1 -name "*.elf")
c+=" reset exit"
sudo openocd -f interface/picoprobe.cfg -f target/rp2040.cfg -c "$c"
fi
Really, we would like a REAL IDE. Wouldn't have this issue.
Note: Using something as a code-text editor and the Arduino 2 IDE for compiling / uploading is also available.
I just don't like the Arduino IDE. I used to edit the core libraries to my liking. In V2 they are now closed; and it uses MS code.
Also, I'm not interested being involved and being a suffering third party in someone else's war.
C++ always will be free and open.
HAVE FUN!
Statistics: Posted by Bill52 — Sat Dec 07, 2024 8:48 am