Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Tutorial - Installing MPLAB X on 64-bit Gentoo (PICmicro)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Jon Wilder
Tux's lil' helper
Tux's lil' helper


Joined: 04 Apr 2011
Posts: 112
Location: Fresno CA

PostPosted: Sat Aug 15, 2015 6:21 pm    Post subject: Tutorial - Installing MPLAB X on 64-bit Gentoo (PICmicro) Reply with quote

If you're an embedded electronics guy like myself and if the PICmicro is your processor of choice, then this tutorial is for you. Microchip's cross platform PICmicro IDE, MPLAB X, also works on Gentoo. However, due to MPLAB X being a binary application that uses an interactive installer, it is not offered in the Portage tree, thus requires a manual installation. Furthermore, Microchip does not cover any instructions on how to install it on the Gentoo distro. Therefore, I took this opportunity to write a step by step tutorial on how I installed it on my Gentoo system.

I run KDE Plasma 5 on my Gentoo system and it has been tested and works flawlessly on my system.

*NOTE* You must be either logged in as the root superuser OR have Sudo installed and be logged in as a user with Sudo use permissions in order to rebuild packages. If using Sudo, make sure you append "sudo" to the beginning of each code example.

Install A Window Manager & Graphical Desktop Environment

This document assumes that you at least have Xorg-server window manager and a graphical desktop environment such as KDE or Gnome installed on your system. MPLAB X requires the system to have a windowing environment installed on the system in order to work. If your system already has these installed, then let's proceed.

Select A "Multilib Friendly" Profile

MPLAB X is a 32-bit application. If you're running Gentoo on a 64-bit system, you will need to select a profile that is multilib friendly. Type the following command to see which profile you currently have selected -

Code:

~ $ eselect profile list


Pick a profile that best meets your needs that is not a “no-multilib” profile, then type -

Code:

~ $ eselect profile set x
~ $ env-update && source /etc/profile


Where “x” is the profile number you want to select. Once this is done, you can then proceed to run the installer.

Download The Installer

First, we'll create a directory for the installer to download into. Then we will change into that directory -

Code:

~ $ mkdir -pv Downloads
~ $ cd Downloads


Then we will use wget to download the installer -

Code:

~/Downloads $ wget --user-agent=firefox http://www.microchip.com/mplabx-ide-linux-installer


This will download the MPLAB X IDE Linux installer into the newly created Downloads subdirectory of your home directory.

Extract The Installer

Extract the installer by executing the following command -

Code:

~/Downloads $ tar -xvf MPLABX-<version>-linux-installer.tar


This should give us the installer's executable with a .sh extension.

Run The Installer

Attempt to run the installer by executing the following command -

Code:

~/Downloads $ ./MPLABX-<version>-linux-installer.sh


When you first try to run the MPLAB X installer, the CLI returns that you need the following 32-bit libraries -

libexpat.so – dev-libs/expat
libX11.so – x11-libs/libX11
libXext.so – x11-libs/libXext

To obtain these libraries, we can rebuild these 3 packages with 32-bit libraries, but we must first add the abi_x86_32 use flag to these packages by following these simple steps -

Code:

~/Downloads $ echo “dev-libs/expat abi_x86_32” >> /etc/portage/package.use/expat
~/Downloads $ echo “x11-libs/libX11 abi_x86_32” >> /etc/portage/package.use/libX11
~/Downloads $ echo “x11-libs/libXext abi_x86_32” >> /etc/portage/package.use/libXext


This will allow the above packages to pull in both 32-bit and 64-bit libraries when you rebuild them in Portage.

If you wish to enable 32-bit libraries globally for all packages, you can instead add the following to /etc/portage/make.conf -

Code:

ABI_X86=”32 64”


Note that enabling this parameter globally will require a system newuse update if you wish to rebuild everything with 32-bit libraries. See the Portage manual for more information.

Rebuild The Required Packages

Once this change has been made, execute the following -

Code:

~/Downloads $ emerge --ask x11-libs/libX11 \
> x11-libs/libXext \
> dev-libs/expat


Type “y” when Portage asks if you would like to emerge these packages. This will rebuild these three packages with the 32-bit libraries needed to install MPLAB X.

Run The Installer - Again

Once you have rebuilt the above listed packages, then we can run the MPLAB X installer -

Code:

~/Downloads $ ./MPLABX-<version>-linux-installer.sh


Once the installer successfully runs, follow the prompts in the CLI to install MPLAB X.


Last edited by Jon Wilder on Sun Aug 16, 2015 3:26 am; edited 2 times in total
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Sat Aug 15, 2015 7:22 pm    Post subject: Reply with quote

May I ask why you need a non multilib profile in the first place?

Quote:
This will allow the above packages to pull in both 32-bit and 64-bit libraries when you rebuild them in Portage.

If you wish to enable 32-bit libraries globally for all packages, you can instead add the following to /etc/portage/make.conf -

Code:

ABI_X86=”32 64”


Than you suggest a "multilib setup"
When I understood it right is this ABI_X86=”32 64” The new way for multilib...


Is the ICD2 supported? Ty

Please tell me if ICD2 is supported. If so, I will test it with my ordinary profile in the multilib setup and check if it works. I do not want to install that package when my deprecated programmer is not supported anymore, ty.
Back to top
View user's profile Send private message
Jon Wilder
Tux's lil' helper
Tux's lil' helper


Joined: 04 Apr 2011
Posts: 112
Location: Fresno CA

PostPosted: Sun Aug 16, 2015 3:24 am    Post subject: Reply with quote

That was a typo in the sub-headline. I've corrected it. If you notice though, I stated in the first sentence to select a profile that is NOT a "no-multilib" profile...meaning a profile that is multilib friendly.

The ICD2 is not supported in MPLAB X. You might try running MPLAB 8.92 using Wine and see if that works. I use a PICkit 3 myself, which is an awesome programmer and is fully supported in MPLAB X (as is the PICkit 2).
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Sun Aug 16, 2015 8:17 am    Post subject: Reply with quote

Luckily i build a clone at that time and did not paid the 200-300 us dollars for it.

in debugging i always blew up the microcontrollers because of overvoltage...

programming worked though... well i gave up on those stuff.

these days you get arm boards for less than 5 euros with full usb connector and a few pinouts. much more powerful regarding calculations.

just a question: which compiler are you using and does it have code rescritction?

i got a C compiler license with unlimited code generation. but the free c compiler afaik could only generate 1k code and thats nothing even for pix 16f84 with 4k code afaik rom ....


The 18 Pic Series could be interesting with these touchless keys feature, but else I am not htat convinced anymore to bother with pic. And these 18 probably needs to be programmed in assembler, or a compiler license? am i wrong?
Back to top
View user's profile Send private message
Jon Wilder
Tux's lil' helper
Tux's lil' helper


Joined: 04 Apr 2011
Posts: 112
Location: Fresno CA

PostPosted: Sun Aug 16, 2015 4:16 pm    Post subject: Reply with quote

tw04l124 wrote:
Luckily i build a clone at that time and did not paid the 200-300 us dollars for it.

in debugging i always blew up the microcontrollers because of overvoltage...

programming worked though... well i gave up on those stuff.

these days you get arm boards for less than 5 euros with full usb connector and a few pinouts. much more powerful regarding calculations.

just a question: which compiler are you using and does it have code rescritction?

i got a C compiler license with unlimited code generation. but the free c compiler afaik could only generate 1k code and thats nothing even for pix 16f84 with 4k code afaik rom ....


The 18 Pic Series could be interesting with these touchless keys feature, but else I am not htat convinced anymore to bother with pic. And these 18 probably needs to be programmed in assembler, or a compiler license? am i wrong?


I dabble in both assembly and C so I use the free MPASM assembler for the assembly stuff. For C I use Microchip's new XC8 compiler (which is also cross platform with Linux and MacOS), which is cross compatible with their PICC HiTech compiler and their C18 compiler.

No code size restriction, but where they get you is on optimization. The free license compiles it a bit bloated whereas the pro license compiles much tighter code.

The PICkit 3 programmer only runs $47.95USD and it's a very nice in circuit programmer. I'm all for the development boards and such but people tend to get a bit stuck on those things, designing projects around the board itself rather than around the processor and designing their own board.
Back to top
View user's profile Send private message
Jon Wilder
Tux's lil' helper
Tux's lil' helper


Joined: 04 Apr 2011
Posts: 112
Location: Fresno CA

PostPosted: Mon Dec 19, 2022 6:50 am    Post subject: Update - MPLAB X is now 64-bit Reply with quote

MPLAB X Release v5.40 brought MPLAB X to the 64-bit arena. Multilib is no longer a requirement. Those running a pure 64-bit Gentoo installation can install MPLAB X v5.40 and later with no issue.

The only downside to this is that the Microchip PIC Assembler, MPASM, is no longer supported. It has always been a 32-bit assembler, and Microchip has no interest in making a 64-bit version. Their XC8 compiler ships with its own 64-bit assembler, known as PIC-AS.

For those who code PICmicro's in assembly, PIC-AS is quite a bit different from MPASM. The XC8 PIC Assembler User Guide is available here -

https://ww1.microchip.com/downloads/en/DeviceDoc/MPLAB%20XC8%20PIC%20Assembler%20User%27s%20Guide%2050002974A.pdf

Downloading and installing the XC8 Compiler also installs the PIC-AS Assembler.

There have also been some BIG changes with Microchip. In 2016, they acquired Atmel Corporation. Since the acquisition, the following has happened -

MPLAB X now supports Atmel AVR and the Atmel avr-gcc tool chain

Microchip XC8 Compilers now support Atmel AVR

Atmel Studio (for those who code Atmel devices under Windows) is now Microchip Studio

The PICKit 4 Programmer was released in Q1 2018. Aside from having a dedicated microSD slot for Programmer-To-Go it brings a host of new features to the table.
* Supports PICmicro and Atmel AVR devices
* Microchip In Circuit Serial Programming and debugWire Interfaces (ICSP)
* Atmel In System Programming Interface (ISP)
* MIPS EJTAG Interface
* Cortex Serial Wire Debug Interface (SWD)
* AVR JTAG Interface
* UPDI, PDI, and TPI Interfaces

The PICKit 4 is fully supported in MPLAB X and Microchip Studio.

Microchip Studio also supports all of the other Atmel programmers (AVR Dragon, STK 500, USBASP, Atmel-ICE, USBTiny, etc).

For those of you with the Atmel Xplained series development boards, these are fully supported in MPLAB X.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30918
Location: here

PostPosted: Mon Dec 19, 2022 8:14 am    Post subject: Reply with quote

Moved from Unsupported Software to Documentation, Tips & Tricks.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum