• AVR Freaks

Hot!I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here.

Page: 12 > Showing page 1 of 2
Author
CVRIV
Super Member
  • Total Posts : 163
  • Reward points : 0
  • Joined: 2017/09/06 13:49:25
  • Location: 0
  • Status: offline
2020/07/31 00:34:00 (permalink)
5 (1)

I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here.

I have been reading through all the PDFs:
MPLAB® XC8 PIC® Assembler User's Guide
 
MPASM™ to MPLAB® XC8 PIC® Assembler Migration Guide
MPLAB® XC8 PIC Assembler User's Guide for Embedded Engineers
 
I'm getting non-stop syntax errors, lexical errors, phase errors... I have a simple assembler file with just about nothing in it. Im trying to start slow with it but nothing is working. I have to be missing something. I'm following the PDFs, but nothing is working. 
 
PROCESSOR 16F883

INCLUDE <xc.inc>;LINE 31

; CONFIG 1 0x2007
;**************************************************
CONFIG FOSC = HS, WDTE = OFF, PWRTE = OFF, MCLRE = ON, CP = OFF, CPD = OFF;
CONFIG BOREN = OFF, IESO = ON, FCMEN = ON, LVP = OFF, DEBUG = OFF;

; CONFIG 2 0x2008
;**************************************************
CONFIG BOR4V = BOR40V, WRT = OFF;

; PAGE 0
;##################################################
;ORG 0x0000;
GOTO InitialCode;LINE 45

; SERVICE INTERUPTS
;**************************************************
;ORG 0x0004 ; Service interrupts start here.

; INITIAL CODE
;**************************************************
InitialCode:

; MAIN CODE
;**************************************************
MainCode:

GOTO MainCode;

; SUBROUNTINES
;**************************************************

; END OF CODE
;**************************************************
END

 
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'D:/PROJECTS/EE/PROJECTS/WS2812 RGB Strip/PIC16F883'
make -f nbproject/Makefile-default.mk dist/default/production/PIC16F883.production.hex
make[2]: Entering directory 'D:/PROJECTS/EE/PROJECTS/WS2812 RGB Strip/PIC16F883'
"E:\Microchip\xc8\v2.20\bin\xc8-cc.exe" -c -mcpu=16F883 -mdfp="E:/Microchip/MPLABX/v5.40/packs/Microchip/PIC16Fxxx_DFP/1.2.33/xc8" -fno-short-double -fno-short-float -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-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o "build/default/production/WS2812 RGB Strip_PIC16F883_Main Code.o" "WS2812 RGB Strip_PIC16F883_Main Code.s"
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
make[2]: *** [build/default/production/WS2812 RGB Strip_PIC16F883_Main Code.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
WS2812 RGB Strip_PIC16F883_Main Code.s:31:: error: (876) syntax error
WS2812 RGB Strip_PIC16F883_Main Code.s:31:: error: (844) lexical error
WS2812 RGB Strip_PIC16F883_Main Code.s:45:: error: (840) phase error
(908) exit status = 1
nbproject/Makefile-default.mk:113: recipe for target 'build/default/production/WS2812 RGB Strip_PIC16F883_Main Code.o' failed
make[2]: Leaving directory 'D:/PROJECTS/EE/PROJECTS/WS2812 RGB Strip/PIC16F883'
nbproject/Makefile-default.mk:91: recipe for target '.build-conf' failed
make[1]: Leaving directory 'D:/PROJECTS/EE/PROJECTS/WS2812 RGB Strip/PIC16F883'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
BUILD FAILED (exit value 2, total time: 214ms)
#1

37 Replies Related Threads

    JPortici
    Super Member
    • Total Posts : 1114
    • Reward points : 0
    • Joined: 2012/11/17 06:27:45
    • Location: Grappaland
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/07/31 00:44:10 (permalink)
    +1 (1)
    I think you have chosen "XC8" as the compiler, because it's calling xc8-cc whereas it should be calling xc8-as.
    Also, see that some of the error messages are related to the C environment.
     
    You can change the compiler/assembler in the project options
    (I still get errors but at least they are related to assembly)
    #2
    ric
    Super Member
    • Total Posts : 28011
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/07/31 02:03:24 (permalink)
    +1 (3)
    If you don't see PIC-AS as an available tool, you may have used non standard install locations for some of the tools.
    There's a bit more dicussion about that in this topic
    https://www.microchip.com/forums/m1142190.aspx
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #3
    CVRIV
    Super Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/09/06 13:49:25
    • Location: 0
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/07/31 13:41:36 (permalink)
    0
    Leaving XC8 where I installed it initially, I went to Tools > Options > Embedded > Build Tools and then add the pic-as base directory. After this I was able to select pic-as as my compiler. I also uninstalled XC8 and installed it here (C:\Apps\PIC_dev\MPLABXC), as per what I saw someone else do the the linked thread. I had to add the base directory for both install locations. 
     
    After having done both of the install locations, with this code:
    ;CONFIG 1 0x2007 
    ;************************************************** 
    CONFIG FOSC = HS, WDTE = OFF, PWRTE = OFF, MCLRE = ON, CP = OFF, CPD = OFF; 
    CONFIG BOREN = OFF, IESO = ON, FCMEN = ON, LVP = OFF, DEBUG = OFF;
    ;CONFIG 2 0x2008 
    ;************************************************** 
    CONFIG BOR4V = BOR40V, WRT = OFF;
    ;PAGE 0 
    ;##################################################
    ;ORG 0x0000;
    GOTO InitialCode;
    ;Initial CODE 
    ;**************************************************
    InitialCode:
    ;MAIN CODE 
    ;**************************************************
    MainCode:
    BCF STATUS,C;
    GOTO MainCode;
    ; END OF CODE 
    ;**************************************************
    END

     
    I get these errors:
    make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
    make[1]: Entering directory 'D:/PROJECTS/EE/PROJECTS/WS2812-RGB-Strip/PIC16F883'
    make -f nbproject/Makefile-default.mk dist/default/production/PIC16F883.production.hex
    make[2]: Entering directory 'D:/PROJECTS/EE/PROJECTS/WS2812-RGB-Strip/PIC16F883'
    "C:\Apps\PIC_dev\MPLABXC\xc8\v2.20\pic-as\bin\pic-as.exe" -mcpu=PIC16F883 -c \
    -o build/default/production/WS2812-RGB-Strip_PIC16F883_Main-Code.o \
    WS2812-RGB-Strip_PIC16F883_Main-Code.s \
    -msummary=+mem,-psect,-class,-hex,-file,-sha1,-sha256,-xml,-xmlfull -fmax-errors=20 -mwarn=0 -xassembler-with-cpp
    make[2]: *** [build/default/production/WS2812-RGB-Strip_PIC16F883_Main-Code.o] Error 1
    make[1]: *** [.build-conf] Error 2
    make: *** [.build-impl] Error 2
    WS2812-RGB-Strip_PIC16F883_Main-Code.s:41:: error: (840) phase error
    WS2812-RGB-Strip_PIC16F883_Main-Code.s:50:: error: (800) undefined symbol "C"
    WS2812-RGB-Strip_PIC16F883_Main-Code.s:50:: error: (800) undefined symbol "STATUS"
    WS2812-RGB-Strip_PIC16F883_Main-Code.s:50:: error: (840) phase error
    (908) exit status = 1
    nbproject/Makefile-default.mk:107: recipe for target 'build/default/production/WS2812-RGB-Strip_PIC16F883_Main-Code.o' failed
    make[2]: Leaving directory 'D:/PROJECTS/EE/PROJECTS/WS2812-RGB-Strip/PIC16F883'
    nbproject/Makefile-default.mk:91: recipe for target '.build-conf' failed
    make[1]: Leaving directory 'D:/PROJECTS/EE/PROJECTS/WS2812-RGB-Strip/PIC16F883'
    nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
    BUILD FAILED (exit value 2, total time: 255ms)
     
    Why am I getting the phase error? I didn't define STATUS and C. I forgot there's no PIC16F883 include file with all that done for me already.
    #4
    PStechPaul
    Super Member
    • Total Posts : 2814
    • Reward points : 0
    • Joined: 2006/06/27 16:11:32
    • Location: Cockeysville, MD, USA
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/07/31 14:08:51 (permalink)
    0
    You need to add the include file, perhaps supplying the full path to its location.
     
    And your project is on D: drive while the application is on C: drive. Should be OK, but may require setting search paths accordingly.

     
    #5
    CVRIV
    Super Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/09/06 13:49:25
    • Location: 0
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/07/31 14:30:08 (permalink)
    0
    Which include file? The xc.inc file? I'm going to reinstall XC8 back onto D: where I had it last. I like to keep all my installed apps in one specific location. 
    #6
    CVRIV
    Super Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/09/06 13:49:25
    • Location: 0
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 02:08:52 (permalink)
    0
    I completely reinstalled Windows 10, because I got a larger drive for my pc. I installed MPLAB v8.92, MPLABX v5.35, MPLABX v5.40, and XC8 in their default locations. I even created my test project for 5.40 in its default location. When I went to create my project thing time, pi-as was automatically there to be selected as the toolchain. When I went to add a new source file, in the menu there were C and C++ options. I had to click other to add an (assembly.s) file.
     
    I loaded that simple code back into the assembly file and I'm still getting that phase error for my GOTOs. I tried adding #INCLUDE <xc.inc>, but I'm getting syntax and lexical errors for that. 
     
    What am I just not understanding here? Besides a lot. I can't believe I haven't been able to code anything yet. I ordered my Pickit4 and it's going to be here on monday. I'd really like to try to get this sort out so I can start playing around with all this.
     
    Thanks. 
    #7
    ric
    Super Member
    • Total Posts : 28011
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 03:03:40 (permalink)
    +2 (2)
    There's something wrong here.
    You are getting errors on line#50, but the code you posted only has 22 lines.
    Are you sure that is the full contents of WS2812-RGB-Strip_PIC16F883_Main-Code.s
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #8
    1and0
    Access is Denied
    • Total Posts : 11000
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 08:48:00 (permalink)
    +4 (4)
    I have not used the new PIC-AS assembler yet, so I could be wrong here. Anyway, the followings are my educated guesses:
    • The "phase error" is because of a conflicting delta value in a psect. For program memory space, PIC10/12/16 devices use a delta of 2 and PIC18 devices use a delta of 1. The default delta value is 1.
    • The "undefined symbol" error is because of not including the <xc.inc> file. Since OP said he has added that, so this error is probably caused by his source file not using the .S (uppercase S) file extension which will invoke the preprocessor to handle the #include directive.
     
    Edit:
    CVRIV
    I tried adding #INCLUDE <xc.inc>, but I'm getting syntax and lexical errors for that. 

    Try lowercase #include.
     
     
    post edited by 1and0 - 2020/08/01 08:59:55
    #9
    CVRIV
    Super Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/09/06 13:49:25
    • Location: 0
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 09:16:14 (permalink)
    0
    ric
    There's something wrong here.
    You are getting errors on line#50, but the code you posted only has 22 lines.
    Are you sure that is the full contents of WS2812-RGB-Strip_PIC16F883_Main-Code.s

     
    I just had a bunch a commented information above the code. I left it out because it wasn't important.
    #10
    CVRIV
    Super Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/09/06 13:49:25
    • Location: 0
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 09:22:43 (permalink)
    0
    [
    1and0
    I have not used the new PIC-AS assembler yet, so I could be wrong here. Anyway, the followings are my educated guesses:
    • The "phase error" is because of a conflicting delta value in a psect. For program memory space, PIC10/12/16 devices use a delta of 2 and PIC18 devices use a delta of 1. The default delta value is 1.
    • The "undefined symbol" error is because of not including the <xc.inc> file. Since OP said he has added that, so this error is probably caused by his source file not using the .S (uppercase S) file extension which will invoke the preprocessor to handle the #include directive.
     
    Edit:
    CVRIV
    I tried adding #INCLUDE <xc.inc>, but I'm getting syntax and lexical errors for that. 

    Try lowercase #include.



    OMG. That worked. How can I be that stupid. Have I always used an all caps include??? I have to check. LOL. It was always there in the top of my code. I never really paid attention to it. My assembly has a lowercase .s on the end. What are the .S files meant to be used for? 
     
    Thanks so much. 
    #11
    ric
    Super Member
    • Total Posts : 28011
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 15:04:33 (permalink)
    +2 (2)
    CVRIV
    ...
    I just had a bunch a commented information above the code. I left it out because it wasn't important.

    Except that it threw out all of the line numbers, so anyone trying to help you could not determine which line the errors were applying to.
     

    My assembly has a lowercase .s on the end. What are the .S files meant to be used for?

    1and0 mentioned the reason in his response:
    1and0
    ... this error is probably caused by his source file not using the .S (uppercase S) file extension which will invoke the preprocessor to handle the #include directive.

    "#include" is handled by the preprocessor, but that is only invoked if the assembly file has an upper case S extension.
    This is new with PIC-AS, MPASM didn't care about the case of the "ASM" extension.
    I guess this is a side effect of everything moving closer to the C tools, you now have to pay attention to upper/lower case of many things.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #12
    dan1138
    Super Member
    • Total Posts : 3733
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 17:58:54 (permalink)
    +2 (2)
    ric
    This is new with PIC-AS, MPASM didn't care about the case of the "ASM" extension.
    I guess this is a side effect of everything moving closer to the C tools, you now have to pay attention to upper/lower case of many things.



    And it gets worse with Windows.
     
    Windows does not care about the upper and lower case letters in file names. This "feature" allows MPLABX to have a lower case .s file name in the project configuration file and the file name in the folder may have an uppercase .S but the makefile generated by MPLABX will invoke the compiler with a lower case .s extension and the Windows file system supplies your file and the preprocessor still does not get invoked.
     
    The file names will get out of synch when you change tile source file extensions using the Windows File Explorer.
    #13
    CVRIV
    Super Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/09/06 13:49:25
    • Location: 0
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 17:59:40 (permalink)
    0
    ric
    CVRIV...I just had a bunch a commented information above the code. I left it out because it wasn't important.

    Except that it threw out all of the line numbers, so anyone trying to help you could not determine which line the errors were applying to. 
    My assembly has a lowercase .s on the end. What are the .S files meant to be used for?
    1and0 mentioned the reason in his response:
    1and0... this error is probably caused by his source file not using the .S (uppercase S) file extension which will invoke the preprocessor to handle the #include directive.
    "#include" is handled by the preprocessor, but that is only invoked if the assembly file has an upper case S extension.This is new with PIC-AS, MPASM didn't care about the case of the "ASM" extension.I guess this is a side effect of everything moving closer to the C tools, you now have to pay attention to upper/lower case of many things. 


    Sorry about the line numbers. I couldbt figure out how to copy the code down the the line numbers, so i just added the two problematic line numbers to the code in bold.

    The reason I asked about the difference between the little s and capital S file extensions is because despite everything working, for now, my file still has the little s extension. The compiler still handled the #include, so im a bit confused with that.
    #14
    mlp
    boots too small
    • Total Posts : 947
    • Reward points : 0
    • Joined: 2012/09/10 15:12:07
    • Location: previously Microchip XC8 team
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 20:14:25 (permalink)
    +1 (1)
    CVRIV
    despite everything working, for now, my file still has the little s extension. The compiler still handled the #include, so im a bit confused with that.

    Windows preserves case in filenames on disk, but it ignores case when satisfying requests from programs for files to be opened. It has done this since VFAT was introduced with Windows 95, and it is no less confusing for programmers now than it was back then.

    Mark (this opinion available for hire)
    #15
    CVRIV
    Super Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/09/06 13:49:25
    • Location: 0
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 20:51:14 (permalink)
    +1 (1)
    mark.pappin
    CVRIV
    despite everything working, for now, my file still has the little s extension. The compiler still handled the #include, so im a bit confused with that.

    Windows preserves case in filenames on disk, but it ignores case when satisfying requests from programs for files to be opened. It has done this since VFAT was introduced with Windows 95, and it is no less confusing for programmers now than it was back then.



    Uhhhh. So what you're saying is that if I have a file TEST.s and MPLABX asks for TEST.S, it's going to get TEST.s? 
     
    I have so many questions. Geez. I'm going to get back to the manuals first to see what I can find in there. Thanks for your good people.
    #16
    dan1138
    Super Member
    • Total Posts : 3733
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 21:29:15 (permalink)
    0
    CVRIV
    Uhhhh. So what you're saying is that if I have a file TEST.s and MPLABX asks for TEST.S, it's going to get TEST.s?

    It gets more confusing that that. I'm going to give an example and hope I don't get lost along the way.
     
    This is something I really did so this is a real world experience.
    1. Created an MPLABX project using the XC8 pic-as(v2.20) too chain.
    2. Created my own main.s file using notepad++
    3. Used add existing file to the project
    4. Built the project the realized I wanted to use some pre-processor macros
    5. Used Windows File Explorer to change the file name to main.S
    6. WTF the pre-processor did not run
    After creating a second identical project from scratch I found the only difference between the two was the name of the "main.S" file in the "configurations.xml" was still "main.s" in the project that didn't run the pre-processor. A more careful look at the output window showed "main.s" was the text used on the command line sent to the compiler when I expected "main.S" to be used.
     
    The take away on this is that the file name gets put in the "configurations.xml" when the file is added to the project so be sure that the name is what you need before it is added to the project.
     
    post edited by dan1138 - 2020/08/01 21:36:35
    #17
    ric
    Super Member
    • Total Posts : 28011
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 21:58:26 (permalink)
    +2 (2)
    This just confirms that using the case of the extension to control preprocessor use is just insane, and would only be suggested by a linux lover.
    It would have been so much clearer just to use a different extension.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #18
    CVRIV
    Super Member
    • Total Posts : 163
    • Reward points : 0
    • Joined: 2017/09/06 13:49:25
    • Location: 0
    • Status: offline
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 22:42:47 (permalink)
    0
    So because main.s was in configurations.xml, according to MPLABX is didn't exist, but according to windows it did exist. Couldn't you have just created another pre-proccessor file with the .S for your macros and just have added it to your source file in addition to the main.s? If that's fine, I'll think I'll just do that. 
     
    This is funny because initially I added a .asm to my project and after having learned the pic-as likes .s and .S, I just deleted the file from my source files, renamed it in windows and then added it again. LOL. I think I tried renaming it while it was in the source list as well. Anywho. I totally understand you. 
     
    Thanks for the info sir. 
    #19
    ric
    Super Member
    • Total Posts : 28011
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: I can't seem to do anything with MPLAB X 5.40?!?! I have to be missing something here. 2020/08/01 22:46:02 (permalink)
    +2 (2)
    CVRIV
    So because main.s was in configurations.xml, according to MPLABX is didn't exist, but according to windows it did exist.

    No, "not existing" isn't the problem.
    It is the upper/lower case of the extension in the config file that matters, not in the windows file system, so renaming in Windows after the file has been added to the configuration file has no effect.
    That is what Dan explained in post #17.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5