After going over a chain of linked errors and fixing them I am now up against a VERY strange item: In file included from ../source/main.c:27:
../source/config.h:31: error: section attribute cannot be specified for local variables
The thing is that I have placed the configuration bit defines into a h file to simplify the handling. So in main.c I have this:
But when I try to compile it stops on the config.h line with the above error message.
The strange thing is that this project did compile a few days ago and I have not changed anything in main.c or config.h since then except adding the GeneralTypeDefs.h reference in order to try to get UINT32 recognized everywhere.
So what can suddenly cause this very strange message to pop up?
What is a section attrribute and how could it be connected to a "local variable".
My config.h file looks like this (content generated by MPLAB-X):
WPFP_WPFP255 & // Write Protection Flash Page Segment Boundary (Highest Page (same as page 170))
SOSCSEL_SOSC & // Secondary Oscillator Power Mode Select (Secondary oscillator is in Default (high drive strength) Oscillator mode)
WUTSEL_LEG & // Voltage Regulator Wake-up Time Select (Default regulator start-up time is used)
ALTPMP_ALPMPDIS & // Alternate PMP Pin Mapping (EPMP pins are in default location mode)
WPDIS_WPDIS & // Segment Write Protection Disable (Segmented code protection is disabled)
WPCFG_WPCFGDIS & // Write Protect Configuration Page Select (Last page (at the top of program memory) and Flash Configuration Words are not write-protected)
WPEND_WPENDMEM // Segment Write Protection End Page Select (Protected code segment upper boundary is at the last page of program memory; the lower boundary is the code page specified by WPFP)
POSCMOD_XT & // Primary Oscillator Select (XT Oscillator mode is selected)
IOL1WAY_ON & // IOLOCK One-Way Set Enable (The IOLOCK bit (OSCCON<6>) can be set once, provided the unlock sequence has been completed. Once set, the Peripheral Pin Select registers cannot be written to a second time.)
OSCIOFNC_OFF & // OSCO Pin Configuration (OSCO/CLKO/RC15 functions as CLKO (FOSC/2))
FCKSM_CSDCMD & // Clock Switching and Fail-Safe Clock Monitor (Clock switching and Fail-Safe Clock Monitor are disabled)
FNOSC_PRIPLL & // Initial Oscillator Select (Primary Oscillator with PLL module (XTPLL, HSPLL, ECPLL))
PLL96MHZ_ON & // 96MHz PLL Startup Select (96 MHz PLL is enabled automatically on start-up)
PLLDIV_DIV2 & // 96 MHz PLL Prescaler Select (Oscillator input is divided by 2 (8 MHz input))
IESO_OFF // Internal External Switchover (IESO mode (Two-Speed Start-up) is disabled)
WDTPS_PS32768 & // Watchdog Timer Postscaler (1:32,768)
FWPSA_PR128 & // WDT Prescaler (Prescaler ratio of 1:128)
ALTVREF_ALTVREDIS & // Alternate VREF location Enable (VREF is on a default pin (VREF+ on RA9 and VREF- on RA10))
WINDIS_OFF & // Windowed WDT (Standard Watchdog Timer enabled,(Windowed-mode is disabled))
FWDTEN_ON & // Watchdog Timer (Watchdog Timer is enabled)
ICS_PGx1 & // Emulator Pin Placement Select bits (Emulator functions are shared with PGEC1/PGED1)
GWRP_OFF & // General Segment Write Protect (Writes to program memory are allowed)
GCP_OFF & // General Segment Code Protect (Code protection is disabled)
JTAGEN_ON // JTAG Port Enable (JTAG port is enabled)
This is over the top of my head.... EDIT a while later:
I even removed the config.h file altogether and copied the configuration code into main.c immediately after the inlude lines, but to no avail.
Same error message but now pointing into the main.c file.
This cannot be right, the configuration worked before with no changes.
It seems like MPLAB-X or C30 have gone completely astray, with incorrect error messages.
post edited by BobAGI - 2012/03/04 12:34:31