Announcement

Collapse
No announcement yet.

start projekt

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • start projekt

    Hello,
    I'm starting to program XPORT PRO EVO
    I have installed Evolution XPort Pro SDK v5.2.0.1.R5 and Sourcery G ++, Lite

    In Evolution SDK Users Guide, pages 17 and 18, I compiled and uploaded sample examples.

    Then I created a new file on their site and wrote a simple example and after compiling the file I compiled it and lost it.

    I do not know how to create another file.c aned file.h and put it in the main file.

    example:

    The main file is called helloworld.
    This file was sent periodically to the hello world serial line.

    Sending to the serial line I write in another file (serial.c)

    #include "evolution_libs.h"
    #include "evolution_stdio.h"
    #include "evolution_http.h"
    #include "evolution_cli.h"
    #include "evolution_serial.h"
    #include "serial.h"
    // # includes "startup.h"

    Void send_to_serial (char * source_d, unsigned char only_dat) {
    *****SerialWrite (0, source_d, len_dat, true);
    }



    I have created serial.h where the function is described:

    #ifndef SERIAL_H
    #defines SERIAL_H

    External void send_to_serial (char * source_d, unsigned char only_dat);

    #endif

    Helloworld.c

    / *!
    ** \ file
    **
    ** \ addtogroup sample
    **
    ** \ par Hello World: A simple Hello World sample.
    ** This sample writes Hello world out serial port 0 (Line 1).
    ** Using factory defaults, the serial port is configured at 9600, 8N1.
    **
    ** The XML configuration and status record functions are stubbed out.
    **
    * /

    #include "evolution_libs.h"
    #include "evolution_stdio.h"
    #include "evolution_http.h"
    #include "evolution_cli.h"
    #include "evolution_serial.h"
    #include "serial.h"
    #include "startup.h"


    Int SDKMain (struct command_line * commandline, struct http_server * httpServer)
    {
    ****(Void) commandLine; / * To avoid compiler warning for unused variables * /
    ****(Void) httpServer; / * To avoid compiler warning for unused variables * /
    ****
    ****Send_to_serial ("Hello World! \ R \ n", strlen ("Hello World! \ R \ n"));
    ****
    ****Return 0;
    }

    Compilation fails and I write to myself:

    Microsoft Windows [Verze 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. V?echna pr?va vyhrazena.

    c:\Program Files (x86)\Lantronix\Evolution XPort Pro SDK v5.2.0.1.R5\samples\xpo
    rt_pro>cs-make helloworld
    ../../sdk/startup.c
    ../helloworld.c
    helloworld.out
    Linking helloworld.out...
    work/helloworld.o: In function `SDKMain':
    c:\Program Files (x86)\Lantronix\Evolution XPort Pro SDK v5.2.0.1.R5\samples\xpo
    rt_pro/../helloworld.c:28: undefined reference to `send_to_serial'
    collect2: ld returned 1 exit status
    cs-make: *** [helloworld.out] Error 1


    Files helloworld.c, serial.c, serial.h I have in the sample samples.

    I did not modify make file.
    Can you advise me how to fix this problem?
    Thank you

    Mirek

  • #2
    Hi Mirek,

    Did you check the make file?

    You can open make file in editor. In make file line 120, there is a "cs-make helloworld". You may need to include your "serial" there in order to include it into the build rule.

    Regards,
    Brooke

    Comment


    • #3
      It appears you are manually building with the cs-make command; but I do not see that you actually included serial.c on the command line to be built.
      You included startup and helloworld, but not serial

      Comment

      Working...
      X