View previous topic :: View next topic |
Author |
Message |
RLScott
Joined: 10 Jul 2007 Posts: 465
|
CCS now working in MPLAB-X |
Posted: Thu May 02, 2019 8:10 am |
|
|
I finally succeeded in getting MPLAB-X to work with CCS-C.
(Edit: Except that this did not quite do it! See my later post in this thread.)
Here is how I did it. I had a successful project going under MPLAB 8.92 and CCS-C on a PIC16F1783. I wanted MPLAB-X to work to be able to use ICD-4 and PICKIT 4. Rather than "import a MPLAB 8 project" in MPLAB-X, I started a brand new project, specifying the proper PIC and the CCS tool chain. I added the one source file to the "Files" tree in the left panel, and then hit "Build".
At first MPLAB-X reported "+EA not a valid command line parameter", which is strange, since +EA is one of the valid command line parameters appearing when I do a build in MPLAB 8.92. Here is the 8.92 command line:
Code: | "....\PICC\Ccsc.exe" +FM "main.c" +DF +LN +T +A +M +Z +Y=9 +EA #__16F1783=TRUE |
Then I noticed that the MPLAB-X command line did not call out the Ccsc.exe program. It started with \PICC\CCSCON.exe" instead. I don't know what CCSCON.exe is, but I looked at all the makefiles in the nbproject folder, and I found this in makefile-default.mk:
MP_CC="C:\PROGRA~2\PICC\CCSCON.exe"
MP_LD="C:\PROGRA~2\PICC\CCSCON.exe"
I edited the first one to make it:
MP_CC="C:\PROGRA~2\PICC\Ccsc.exe"
MP_LD="C:\PROGRA~2\PICC\CCSCON.exe"
and again tried a Build. This time it worked. And the hex file it produced was exactly the same as the hex file that I got under MPLAB 8.92, so apparently it is working now.
I don't know much about reading makefiles, so I do wonder how these makefiles were constructed. Since they contain CCS-specific parameters, I assume that the data comes from the CCS plugin. Is there any reason why the CCS plugin would give MPLAB-X the wrong setup info when constructing the makefiles? Here is the entire CCS command line as constructed by MPLAB-X now:
Code: | "C:\PROGRA~2\PICC\Ccsc.exe" out="build/default/production" main.c +FM +DF +CC +Y=9 +EA +DF +LN +T +A +M +J +EA +Z -P #__16F1783=1 |
I find it interesting that command line parameters +DF, +EA are repeated.
Anyway, with this one edit in "nbproject\makefile-default.mk", I have CCS working under MPLAB-X. _________________ Robert Scott
Real-Time Specialties
Embedded Systems Consulting
Last edited by RLScott on Thu May 02, 2019 9:50 am; edited 1 time in total |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19382
|
|
Posted: Thu May 02, 2019 8:19 am |
|
|
It worked 'out of the box' with MPLAX-X for me, so the CCSCON setting must
have come from something you did.
At least you have it working now, though you will find that honestly
MPLAB-X, is so bad, that I wonder how MicroChip can keep using it. :( |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
![](templates/subSilver/images/spacer.gif) |
RLScott
Joined: 10 Jul 2007 Posts: 465
|
|
Posted: Thu May 02, 2019 9:48 am |
|
|
Ttelmah wrote: | It worked 'out of the box' with MPLAX-X for me, so the CCSCON setting must
have come from something you did.
At least you have it working now, though you will find that honestly
MPLAB-X, is so bad, that I wonder how MicroChip can keep using it. :( |
It turns out I didn't have it working after all. The edit I made in makefile-default.mk gets overwritten every time I change the project configuration, such as turning the power to the target on or off. So I made a copy of Ccsc.exe (3.8 Mbytes) in the PICC programs folder and called it CCSCON.exe. The old CCSCON.exe I renamed to CCSCON-orig.exe, and I suppose it will never be called. But things do work now, even after project configuration changes.
I suspect the reason for the difficulty is that I am using the latest CCS plugin, but my CCS-C is version 5.050, so I suspect the plugin is not compatible with that old CCS-C version.
I agree that MPLAB-X is atrocious, and as an alternative I have ordered a ICD-U64 from CCS and plan to switch to the CCS IDE, which looks a lot more useful. _________________ Robert Scott
Real-Time Specialties
Embedded Systems Consulting |
|
![](templates/subSilver/images/spacer.gif) |
RLScott
Joined: 10 Jul 2007 Posts: 465
|
|
Posted: Thu May 02, 2019 10:13 am |
|
|
Good point. The error messages are not working. So my using Ccsc.exe instead of CCSCON.exe is not a solution either. So, going back to the original setup, letting the orginal CCSCON.exe run, I get a small message box with a title of "PIC-C COMPILER", a message of "Invalid option: +EX", and an "OK" button. The image on the task bar associated with this message box I recognize as a CCS graphic, so this is coming from CCS software. But the command line shown by MPLAB-X did not contain any "+EX" option. So I don't know where the +EX is coming from. It does not appear in any of the MPLAB-X makefiles in nbproject, so I assume that CCSCON.exe is passing it on to Ccsc.exe. Do you think updating to the latest CCS-C will fix it? _________________ Robert Scott
Real-Time Specialties
Embedded Systems Consulting |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu May 02, 2019 10:19 am |
|
|
Before going to that expense (assuming you don't have current
maintenance) I would install the latest MPLAB X plug-in, and
if that doesn't fix it, then ask CCS support for their opinion. |
|
![](templates/subSilver/images/spacer.gif) |
RLScott
Joined: 10 Jul 2007 Posts: 465
|
|
Posted: Thu May 02, 2019 10:31 am |
|
|
This may actually be a CCS problem. I copied the command line that MPLAB-X is using and ran it from within a Command prompt window (independent of MPLAB) and I got the same error (Invalid option: +EX). I even replaced all the command-line parameters with the ones that MPLAB 8.92 generated, and I still got the error. In fact, the only thing that makes a difference is using Ccsc.exe instead of CCSCON.exe. The same parameters execute OK under Ccsc.exe and produce and error under CCSCON.exe. So I think my CCSCON.exe and Ccsc.exe are just not compatible with each other.
CCSCON.exe, 48,128 bytes, 1/23/2014
Ccsc.exe 3,958,304 bytes, 1/25/2012
Edit:
I re-installed pcwhupd-v5.050.exe and now Ccsc.exe is dated 10/1/2015. Now I don't get anymore "+EX" errors. Let's hope everything works from here on out. _________________ Robert Scott
Real-Time Specialties
Embedded Systems Consulting |
|
![](templates/subSilver/images/spacer.gif) |
jeremiah
Joined: 20 Jul 2010 Posts: 1329
|
|
Posted: Thu May 02, 2019 11:43 am |
|
|
Out of curiosity, are you not installing the ccs plugin from inside mplabx (tools menu to something else...I forget off the top of my head?)? I've not had any problems doing it that way aside from having to provide src file paths in the mplabx project interface. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19382
|
|
Posted: Thu May 02, 2019 1:33 pm |
|
|
And, your plug-in is in the same directory as the compiler?.
It sounds to me as if it is somehow pulling a 'wrong version' along
the way here. |
|
![](templates/subSilver/images/spacer.gif) |
RLScott
Joined: 10 Jul 2007 Posts: 465
|
|
Posted: Fri May 03, 2019 2:18 pm |
|
|
It may have been my fault when migrating to a new computer. The plugin went fine. It turns out the whole problem was I had a 2012 Ccsc.exe for some reason. Now everything is working. I have programmed a target using both the PICkit 3 and the ICD 3. No problems remains! (Other than the general klunkiness of MPLAB-X). _________________ Robert Scott
Real-Time Specialties
Embedded Systems Consulting |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19382
|
|
Posted: Sat May 04, 2019 1:29 am |
|
|
It had all the signs of a wrong version somewhere.....
Glad you have got it fixed. ![Smile](images/smiles/icon_smile.gif) |
|
![](templates/subSilver/images/spacer.gif) |
|