Hallo Community
Ich habe ein Problem mit dem XC32 Compiler in MPLABX. In meinem Projekt
wechsle ich den Mikrokontroller und benutze neu den PIC32MX534F064H
anstatt den PIC32MX220F064D. Da ich den Code für den neuen PIC etwas
abändern werde aber das alte Projekt für die bestehende Hardware
behalten möchte, habe ich in MPLAB ein neues Projekt für den neuen
Mikrokontroller aufgesetzt. Ich habe als erstes mal ein leeres main.c
file aufgesetzt das wie folgt aussieht:
1 | #include <xc.h> /* Defines special funciton registers, CP0 regs */
|
2 | #include <plib.h> /* Include to use PIC32 peripheral libraries */
|
3 | #include <stdint.h> /* For uint32_t definition */
|
4 | #include <stdbool.h> /* For true/false definition */
|
5 |
|
6 | /******************************************************************************/
|
7 | /* Global Variable Declaration */
|
8 | /******************************************************************************/
|
9 |
|
10 |
|
11 | /******************************************************************************/
|
12 | /* Main Program */
|
13 | /******************************************************************************/
|
14 |
|
15 | int32_t main(void)
|
16 | {
|
17 | /*Refer to the C32 peripheral library documentation for more
|
18 | information on the SYTEMConfig function.
|
19 |
|
20 | This function sets the PB divider, the Flash Wait States, and the DRM
|
21 | /wait states to the optimum value. It also enables the cacheability for
|
22 | the K0 segment. It could has side effects of possibly alter the pre-fetch
|
23 | buffer and cache. It sets the RAM wait states to 0. Other than
|
24 | the SYS_FREQ, this takes these parameters. The top 3 may be '|'ed
|
25 | together:
|
26 |
|
27 | SYS_CFG_WAIT_STATES (configures flash wait states from system clock)
|
28 | SYS_CFG_PB_BUS (configures the PB bus from the system clock)
|
29 | SYS_CFG_PCACHE (configures the pCache if used)
|
30 | SYS_CFG_ALL (configures the flash wait states, PB bus, and pCache)*/
|
31 |
|
32 | /* User clock/system configuration */
|
33 | //SYSTEMConfig(SYS_FREQ, SYS_CFG_WAIT_STATES | SYS_CFG_PCACHE);
|
34 |
|
35 | /* Configure the target for maximum performance at 80MHz */
|
36 | SYSTEMConfigPerformance(80000000UL);
|
37 |
|
38 | /* Power checks */
|
39 | if(RCONbits.SWR) RCONbits.SWR = 0; // Clear Software Reset bit after Power Down mode
|
40 |
|
41 | while(1)
|
42 | {}
|
43 | }
|
Wenn ich das Projekt nun kompilliere, erhalte ich folgende
Fehlermeldungen:
p32mx220f032d.h:73:3: error: conflicting types for '__WDTCONbits_t'
p32mx534f064h.h:73:3: note: previous declaration of '__WDTCONbits_t' was
here
...
Die Fehler erhalte ich erst dann, wenn ich die Peripherie Library des
compilers hinzufüge mit #include <plib.h>. Wie es scheint, includiert
der Compiler das h-File für beide Prozessoren weshalb er mir nun meldet,
er habe die Konfigurations-Register zweimal deklariert.
Ich habe das Problem bereits im Forum von Microchip deponiert, jedoch
konnte mir da bisher niemand helfen. Ich habe die Hoffnung dass mir hier
vielleicht jemand einen Hinweis liefern kann.