Geany as IDE for Linux

It is not a big deal now, but for documentary purposes I would like to write down what settings are necessary to allow  comfortable working.

First of all, you can of course use the supplied GCB @ Syn IDE with the help of wine.

 

For me, however, this resulted in a considerable (factor 10-11) longer compile and flash time. Since I'm not the wine fan anyway, I've created a way for me with Geany, the Universal IDE.

Presumably one of the reasons is that the GCB @ SYN IDE is calling several tools through the Command.com interface, even native Windows has lost performance.

So when loading a Great Cow BASIC program syntax Highlighting is activated, as shown here complement the Freebasic entry. For your information, the syntax of Freebasic is practically identical to that of Great Cow BASIC, only the special commands like #chip are not highlighted, but I can get over that.

 

 

 

 

 


To be able to directly compile and flash with F8 and F9, the following entries are necessary. Please note that a * .gcb file is loaded and the tab is also active, because Geany has different tools for each file type. The third line I had as a first approach, here I always had to adjust the PIC type, which can be annoying if you want to work with two or more different models. The program test-flash.sh mentioned in the screenshot I knitted to find the #chip line and to give the Java program the PIC type. It is still in an experimental stage, but seems to work reasonably well. Of course, I will investigate reported errors as soon as possible.

 


 

A third, not so critical point is reformatting the source code. Geany offers a universal interface for sending a selection to an external program. I opted for FBeauty . It is a program written in Freebasic that does the reformat. Since the FreeBasic compiler needs to be installed anyway to compile the native Great Cow BASIC compiler, it's already there, so it's not really a thing. One could even improve the Source to format the GCBASIC special Vocabularies, but I let it up for others.

 

 


Here is the source text of test-flash.sh

It assumes using  PicKit3 and mplap_ipe V4.05, but surely will work with later Versions, too.

If you do use another Version read the first few next lines and execute the find command

# to set the correct Path to ipecmd.jar execute the following line:
# find /opt -name ipecmd.jar
# this will print out one or more lines, choose the one you want use
# and edit the next line
IPECMD = "/opt/microchip/mplabx/V4.05/mplab_ipe/ipecmd.jar"
# simple test for Typo
if [-e "$ IPECMD"]
then 
	# finding the filename
	BASENAME = "$(basename $1)"
	GCBNAME = "$(echo $BASENAME | cut -f1 -d.)"
	#echo "Basic Source = $GCBNAME.gcb"
	BASICFILE = "$(dirname $1) / $GCBNAME.gcb"
	CHIPLINE = "$(grep -i '#chip' $BASICFILE)"
	TARGET = "$(echo $ CHIPLINE | sed 's /#chip//I' | sed 's / \ + // g' | cut -d, -f1)"
	echo "Flashing Target: $TARGET"
	echo "using java -jar $IPECMD -TPPK3 -P$TARGET -M -F \" $1 \ ""
	java -jar $IPECMD -TPPK3 -P$TARGET -M -F"$1"
else
	echo "$IPECMD was not found"
fi

copy test-flash.sh (or under a better-fitting name) to any location, make it executable  and enter the path into Geany as shown above.

Anyone who has installed the IPECMD in a different version and / or somewhere else must of course adapt the first line.

Update:

I am now on Debian Testing (Buster) New Installation of MPLABX-v4.15-linux-installer.tar leads me in a little bit of trouble.

While Flashing it comes to serious Warnings aka:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.netbeans.ProxyURLStreamHandlerFactory (file:/opt/microchip/mplabx/v4.15/mplab_ipe/lib/boot.jar) to field java.net.URL.handler
WARNING: Please consider reporting this to the maintainers of org.netbeans.ProxyURLStreamHandlerFactory
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
this was caused by calling ipe.jar directly instead of using the already provided ipecmd.sh.
So if you call ipecmd.sh instead of ipecmd.jar all is fine.
Example: IPECMD="/opt/microchip/mplabx/v4.15/mplab_ipe/ipecmd.sh"

Update2:

It is possible to completely do without the Java overhead,
when you actually no longer use the supported pickit2. 
I am writing a short article about this, please be patient.

 
Author: bed aka Darkdau in Great Cow BASIC Forum