FreeRTOS V4.2.1 and PIC33F

[moved from private email as may be of interest to others] I tried to compile FreeRTOSV4.2.1DemodsPIC_MPLAB "out of the box" in the MPLAB IDE using the Microchip C30 Student Edition Compiler Version 3.00. The PIC33 Application has what appear to be compiler errors, ie. BUGS when generating code. FreeRTOSDemoPIC24_MPLAB compiles OK. Before I contact Microchip, I would like to ask if others have reported this. Clean: Deleting intermediary and output files. Clean: Done. Executing: "D:MicrochipMPLAB C30binpic30-gcc.exe" -mcpu=33FJ256GP710 -c -x c  -I"." -I"D:FreeRTOSDemoCommoninclude" -I"D:FreeRTOSDemodsPIC_MPLAB" -I"D:FreeRTOSsourceinclude" "main.c" -o"main.o" -g -Wall -DMPLAB_DSPIC_PORT -O2 -fomit-frame-pointer -fno-schedule-insns -fno-schedule-insns2 -save-temps Microchip MPLAB C30 License Manager Version v3.00 (Build Date Feb 28 2007). Copyright (c) 2005 Microchip Technology Inc. All rights reserved. The MPLAB C30 license has less than 14 days remaining. Microchip MPLAB C30 License Manager Version v3.00 (Build Date Feb 28 2007). Copyright (c) 2005 Microchip Technology Inc. All rights reserved. The MPLAB C30 license has less than 14 days remaining. main.c: In function ‘main’: main.c:151: warning: pointer targets in passing argument 2 of ‘xTaskCreate’ differ in signedness main.c:152: warning: pointer targets in passing argument 2 of ‘xTaskCreate’ differ in signedness main.c:153: warning: pointer targets in passing argument 2 of ‘xTaskCreate’ differ in signedness main.s: Assembler messages: main.s:40526: Error: symbol `ERROR_TEST1′ is already defined main.s:40529: Error: symbol `NO_ERROR1′ is already defined main.s:40722: Error: symbol `ERROR_TEST2′ is already defined main.s:40725: Error: symbol `NO_ERROR2′ is already defined [I’m just looking into the problem now]

FreeRTOS V4.2.1 and PIC33F

I have just tired a clean install and build, with the following comments: + When moving between the PIC24 and dsPIC I had to select the processor being used from the "Configure->Select Device" menu option in MPLAB.  It does not seem to store the procesor as part of the project file.  Without this I got warnings about the incorrect processor being used. + Once the processor was correctly selected, performing a clean then rebuild resulted in no errors or warnings being output. However, I was told by Microchip that there was a new version of the copiler out, which I have not tested yet, and maybe there is some incompatability? Did you perform a clean, prior to the build? Which compiler version are you using? Mine is: pic30-coff-gcc.exe (GCC) 3.3 (dsPIC30, Microchip v2.00) Build date: Nov 28 2005 __C30_VERSION__ == 200 Copyright (c) 2004 Free Software Foundation, Inc. All rights reserved. This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Regards.

FreeRTOS V4.2.1 and PIC33F

then it must be a problem with the new version 3.00 c30 compiler (gcc version 4.0.3 (dsPIC30, Microchip v3.00) Build Date Feb 28 2007). I’ll send the info the Microchip.

FreeRTOS V4.2.1 and PIC33F

I have just upgraded my tools to the latest C30 compiler and MPLAB versions, and found that I can replicate the problem.  The symbols it is complaining about are defined within main.c, in the functions xRegisterTest1() and xRegisterTest2().  I don’t know why it is complaining that the symbols are defined more than once, as they are not.  However, turning the optimisation down to 0 makes the issue disappear, so this is a big clue. There are also a couple of benign warnings generated, which can be removed or ignored. Regards.

FreeRTOS V4.2.1 and PIC33F

I have also added the following to the "Known Issues" list: "Upgrading to the MPLAB C30 compiler V3.00 The PIC24 MCU® and dsPIC DSC® demo applications will not compile with V3.00 of the C30 compiler unless optimisation is turned off. With optimisation on the assembler complains about multiple definitions of symbols which are defined within the test tasks xRegisterTest1() and xRegisterTest2(). These symbols are only defined once, but are defined within inline assembler, so there is a possibility of an incompatibility with the inline assembly code and the optimisation functionality. To run the demo with optimisation on it is necessary to comment out the inline assembly from within the xRegisterTest1() and xRegisterTest2() functions in main.c. C30 V3.00 also generates a couple of warnings, which are benign and can therefore be rectified or ignored." Regards.

FreeRTOS V4.2.1 and PIC33F

I just received a reply from Microchip. Not being an Assembler-Expert, I can’t tell if the reply makes sense or if they just wanted to get rid of the ticket: This is to inform you that Microchip Engineering Support has added additional comments to your ticket # :  1-77492. Comments: I was able to download the source, and duplicate this issue. I forwarded this on to Dev Tools, and they responded back. <from Development Tools> They shouldn’t be using regular labels in inline assembly. If they really need to use a label in inline assembly, they should be using a local label. Basically, they are getting this error because 3.00 is more aggressive in both function inlining and loop unrolling so the code within the function is getting duplicated. <>

FreeRTOS V4.2.1 and PIC33F

effectively, they have improved the optimization in verions 3 so much that it will hapilly break code that uses labels in inline assembler.  the code in question in this case is only part of a test and not needed to run freertos os is not really a problem.