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 Unsupported Software
View previous topic :: View next topic  
Author Message
Jon Wilder
Tux's lil' helper
Tux's lil' helper


Joined: 04 Apr 2011
Posts: 98
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: 3806
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: 98
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: 3806
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: 98
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
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software 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