• AVR Freaks

Hot!Legacy project brought to MPLAB X, will not write PRAGMA statements

Author
Drewster
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2018/10/17 16:17:34
  • Location: 0
  • Status: offline
2018/11/06 09:28:12 (permalink)
0

Legacy project brought to MPLAB X, will not write PRAGMA statements

I'm working on a project that was originally made in MPLAB IDE v8.66, which I assume is part of the problem here, but even though I've used the configuration tool and copied the generated PRAGMA statements to the top of main.c (where you'd think they'd be noticed), they do not seem to get written to the device. I searched around, but most of the people running into issues simply didn't use the PRAGMA statements correctly (before there was a tool). I'm experienced with embedded devices, but new to Microchip.
 
Whenever I go to debug the project, it shows 0xFFFF values in the configuration register, and the tool gives me a warning that the configuration has not been written to the device yet. I was in a hurry to get development going, so I switched back to the v8.66 IDE (painful), wrote the new configuration bit values into the window, and the intended configuration gets written to the device and works.

Any ideas? Is there a specific place for the configuration statements?
#1

2 Replies Related Threads

    KTrenholm
    Super Member
    • Total Posts : 710
    • Reward points : 0
    • Joined: 2012/08/08 14:04:23
    • Location: Connecticut, USA
    • Status: offline
    Re: Legacy project brought to MPLAB X, will not write PRAGMA statements 2018/11/06 10:41:42 (permalink)
    4 (1)
    I usually just drop them in a config_bits.c file that contains nothing but the config bit PRAGMAs (and a #include <xc.h>) and have never had an issue.
    post edited by KTrenholm - 2018/11/06 11:15:29
    #2
    Drewster
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2018/10/17 16:17:34
    • Location: 0
    • Status: offline
    Re: Legacy project brought to MPLAB X, will not write PRAGMA statements 2018/11/08 14:00:39 (permalink)
    0
    KTrenholm
    I usually just drop them in a config_bits.c file that contains nothing but the config bit PRAGMAs (and a #include <xc.h>) and have never had an issue.


    I put the generated code into a config_bits.c, however I can't include that header file since this project is using C32 v1.12 - do the PRAGMA statements require using the XC32 compiler? Searching the forum yielded "they're pretty much the same"


    I am getting an error message toward the bottom of my output:
    C:\...\AppData\Local\Temp\ccpul4Fx.s: Assembler messages:
    C:\...\AppData\Local\Temp\ccpul4Fx.s:5427: Warning: can't open .s: Invalid argument

    However I couldn't find much on this. Any advice on next steps?
     
    post edited by Drewster - 2018/11/08 14:07:02
    #3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5