Compiling JAL file on Linux

43 views
Skip to first unread message

Mike

unread,
Jan 27, 2026, 3:30:44 PMJan 27
to jallist
Hi all,

I'm trying to compile a JAL file on my Linux Mint machine.  I have the compiler and jallib installed, but my call can't seem to find the library files.

This is my call:

~/microchip/jalv2compiler/bin/jalv2-x86-64 8digit1.jal -s ~/microchip/jallib/ -no-codfile -no-lst -no-variable-reuse

I've also tried these:

~/microchip/jalv2compiler/bin/jalv2-x86-64 8digit1.jal -s ~/microchip/jallib/include/ -no-codfile -no-lst -no-variable-reuse

~/microchip/jalv2compiler/bin/jalv2-x86-64 8digit1.jal -s ~/microchip/jallib/include/device/ -no-codfile -no-lst -no-variable-reuse

I didn't see any examples on the compiler's github.  Is there something I'm missing?

Regards,
Mike

Mike

unread,
Jan 27, 2026, 3:50:03 PMJan 27
to jallist
I think I have it.  I used the -s option to specify two directories:

~/microchip/jalv2compiler/bin/jalv2-x86-64 8digit1.jal -s ~/microchip/jallib/include/device/ -s ~/microchip/jallib/include/jal/ -no-codfile -no-lst -no-variable-reuse

Rob CJ

unread,
Jan 28, 2026, 12:42:25 PMJan 28
to jallist
Hi Mike,

I had a look at the Jallib Tutorial Book and I see only two examples for compiling a program:
  1. One example for Windows using the command line
  2. Examples for Windows and Linxe as part of the Visual Studio Code configuration description (compiling is then ctrl-shift-B in VS code).

I think it would be good if we would also add the command line version to the tutorial.

Kind regards,

Rob


Van: 'Mike' via jallist <jal...@googlegroups.com>
Verzonden: dinsdag 27 januari 2026 21:50
Aan: jallist <jal...@googlegroups.com>
Onderwerp: [jallist] Re: Compiling JAL file on Linux
 
--
You received this message because you are subscribed to the Google Groups "jallist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallist+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jallist/814ce9ef-5223-462d-972d-a37d5f70582fn%40googlegroups.com.

Mike

unread,
Jan 28, 2026, 3:27:49 PMJan 28
to jallist
Hi Rob,

I'll write up a "Using JAL with Linux" guide, describing all of the steps I used to get the JAL compilier and the PICKit2 programmer working on my Linux Mint machine.

Regards,
Mike
Message has been deleted

Mike

unread,
Jan 28, 2026, 7:34:56 PMJan 28
to jallist
Here's what I came up with.  Perhaps someone could try it.

1.  It's up to you where the files are located.
    You could use ~/jal/ or something else.
    So, create whatever directory is necessary.
    I have everything in ~/microchip/
2.  Navigate to whatever base directory you're using:
    $ cd ~/microchip
3.  Download the JAL compiler.
    Or clone it from github: ~/microchip$ git clone https://github.com/jallib/jalv2compiler.git
4.  Navigate to the bin directory:
    ~/microchip$ cd jalv2compiler/bin
5.  For safety, remove all execute permissions:
    ~/microchip/jalv2compiler/bin$ chmod -x *
6.  Add execute permission to the just the 64-bit linux binary:
    ~/microchip/jalv2compiler/bin$ chmod +x jalv2-x86-64
7.  Return to the main directory:
    ~/microchip/jalv2compiler/bin$ cd ../..
8.  Download jallib.
    Or clone it from github: ~/microchip$ git clone https://github.com/jallib/jallib.git
9.  One example of compiling a JAL program from the project's directory:
    ~/microchip/projects/test$ ~/microchip/jalv2compiler/bin/jalv2-x86-64 test.jal -s ~/microchip/jallib/include/device/ -s ~/microchip/jallib/include/jal/ -no-codfile -no-lst -no-variable-reuse
10. If you want to use the PICKit2, download pk2cmd.
    Or clone it from github: ~/microchip$ git clone https://github.com/psmay/pk2cmd
11. The full libusb package is necessary to use pk2cmd.
    Check if it is installed:
    $ apt list --installed libusb-dev
    If not installed, install it:
    $ sudo apt-get install libusb-dev
12. Build and install pk2cmd:
    ~/microchip/$ cd pk2cmd/pk2cmd
    ~/microchip/pk2cmd/pk2cmd$ make linux
    ~/microchip/pk2cmd/pk2cmd$ sudo make install
13. With the PICKit2 connected and attached to a PIC via ICSP...
    Detect the PIC device:
    $ pk2cmd -P
    One example of writing a hex file:
    $ pk2cmd -B/home/mike/microchip/pk2cmd/ -PPIC16F886 -f my_hex_file.hex -M -Y
    Running pk2cmd with no arguments will list the help instructions

Regards,
Mike

Mike

unread,
Jan 28, 2026, 8:21:07 PMJan 28
to jallist
Add ".git" to the link in step #10.

Rob CJ

unread,
Jan 29, 2026, 12:53:01 PMJan 29
to jallist
Hi Mike, 

The instruction can be much simpler. Do not download the compiler from GitHub nor Jallib from GitHub.

Just download the Jallib release (zip-file) from the JAL website and extract it. It contains everything you need. 

For editting and compiling I use Visual Studio Code both on Linux Mint as wel as on Windows 11. 

And for programming I use a PICkit3 and I use the PICkitminus software since that supports newer PICs.This also works for a PICkit2.

This is also described in the Jallib Tutorial but the part about PICkitminus should be updated since it still describes the PICkit3 software from Microchip and only the database from PICkitminus but nowadays you should download PICkimins which includes the database. I will update the Jallb Tutorial for that part.  Unfortunately the UI only works for Windows but the commandline version is available for Linux too.

Kind regards,

Rob




Van: 'Mike' via jallist <jal...@googlegroups.com>
Verzonden: donderdag 29 januari 2026 02:21
Aan: jallist <jal...@googlegroups.com>
Onderwerp: Re: [jallist] Re: Compiling JAL file on Linux
 

Mike

unread,
Jan 29, 2026, 1:51:15 PMJan 29
to jallist
Hi Rob,

I don't use Visual Studio, just a simple text editor.  I have no need for an IDE.  I also don't use PICKitMinus, since it requires a purchase.  And I think it's only for Windows anyway.  Some years ago I modified the PICKitPlus software from Microchip to handle newer PIC's.  I use that when I need to program PIC's from my Windows machine.  But I'll probably eventually move my changes into pk2cmd so that I can use those newer chips on Linux.

Regards,
Mike

Rob CJ

unread,
Jan 29, 2026, 3:07:32 PMJan 29
to jal...@googlegroups.com
Hi Mike,

PICkitminus is open source, just follow the link, I think you are mistaken with PiCkitplus which requires a purchase.

And of course everybody uses the editor of his liking but Sunish has made a very nice extension for Visual Studio Code so that you have syntax highting and you can build your program just by pressing ctrl-shift-b. I then use the PICkitminus (with UI) to load the hexfile and program the PIC. I think you could also run that using the command line directly from VS code (build & run) but I never tried it and each time starting the programmer from the command line is quite slow.

Last but not least. Do not confuse Visual Studio Code (which runs on Linux and Windows) with Visual Studio which only runs on Windows and is much heavier than Visual Studio Code.

Kind regards,

Rob




Van: 'Mike' via jallist <jal...@googlegroups.com>
Verzonden: donderdag 29 januari 2026 19:51

Mike

unread,
Jan 29, 2026, 5:20:19 PMJan 29
to jallist
Hi Rob,

This is funny, since I think I'm the one who first mentioned PICKitMinus here back in 2022. lol  I forgot which was which.  Yes, PICKitMinus is generously free.  And he has the command line version, pk2cmd, which is what you might want to add to the JAL docs if necessary.  It would still be nice to have a section in the docs for those who don't want an IDE.

One problem with pk2cmd that users might want to know is that you can turn on "Vdd/target voltage" with the "-T" option, but there doesn't seem to be a command to turn it off.  I was going to add that feature to my version, but if the Minus guy accepts pull requests I can add it there too.

Regards,
Mike

Rob CJ

unread,
Jan 30, 2026, 2:51:20 PM (13 days ago) Jan 30
to jallist
Hi Mike,

Could be.

In the meantime I did an update of the Jallib Tutorial book. There is a section on how to compile your code but the example is only for Windows so I added an example for Linux.


As I mentioned before you should download the zipfile from the stable release (or a bee-package if you want all the new stuff that is being worked on). If you unzip that file, you only need (after the -s) add the location of the lib directory since all device files and all libraries are in that directory.

Kind regards,

Rob


Van: 'Mike' via jallist <jal...@googlegroups.com>
Verzonden: donderdag 29 januari 2026 23:20

Mike

unread,
Feb 3, 2026, 4:48:38 PM (9 days ago) Feb 3
to jallist
Hi Rob,

Yes, you're right, I should be using the release download instead of the github files.

Can the docs have info for using pk2cmd, so that JAL-ers aren't forced to install Visual Studio Code?

Regards,
Mike

Rob CJ

unread,
Feb 4, 2026, 12:39:39 PM (8 days ago) Feb 4
to jallist
Hi Mike,

I do not see the relation between the pkdcmd and Visual Studio Coee. I use Visual Studio Code only for editing and compiling and I upload the hexfile separtely using the PICkitminus UI (so not pk2cmd). 

I could add some info on using the PICkitminus command line in the Tutorial Book if that helps. I am not a user of the command line so I need to see which options are often used or you maybe you can provide some text that I can add to the Tutorial Book.

Kind regards,

Rob


Van: 'Mike' via jallist <jal...@googlegroups.com>
Verzonden: dinsdag 3 februari 2026 22:48

vasi vasi

unread,
Feb 4, 2026, 2:49:36 PM (8 days ago) Feb 4
to jal...@googlegroups.com
pk2cmd can be used in Visual Studio Code via a task.json file so, it can be accessed from the VSC menu... 
For advanced people, a Makefile can also be created and used from inside VSC. This can apply to you as well if your program accept command line or you can have a command line version of your preferred application. In that case, all the console messages are available/visible in VSC. It makes the life easier, especially when you correct/upload the firmware often (as is the case when you don't have a debugger at hand and the only method is the classic LED).



--
Vasi

Mike

unread,
Feb 8, 2026, 6:35:36 PM (4 days ago) Feb 8
to jallist
Hi Rob,

PICKitMinus is only for Windows.  Anyone programming PIC's on Linux has to use pk2cmd to upload the hex file to the PIC.

Regards,
Mike
Reply all
Reply to author
Forward
0 new messages