public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] comlib_gps_init( ) fails because of assertion
@ 2003-10-13 11:39 MapTrace bv
  2003-10-13 11:46 ` Gary Thomas
  0 siblings, 1 reply; 2+ messages in thread
From: MapTrace bv @ 2003-10-13 11:39 UTC (permalink / raw)
  To: ecos mailing list

Hi all,

I'm trying to write a gps test program for the Falcom F35. It seems to 
compile alright, but when I try a comlib_gps_init( ) it fails because of 
an assertion error. I believe the error message means the port number is 
too high, which I don't understand, because when I look at the source of 
serial.c, I see a '#define PORT_MAX 7' preprocessor directive. Does this 
indicate there's something wrong with my ComLib installation? I have 
included my program output, source and makefile. Any ideas?

Thanks,

Jaco Bregman



**** Program debug output:

Switch to nmea on port 0...
Switch failed on port 0.
Switch to nmea on port 1...
Switch to nmea on port 1 succeeded.
Initializing gps...
User assertion failed: "nPort <= PORT_MAX" at lib/serial.c: 96




*** Gps test program:

#include <comlib/comlib.h>
#include <stdio.h>

int main(void) {
    uint nPort = 0;
    tSerialStatus result;
    tGPSModule * gpsModule;

    comlib_init();
    comlib_gps_reset();

    while (result != STATUS_ALL_OK && nPort < 8) {
        printf("Switch to nmea on port %d...\n", nPort);
        result = comlib_gps_switch_to_nmea(nPort);

        if (result != STATUS_ALL_OK) {
            printf("Switch failed on port %d.\n", nPort);
        }

        nPort++;
    }

    if (result == STATUS_ALL_OK) {
        nPort--;
        printf("Switch to nmea on port %i succeeded.\n", nPort);
        printf("Initializing gps...\n");
        result = comlib_gps_init(gpsModule, nPort, NULL, 0, 4);

        if (result == STATUS_ALL_OK) {
            comlib_gps_command(gpsModule, "PSRF103,00,00,00,01", 2);
        }
        else {
            printf("Initializing gps failed.\n");
        }
    }

    return 1;
}




**** Makefile:

CL_LIB_DIR=/opt/sdk35/comlib/lib
CL_INCLUDE_DIR=/opt/sdk35/comlib/include/comlib

# Cyg I/O (3) or POSIX I/O (2)?
TARGET=-DTARGET_PLATFORM=3 -DUSE_HW_FC#-DMAX_BAUD=38400

all: main.c
    @clear
    @v850-elf-gcc -g $(TARGET) main.c \
    $(ECOS_LIB_PATH)/comlib.a \
    -I $(CL_INCLUDE_DIR) \
    -I $(ECOS_INCLUDE_PATH)  \
    -L $(CL_LIB_DIR) \
    -L $(ECOS_LIB_PATH) \
    -Ttarget.ld -nostdlib -Wall -o mainGps
    @v850-elf-objcopy --srec-forceS3 -O srec mainGps mainGps.S3


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] comlib_gps_init( ) fails because of assertion
  2003-10-13 11:39 [ECOS] comlib_gps_init( ) fails because of assertion MapTrace bv
@ 2003-10-13 11:46 ` Gary Thomas
  0 siblings, 0 replies; 2+ messages in thread
From: Gary Thomas @ 2003-10-13 11:46 UTC (permalink / raw)
  To: MapTrace bv; +Cc: ecos mailing list

On Mon, 2003-10-13 at 05:38, MapTrace bv wrote:
> Hi all,
> 
> I'm trying to write a gps test program for the Falcom F35. It seems to 
> compile alright, but when I try a comlib_gps_init( ) it fails because of 
> an assertion error. I believe the error message means the port number is 
> too high, which I don't understand, because when I look at the source of 
> serial.c, I see a '#define PORT_MAX 7' preprocessor directive. Does this 
> indicate there's something wrong with my ComLib installation? I have 
> included my program output, source and makefile. Any ideas?
> 

Sorry, but this has nothing [directly?] to do with eCos.  You
probably need to ask these questions somewhere else.

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-10-13 11:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-13 11:39 [ECOS] comlib_gps_init( ) fails because of assertion MapTrace bv
2003-10-13 11:46 ` Gary Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).