Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add an example for XC8 #18

Open
RozeDoyanawa opened this issue Sep 3, 2024 · 6 comments
Open

Please add an example for XC8 #18

RozeDoyanawa opened this issue Sep 3, 2024 · 6 comments

Comments

@RozeDoyanawa
Copy link

Hello,
I've been trying for a while now to get XC8 to work in CLion. Preferably using the makefile MPLAB generates so that I can still use MPLAB for debugging. I really cant get their new nova system to play nice with XC8. The old system worked much better but crashes while parsing microchip code with later CLion releases.

The xc8-cc compiler does not seem to support anything CLion expects it to....

Help would be nice :3

@elmot
Copy link
Collaborator

elmot commented Sep 4, 2024

Please show your yaml file

@RozeDoyanawa
Copy link
Author

clion-custom-compiler-xc8-pic18.yaml
`compilers:

  • description: XC8 for PIC-18
    match-compiler-exe: "(.*/)?xc8-cc(.exe)?"
    match-language: C
    include-dirs:
    • D:\svn\tcptest\Ridorana\include
    • D:\svn\tcptest\Microchip\Include
    • C:\Program Files\Microchip\xc8\v2.30\pic\include
    • C:\Program Files\Microchip\xc8\v2.30\pic\include\c99
    • C:\Program Files\Microchip\xc8\v2.30\pic\include\proc
      defines-text: "
      #define __interrupt
      #define __code
      #define __at
      "
      `

I get "This file does not belong to any project target; code insight features might not work correctly", which indeed it does not. It does not work at all.
I do think this stems from this error:
Couldn't parse command line: 'C:\Program Files\Microchip\xc8\v2.30\bin\xc8-cc.exe -mcpu=18F27K42 -Wl,-Map=dist/default/production/Firmware_mk2.production.map -DXPRJ_default=default -Wl,--defsym=__MPLAB_BUILD=1 -mdfp=C:/Program Files (x86)/Microchip/MPLABX/v5.40/packs/Microchip/PIC18F-K_DFP/1.4.87/xc8 -fno-short-double -fno-short-float -memi=wordwrite -O3 -fasmfile -maddrqual=ignore -xassembler-with-cpp -Iinc_microchip -Iinc_ridorana -I. -Idist -mwarn=-3 -Wa,-a -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -Wl,--memorysummary,dist/default/production/memoryfile.xml -o dist/default/production/Firmware_mk2.production.elf build/default/production/HardwareInit.p1 build/default/production/src_ridorana_i2c/i2c_arp_client-xc8.p1 build/default/production/src_ridorana_i2c/i2c_slave-xc8.p1 build/default/production/VentilationValveController_mk2.p1 build/default/production/src_ridorana/EEProm.p1'
No input file specified

@elmot
Copy link
Collaborator

elmot commented Sep 5, 2024

Do your source files have .p1 extension?

@RozeDoyanawa
Copy link
Author

RozeDoyanawa commented Sep 5, 2024

I do believe that is the linking step. .p1 is compiled files. I'd assume similar to .o files.

Edit: Scratch that. Its an intermediary file: https://onlinedocs.microchip.com/oxy/GUID-BB433107-FD4E-4D28-BB58-9D4A58955B1A-en-US-6/GUID-2D934B8C-3395-46D3-909D-81C7103AF4EC.html

.p1 | P-code intermediate file

@elmot
Copy link
Collaborator

elmot commented Oct 3, 2024

Please provide an example project

@RozeDoyanawa
Copy link
Author

RozeDoyanawa commented Nov 1, 2024

TestProject.X.zip

Sorry for the delay, life got busy.
There you go, completely empty project from MPLAB, compiled too.

And, output from MPLAB compiler.

make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'D:/svn/Roze/Altium/Projects/RandomFirmwares/TestProject.X'
make  -f nbproject/Makefile-default.mk dist/default/production/TestProject.X.production.hex
make[2]: Entering directory 'D:/svn/Roze/Altium/Projects/RandomFirmwares/TestProject.X'
Non line specific message::: warning: (1020) unknown attribute "CFGPROG" in chipinfo file "C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8\pic\dat\ini\18f27k42.ini" at line 155
Non line specific message::: warning: (1020) unknown attribute "USERIDPROG" in chipinfo file "C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8\pic\dat\ini\18f27k42.ini" at line 6433
"C:\Program Files\Microchip\xc8\v2.30\bin\xc8-cc.exe"  -mcpu=18F27K42 -c   -mdfp="C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8"  -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx032 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits   -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto     -o build/default/production/TestProjectmain.p1 TestProjectmain.c 
Non line specific message::: warning: (1020) unknown attribute "CFGPROG" in chipinfo file "C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8\pic\dat\ini\18f27k42.ini" at line 155
Non line specific message::: warning: (1020) unknown attribute "USERIDPROG" in chipinfo file "C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8\pic\dat\ini\18f27k42.ini" at line 6433
"C:\Program Files\Microchip\xc8\v2.30\bin\xc8-cc.exe"  -mcpu=18F27K42 -Wl,-Map=dist/default/production/TestProject.X.production.map  -DXPRJ_default=default  -Wl,--defsym=__MPLAB_BUILD=1   -mdfp="C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8"  -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -msummary=-psect,-class,+mem,-hex,-file  -ginhx032 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto      -Wl,--memorysummary,dist/default/production/memoryfile.xml -o dist/default/production/TestProject.X.production.elf  build/default/production/TestProjectmain.p1     
Non line specific message::: warning: (1020) unknown attribute "CFGPROG" in chipinfo file "C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8\pic\dat\ini\18f27k42.ini" at line 155
Non line specific message::: warning: (1020) unknown attribute "USERIDPROG" in chipinfo file "C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8\pic\dat\ini\18f27k42.ini" at line 6433
Non line specific message::: warning: (1020) unknown attribute "CFGPROG" in chipinfo file "C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8\pic\dat\ini\18f27k42.ini" at line 155
Non line specific message::: warning: (1020) unknown attribute "USERIDPROG" in chipinfo file "C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8\pic\dat\ini\18f27k42.ini" at line 6433
:46441:: warning: (1311) missing configuration setting for config word 0x300000; using default
:46441:: warning: (1311) missing configuration setting for config word 0x300001; using default
:46441:: warning: (1311) missing configuration setting for config word 0x300002; using default
:46441:: warning: (1311) missing configuration setting for config word 0x300003; using default
:46441:: warning: (1311) missing configuration setting for config word 0x300004; using default
:46441:: warning: (1311) missing configuration setting for config word 0x300005; using default
:46441:: warning: (1311) missing configuration setting for config word 0x300006; using default
:46441:: warning: (1311) missing configuration setting for config word 0x300007; using default
:46441:: warning: (1311) missing configuration setting for config word 0x300008; using default
Non line specific message::: warning: (1020) unknown attribute "CFGPROG" in chipinfo file "C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8\pic\dat\ini\18f27k42.ini" at line 155
Non line specific message::: warning: (1020) unknown attribute "USERIDPROG" in chipinfo file "C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8\pic\dat\ini\18f27k42.ini" at line 6433
Non line specific message::: warning: (1020) unknown attribute "CFGPROG" in chipinfo file "C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8\pic\dat\ini\18f27k42.ini" at line 155
Non line specific message::: warning: (1020) unknown attribute "USERIDPROG" in chipinfo file "C:/Users/Roze/.mchp_packs/Microchip/PIC18F-K_DFP/1.8.249/xc8\pic\dat\ini\18f27k42.ini" at line 6433

Memory Summary:
    Program space        used    12h (    18) of 20000h bytes   (  0.0%)
    Data space           used     0h (     0) of  2000h bytes   (  0.0%)
    Configuration bits   used     5h (     5) of     5h words   (100.0%)
    EEPROM space         used     0h (     0) of   400h bytes   (  0.0%)
    ID Location space    used    10h (    16) of    10h bytes   (100.0%)

make[2]: Leaving directory 'D:/svn/Roze/Altium/Projects/RandomFirmwares/TestProject.X'
make[1]: Leaving directory 'D:/svn/Roze/Altium/Projects/RandomFirmwares/TestProject.X'

BUILD SUCCESSFUL (total time: 1s)
Loading code from D:/svn/Roze/Altium/Projects/RandomFirmwares/TestProject.X/dist/default/production/TestProject.X.production.hex...
Program loaded with pack,PIC18F-K_DFP,1.8.249,Microchip
Loading completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants