Can't compile for Wixel using the sdcc found in the dev bundle

I am trying to compile a hex file on a PC for a Wixel device that will be connected to an Arduino (Tx, Rx).

I have never compiled a C program on the PC (lots of C++ on Arduino, however) and the make command is giving me an error:

Compiling apps/dexdrip/dexdrip.rel

(null):2: syntax error: token -> ':' ; column 2
sdcpp.exe: fatal error: when writing output to : Invalid argument
make: *** [apps/dexdrip/dexdrip.rel] Error 1
You may now close this window.

I am absolutely clueless. Any assistance would be appreciated.

I am trying to make the hex code for a Wixel app. The source is mentioned in the Pololu forum:

The Wixel code for talking to the Dexcom radio transmitter can be found in the StephenBlackWasAlreadyTaken/wixel-xDrip repository on github.

I followed the instructions in the read.me file on the git, and when I ran make, I got this error:

Compiling apps/dexdrip/dexdrip.rel

(null):2: syntax error: token -> ':' ; column 2
sdcpp.exe: fatal error: when writing output to : Invalid argument
make: *** [apps/dexdrip/dexdrip.rel] Error 1
You may now close this window.

Any help getting this to compile would be appreciated.
(I have never compiled a C program on the PC).

I am sorry you are having trouble compiling the xDrip app. I tried compiling it on Windows just now using SDCC 3.1.0 (the version included in the Wixel development bundle) and it worked fine.

The compiler is indicating that there is a syntax error on line 2 of one of its input files, but unfortunately it is not telling us what input file that is. Normally there would be a filename at the beginning of the error message, but it just says (null) for you. Maybe one of the files in the wixel-xDrip repository got corrupted. If you download that repository again, and try compiling the freshly downloaded copy, does it fix the problem?

–David

“If you download that repository again, and try compiling the freshly downloaded copy, does it fix the problem?”

Nope.

I got distracted by another project, but now I am back to Wixel. I deleted and reinstalled everything according to the Pololu git: GitHub - StephenBlackWasAlreadyTaken/wixel-xDrip: Allow a wixel to function as Dexcom Reciever

The error:

C:\Users\steve\wixel-xDrip>doskey /macrofile=C:\batfiles\macros.txt
Compiling apps/dexdrip/dexdrip.rel

(null):2: syntax error: token -> ':' ; column 2
sdcpp.exe: fatal error: when writing output to : Invalid argument
make: *** [apps/dexdrip/dexdrip.rel] Error 1
You may now close this window.

My experience is with C++ on the Arduino family, but not C. I also have never done anything with Bluetooth on an Arduino (like the HC-05). All I really want to do is get the Dexcom data packet from my Dexcom transmitter (Bluetooth ).

I am using SDCC Version 3.1.0:

C:\Users\steve>sdcc -v
SDCC : mcs51/gbz80/z80/z180/r2k/ds390/pic16/pic14/TININative/ds400/hc08 3.1.0 #7066 (Nov 22 2011) (MINGW32)

Is there a “primer” on the Wixel code that I could refer to in order to understand the program flow of the xdrip.c program. What is Wixel and what is Bluetooth specific code?

Thanks

We did not the develop the xDrip app, but my basic understanding is that it runs on the Wixel and uses the Wixel’s radio and radio libraries to receive radio packets, and then it sends the relevant data as a serial signal using the Wixel’s UART library. The Wixel’s libraries are documented in their header files and also at https://pololu.github.io/wixel-sdk/. The serial output from the Wixel can be connected to a Bluetooth module, but the Wixel does not suppport the Bluetooth radio protocol and does not directly do anything with it.

I am sorry you are still having trouble compiling the xDrip app. In your Command Prompt, could you please navigate to the wixel-xDrip directory, run make VERBOSE=Y, and post the full output from that command here? That should show us exactly what command is being executed. Also, please run make -v so we can check what version of Make you are using.

–David

Thanks for working with me on this- it’s really appreciated.

C:\Users\steve\wixel-xDrip>make VERBOSE=Y
sdcc -c apps/dexdrip/dexdrip.c -Wp,-MD,apps/dexdrip/dexdrip.d,-MT,apps/dexdrip/dexdrip.rel,-MP  -Ilibraries/include -Wa,-p --model-medium --debug -o apps/dexdrip/dexdrip.rel

(null):2: syntax error: token -> ':' ; column 2
sdcpp.exe: fatal error: when writing output to : Invalid argument
make: *** [apps/dexdrip/dexdrip.rel] Error 1

And, the version of make:

C:\Users\steve\wixel-xDrip>make -v
GNU Make 3.82-pololu2
Built for Windows32
Copyright (C) 2010  Free Software Foundation, Inc.
Modified by Pololu <http://www.pololu.com>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

That command looks good, so I think there is just some problem with SDCC 3.1.0 or how it was installed on your system that is preventing it from working.

I recommend upgrading to SDCC 3.8.0 and seeing if that version will work for you. Specifically, I recommend using SDCC 3.8.0 for 64-bit Windows (sdcc-3.8.0-x64-setup.exe), which you can download from here:

https://sourceforge.net/projects/sdcc/files/sdcc-win64/3.8.0/

(There are later versions of SDCC, but they lack the sdcclib utility so they will not work with Wixel code without further modifications to the Makefile.)

After upgrading your SDCC version and trying to compile, you should see an error about putchar having the wrong type. You can fix this by editing dexdrip.c and changing the putchar function to:

int putchar(int c) {
    uart1TxSendByte(c);
    if (usbPowerPresent()) {
        usbComTxSendByte(c);
    }
    return c;
}

If you continue having trouble after editing dexdrip.c, please show me the output from sdcc -v and make VERBOSE=Y.

–David