# MPLAB X 2.15  DSPIC33  FREERTOS  COMPILATION PROBLEMS

**URL:** <https://forums.freertos.org/t/mplab-x-2-15-dspic33-freertos-compilation-problems/1320>\
**Category:** Kernel\
**Created:** [September 2, 2014, 8:27pm UTC](https://forums.freertos.org/t/mplab-x-2-15-dspic33-freertos-compilation-problems/1320 "2014-09-02T20:27:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [September 2, 2014, 8:27pm UTC](https://forums.freertos.org/t/mplab-x-2-15-dspic33-freertos-compilation-problems/1320/1 "2014-09-02T20:27:37Z")

</div>

**[albanana](https://sourceforge.net/u/albanana/)** wrote on [Tuesday, September 02, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/3c550c0d/#514b):

hello everyone i’m trying to compile freertos with mplab X v2.15. i use a dspic33fj128gp802 chip  
i have compilation issues i tried both modifying the demo and starting from scratch. none worked

help !!

i have a warning with pvPortMalloc, and linker errors

if you need it i can provide more info, sources, etc…  
THANK YOU 🙂

make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf  
make[1]: Entering directory ‘D:/FreeRTOSV8.1.1/FreeRTOS/Demo/dsPIC\_MPLAB/freertos\_essai1.X’  
make -f nbproject/Makefile-default.mk dist/default/production/freertos\_essai1.X.production.hex  
make[2]: Entering directory ‘D:/FreeRTOSV8.1.1/FreeRTOS/Demo/dsPIC\_MPLAB/freertos\_essai1.X’  
“C:\Program Files (x86)\Microchip\xc16\v1.21\bin\xc16-gcc.exe” …/…/…/Source/list.c -o build/default/production/\_ext/449926602/list.o -c -mcpu=33FJ128GP802 -MMD -MF “build/default/production/\_ext/449926602/list.o.d” -g -omf=elf -O0 -I"…/…/…/Source/include" -I"…/…/…/Source/portable/MPLAB/PIC24\_dsPIC" -I"." -msmart-io=1 -Wall -msfr-warn=off  
“C:\Program Files (x86)\Microchip\xc16\v1.21\bin\xc16-gcc.exe” …/…/…/Source/queue.c -o build/default/production/\_ext/449926602/queue.o -c -mcpu=33FJ128GP802 -MMD -MF “build/default/production/\_ext/449926602/queue.o.d” -g -omf=elf -O0 -I"…/…/…/Source/include" -I"…/…/…/Source/portable/MPLAB/PIC24\_dsPIC" -I"." -msmart-io=1 -Wall -msfr-warn=off  
“C:\Program Files (x86)\Microchip\xc16\v1.21\bin\xc16-gcc.exe” …/…/…/Source/tasks.c -o build/default/production/\_ext/449926602/tasks.o -c -mcpu=33FJ128GP802 -MMD -MF “build/default/production/\_ext/449926602/tasks.o.d” -g -omf=elf -O0 -I"…/…/…/Source/include" -I"…/…/…/Source/portable/MPLAB/PIC24\_dsPIC" -I"." -msmart-io=1 -Wall -msfr-warn=off  
“C:\Program Files (x86)\Microchip\xc16\v1.21\bin\xc16-gcc.exe” …/…/…/Source/portable/MemMang/heap\_1.c -o build/default/production/\_ext/1884096877/heap\_1.o -c -mcpu=33FJ128GP802 -MMD -MF “build/default/production/\_ext/1884096877/heap\_1.o.d” -g -omf=elf -O0 -I"…/…/…/Source/include" -I"…/…/…/Source/portable/MPLAB/PIC24\_dsPIC" -I"." -msmart-io=1 -Wall -msfr-warn=off  
…/…/…/Source/portable/MemMang/heap\_1.c: In function ‘pvPortMalloc’:  
…/…/…/Source/portable/MemMang/heap\_1.c:114:39: warning: cast from pointer to integer of different size  
“C:\Program Files (x86)\Microchip\xc16\v1.21\bin\xc16-gcc.exe” …/…/…/Source/portable/MPLAB/PIC24\_dsPIC/port.c -o build/default/production/\_ext/1343266892/port.o -c -mcpu=33FJ128GP802 -MMD -MF “build/default/production/\_ext/1343266892/port.o.d” -g -omf=elf -O0 -I"…/…/…/Source/include" -I"…/…/…/Source/portable/MPLAB/PIC24\_dsPIC" -I"." -msmart-io=1 -Wall -msfr-warn=off  
“C:\Program Files (x86)\Microchip\xc16\v1.21\bin\xc16-gcc.exe” main.c -o build/default/production/main.o -c -mcpu=33FJ128GP802 -MMD -MF “build/default/production/main.o.d” -g -omf=elf -O0 -I"…/…/…/Source/include" -I"…/…/…/Source/portable/MPLAB/PIC24\_dsPIC" -I"." -msmart-io=1 -Wall -msfr-warn=off  
“C:\Program Files (x86)\Microchip\xc16\v1.21\bin\xc16-gcc.exe” -o dist/default/production/freertos\_essai1.X.production.elf build/default/production/\_ext/449926602/list.o build/default/production/\_ext/449926602/queue.o build/default/production/\_ext/449926602/tasks.o build/default/production/\_ext/1884096877/heap\_1.o build/default/production/\_ext/1343266892/port.o build/default/production/main.o -mcpu=33FJ128GP802 -omf=elf -Wl,–defsym=\_\_MPLAB\_BUILD=1,–script=p33FJ128GP802.gld,–stack=16,–check-sections,–data-init,–pack-data,–handles,–isr,–no-gc-sections,–fill-upper=0,–stackguard=16,–no-force-link,–smart-io,-Map=“dist/default/production/freertos\_essai1.X.production.map”,–report-mem

Program Memory [Origin = 0x200, Length = 0x155fe]

section address length (PC units) length (bytes) (dec)

* * *

.text 0x200 0xaa 0xff (255)  
.const 0x2aa 0x26 0x39 (57)  
.text 0x2d0 0x136a 0x1d1f (7455)  
.dinit 0x163a 0x20 0x30 (48)  
.text 0x165a 0x10 0x18 (24)

```
                 Total program memory used (bytes): 0x1e9f (7839) 5%

```

Data Memory [Origin = 0x800, Length = 0x4000]

section address alignment gaps total length (dec)

* * *

.nbss 0x800 0 0x146a (5226)  
.ndata 0x1c6a 0 0x6 (6)

```
                    Total data memory used (bytes): 0x1470 (5232) 31%

```

Dynamic Memory Usage

region address maximum length (dec)

* * *

heap 0 0 (0)  
stack 0x1c70 0x2b90 (11152)

```
                    Maximum dynamic memory (bytes): 0x2b90 (11152)

```

nbproject/Makefile-default.mk:190: recipe for target ‘dist/default/production/freertos\_essai1.X.production.hex’ failed  
make[2]: Leaving directory ‘D:/FreeRTOSV8.1.1/FreeRTOS/Demo/dsPIC\_MPLAB/freertos\_essai1.X’  
nbproject/Makefile-default.mk:75: recipe for target ‘.build-conf’ failed  
make[1]: Leaving directory ‘D:/FreeRTOSV8.1.1/FreeRTOS/Demo/dsPIC\_MPLAB/freertos\_essai1.X’  
nbproject/Makefile-impl.mk:39: recipe for target ‘.build-impl’ failed  
build/default/production/\_ext/449926602/tasks.o(.text+0x852): In function `.LSM296': : undefined reference to `\_vApplicationIdleHook’  
build/default/production/\_ext/449926602/tasks.o(.text+0xde): In function `.LSM26': : undefined reference to `\_vPortYield’  
build/default/production/\_ext/449926602/tasks.o(.text+0xe0): In function `.LSM26': : undefined reference to `\_vPortYield’  
build/default/production/\_ext/449926602/tasks.o(.text+0x162): In function `.LSM45': : undefined reference to `\_vPortYield’  
build/default/production/\_ext/449926602/tasks.o(.text+0x164): In function `.LSM45': : undefined reference to `\_vPortYield’  
build/default/production/\_ext/449926602/tasks.o(.text+0x19c): In function `.LSM56': : undefined reference to `\_vPortYield’  
build/default/production/\_ext/449926602/tasks.o(.text+0x19e): more undefined references to `\_vPortYield’ follow  
make[2]: \*\*\* [dist/default/production/freertos\_essai1.X.production.hex] Error 255  
make[1]: \*\*\* [.build-conf] Error 2  
make: \*\*\* [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 7s)

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [September 2, 2014, 8:53pm UTC](https://forums.freertos.org/t/mplab-x-2-15-dspic33-freertos-compilation-problems/1320/2 "2014-09-02T20:53:11Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, September 02, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/3c550c0d/#0885):

Thank you for reporting this problem. Please try opening FreeRTOS.h, and finding the lines:

```

#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
	#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#endif

```

and change the 1 to a 0.

That fixes the problem for me. The default of one will have to move into individual port layers.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [September 2, 2014, 9:54pm UTC](https://forums.freertos.org/t/mplab-x-2-15-dspic33-freertos-compilation-problems/1320/3 "2014-09-02T21:54:48Z")

</div>

**[albanana](https://sourceforge.net/u/albanana/)** wrote on [Tuesday, September 02, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/3c550c0d/#316f):

okay thanks a lot. actually the problem was that i forgot  
1\> to include “portasm\_dspic.s” in the project sources  
2\> to implement “vApplicationIdleHook”.

i got issues with configUSE\_PORT\_OPTIMISED\_TASK\_SELECTION too. i changed it to 0 and got no more errors

i have this warning :  
…/…/…/Source/portable/MemMang/heap\_1.c: In function ‘pvPortMalloc’:  
…/…/…/Source/portable/MemMang/heap\_1.c:114:39: warning: cast from pointer to integer of different size

should i ignore it ? is it possible to fix it ?

THANKS 🙂  
alban

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [September 2, 2014, 10:26pm UTC](https://forums.freertos.org/t/mplab-x-2-15-dspic33-freertos-compilation-problems/1320/4 "2014-09-02T22:26:54Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, September 02, 2014](https://sourceforge.net/p/freertos/discussion/382005/thread/3c550c0d/#1d5f):

Yes that can be ignored.

Regards.
