Link Error: Could not allocate section .varname, size = xx bytes, attributes = data near
This is because the near compiler model is being used for optimization. Only the lower 8K of memory can be used in the near data mode to to allow the rest of the memory to be used you have to use the large code model.
To do this open this file into a text editor, you may have to copy out of the program files folder first to allow the file to be edited.
C:\Program Files (x86)\Flowcode(dsPIC)\v5\Tools\MX_bats\pic16_C30_comp.bat
Inside the file find this line.
Code: Select all
pic30-gcc -c -mcpu=%3 -funsigned-char -fno-short-double -Os -I"%~dp0..\C_tools\support\h" -I"%~dp0..\MX_support" -Wall -std=gnu99 %1.c -o %1.o
Code: Select all
pic30-gcc -c -mcpu=%3 -funsigned-char -mlarge-data -fno-short-double -Os -I"%~dp0..\C_tools\support\h" -I"%~dp0..\MX_support" -Wall -std=gnu99 %1.c -o %1.o