New install v8.1 xc16 PIC24 compiling but not linking assembling

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
crispin12
Posts: 51
Joined: Fri Apr 07, 2017 5:51 pm
Has thanked: 6 times
Been thanked: 11 times
Contact:

New install v8.1 xc16 PIC24 compiling but not linking assembling

Post by crispin12 »

On testing my installation for PIC 16 bit devices I set up a simple test flowchart called Flowcode1 with a while 1 loop and tried to compile to HEX. It compiles ok but doesn't link when using either the default Flowcode xc16 or the Microchip xc16 compiler. In both cases the output text msg indicates there is something wrong with the Flowcode1.o file. I'm using the same compiler setting options as in my Flowcode 7 installation. The freaky thing is however, when I now try to do the same thing in my Flowcode 7 that is also now not working. Same error!!! But I know I had this working ok in Flowcode 7.0. Maybe it got broken when I updated to 7.3. The thing is I play with xc8 devices more than xc16 so its been a while since I tried to compile to a PIC24Fxxx device. I'm wondering if something has changed on my Windows 8 computer or whether the Windows Defender update has messed things up. Can anyone determine anything from my output report text file?

EDIT: This morning I turned off the Windows Defender but it made no difference. I also edited the HKLM resistry NTFS 8.3 short names setting (set it it to 0) but that made no difference either. It was definitely working under Flowcode v7.0. I can't think what is wrong with the .o object file. I have my toolchains in v7 and v8 installed in the program files (x86)\flowcode\compilers installation folder not the common files folder. That's where the v7 installation put them so I did the same on the Flowcode 8 installation. Besides the compiler works with both the default and the Microchip so I can't think it's a file location problem. What I'm I missing?

--------------------------------------------------------------------------------------------------------------------------
Launching the compiler...
C:\Program Files (x86)\Microchip\xc16\v1.31\bin\pic16_C30_comp.bat "Flowcode1" "C:\Users\Eve\DOCUME~1\" "24F08KA101"

C:\Users\Eve\DOCUME~1>xc16-gcc -c -mcpu="24F08KA101" -funsigned-char -fno-short-double -Os -I"C:\PROGRA~2\MICROC~1\xc16\v1.31\bin\..\support\h" -I"C:\PROGRA~2\MICROC~1\xc16\v1.31\bin\" -std=gnu99 "Flowcode1".c -o "Flowcode1".o
Flowcode1.c:93:1: warning: '_FBS' definition has been deprecated: consider migrating to #pragma config
Flowcode1.c:93:1: warning: '_FGS' definition has been deprecated: consider migrating to #pragma config
Flowcode1.c:93:1: warning: '_FOSCSEL' definition has been deprecated: consider migrating to #pragma config
Flowcode1.c:93:1: warning: '_FOSC' definition has been deprecated: consider migrating to #pragma config
Flowcode1.c:93:1: warning: '_FWDT' definition has been deprecated: consider migrating to #pragma config
Flowcode1.c:93:1: warning: '_FPOR' definition has been deprecated: consider migrating to #pragma config
Flowcode1.c:93:1: warning: '_FICD' definition has been deprecated: consider migrating to #pragma config
Flowcode1.c:93:1: warning: '_FDS' definition has been deprecated: consider migrating to #pragma config
.


Compilation successful!

Launching the linker/assembler...
C:\Program Files (x86)\Flowcode 8\compilers\pic16\batchfiles\pic16_C30_link.bat "C:\Users\Eve\DOCUME~1\Flowcode1" 24F08KA101 24F
.

C:\Users\Eve\DOCUME~1\Flowcode1.o: file not recognized: File format not recognized

Error returned from [xc16-gcc.exe]

C:\Program Files (x86)\Flowcode 8\compilers\pic16\batchfiles\pic16_C30_link.bat reported error code 1

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: New install v8.1 xc16 PIC24 compiling but not linking assembling

Post by Benj »

Hello,

Have you tried deleting the .o file. Maybe it has become locked or corrupt on the disk?

Have you changed your compiler options at all? Maybe added a custom setting?

You batch file looks like it's maybe outdated. You're missing the -omf-coff

Code: Select all

xc16-gcc -c -mcpu=%3 -omf=coff -funsigned-char -fno-short-double -Os -I"%~dp0..\support\h" -I"%~dp0" -std=gnu99 %1.c -o %1.o
Here's my current batch file that lives in the "pic16/batchfiles" folder.
pic16_C30_comp.bat
(494 Bytes) Downloaded 203 times

crispin12
Posts: 51
Joined: Fri Apr 07, 2017 5:51 pm
Has thanked: 6 times
Been thanked: 11 times
Contact:

Re: New install v8.1 xc16 PIC24 compiling but not linking assembling

Post by crispin12 »

Hello Ben

I downloaded and installed the 8.1 yesterday. Your bat file is identical to the installed one.

The linker code in the compiler settings are (microchip 16 pro) (copied from my Flowcode 7 settings)

$(appdir)compilers\pic16\batchfiles\pic16_C30_link.bat

"$(outdir)$(target)" $(chip:u) $(family)

======================================================
The installed linker code default settings are

$(compilerpic16)batchfiles\pic16_C30_link.bat

"$(outdir)$(target)" $(chip:u) $(family)

======================================================

If I choose the installation default compiler and default install compiler settings I get hex file ok
If I choose the microchip compiler and the compiler setting as shown above it fails at the linker part.
It looks like there is something wrong with the .o file format then?

crispin12
Posts: 51
Joined: Fri Apr 07, 2017 5:51 pm
Has thanked: 6 times
Been thanked: 11 times
Contact:

Re: New install v8.1 xc16 PIC24 compiling but not linking assembling

Post by crispin12 »

Hello again Ben

You were right after all about the batch file being out of date. I was comparing your batch file with the Flowcode 8.1 installed file (which are the same) when I should have been comparing it with the batch file in the Microchip compiler folder. As soon as I backed up the older Microchip batch file and copied the later batch file across to the Microchip compiler installation, the linker assembler HEX file production part of the compilation sprang to life. Looks like the older batch file was not allowing the .o file to be produced correctly. All's well now and all compilers working.

Have to say I really like the new features in v8.1. The ability to bring the c code into the simulations is a big step forward. Also will definitely be working with the raspberry pi devices.

Post Reply