public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: MapTrace bv <jbregman@maptrace.nl>
To: ecos mailing list <ecos-discuss@sources.redhat.com>
Subject: [ECOS] comlib_gps_init( ) fails because of assertion
Date: Mon, 13 Oct 2003 11:39:00 -0000	[thread overview]
Message-ID: <3F8A8EC5.6000809@maptrace.nl> (raw)

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

             reply	other threads:[~2003-10-13 11:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-13 11:39 MapTrace bv [this message]
2003-10-13 11:46 ` Gary Thomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F8A8EC5.6000809@maptrace.nl \
    --to=jbregman@maptrace.nl \
    --cc=ecos-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).