SkyTraq Venus 6 EVK/SDK (small)
SkyTraq Venus 6 EVK/SDK
(Some stuff around the SkyTraq Venus 6 EVK/SDK)
 

 

Introduction


My first contact with the External linkSkyTraq Venus 6 was in 2010, when i bought the External linkNavin miniHomer (my personal "Gadget Of The Year 2010") from the german distributor External linkZNEX. The miniHomer containes a derivative of the Venus 6 series (Venus621bLP). Fascinated by the chip, i ordered the suggested Venus638FLP evaluation kit (EVK), the software development kit (SDK) and some "bare" Venus638FLPx-L chips in LGA69 package (10mm x 10mm x 1,3mm).

The shipping of the kit was very fast (3 days from Taiwan to the destination). The customs formality and paperwork was done by the carrier FedEx, importation VAT has to be paid for the kit.

Venus638 EVK top view (large)

Fig. 1: Top view of my Venus368-EVK (modified)

After some analysis of the EVK, i did some modifications:

  • Added spacers in the corner holes of the PCB
  • Populated the 30-pin header (JP2)
  • Replaced the jumper JP3 by a header with shorter pins on the solder side, to be even with the bottom side of the PCB
  • Populated a SD card holder
  • Added a 10k pull-up to the SPI MISO
  • Connected the SD card card-detect switch to BAUD_SEL0 (JP4-1)
  • Connected the SD card write-protect switch to BAUD_SEL1 (JP4-3)

At the 30-pin header a Honeywell HMC6352 compass chip on a Sparkfun breakout board is connected.

Venus638 EVK bottom view (large)

Fig. 2: Bottom view of my Venus368-EVK (modified)


The SDK and API documentation is very slim. Therefore i did a complete rework of the SDK (SkyTraq kernel 1.6.0), reorganized and reformatted all the code and added Doxygen comments.

Additionally i ported the External link"AVR FAT32" package to the Venus638 and added some low-level I2C routines ("bit-bang" mode for Venus634 compatibility, and also hardware I2C functions for the Venus638) and some high-level routines for the Honeywell HMC6352 compass IC.

The modified and extended sources, packed as External link"STI_GPS_ModTG_v0.0.2.zip" can be downloaded and used in own projects (send an External linke-mail with a little description of your project to get the password. Made for SkyTraq kernel 1.6.0, no kernel libs included).

A Cadsoft EAGLE library External link"SkyTraq_Venus63x.lbr" provides schematic symbols and layout footprints (created with Eagle 5.11.0).

While doing some experiments with the EVK and SDK, i collected some things about that stuff, that can be found in the next section. Maybe this will help others to avoid pitfalls and puzzling about some things in the SDK...

Trivia and worth knowing things


Trivia:

  • The Venus634/638 uses the Sparc v8 compatible LEON2 CPU (free IP-core by External linkAeroflex Gaisler).
  • The LEON2 inside the Venus638 runs with 50 MHz, the internal peripherals (e.g. SPI, I2C) with 15.003694 MHz.
  • The PIOs are I/Os from the LEON2 design, the GPIOs are additional peripheral I/Os.
  • A bricked Venus638 FLASH can be reprogrammed by booting the chip from ROM (JP3 2-3), download a prom.bin with the GPS-Viewer and restart the chip from FLASH (JP3 1-2).

Worth knowing:

  • The SDK works also with the sparc-elf-3.4.4-1.0.33 toolchain, on Windows and Linux
    (External linksparc-elf-3.4.4-1.0.33-mingw and External linksparc-elf-3.4.4-1.0.33-linux).
    Be aware, that SkyTraq maybe will refuse support if you do not use the suggested v1.0.31b toolchain!!
    Gaisler toolchains above v1.0.33 will compile the sources, but the binary will not work on the Venus63x!

  • A lightweight and fast compiling environment (about 30MB HDD space) can be set up as an alternative to the Cygwin installation suggested by SkyTraq (be aware, that SkyTraq maybe will refuse support if you do not use the suggested Cygwin-environment!!):

    • Create a directory "C:\opt"
    • Unzip the sparc-elf-toolchain to "C:\opt" to get the following structure
      "C:\opt\sparc-elf-3.4.4-mingw\..."
    • Unzip the SDK to "C:\opt" to get the following structure "C:\opt\STI_GPS\..."
    • Download the External linkGnuWin32 "Core-Utilities".
      The Core-Utilities contains the missing helper binaries.
      Start the installer. Set the installation directory to "C:\opt\GnuWin32".
    • Add the following pathes to your PATH environmental variable:
      C:\opt\sparc-elf-3.4.4-mingw\bin;C:\opt\GnuWin32\bin

    • Finaly the directory structure should look like this simplified tree:
          C:\
          +---opt
              +---SDK.pdf
              +---STI_GPS
              |   +---obj
              |   +---lib
              |   +---dep
              |   \---bin
              +---sparc-elf-3.4.4-mingw
              |   +...
              |   \...
              \---GnuWin32
                  +...
                  \...
      
    • To test the installation change directory to "C:\opt\STI_GPS\" and type:
          C:\opt\STI_GPS>make clean
      	
          The result should be:
          rm -f obj/* dep/* bin/*
          
          C:\opt\STI_GPS>make
      	
          The result should be similar to that:
          sparc-elf-gcc -MMD -MG -Wall -c -g -DNDEBUG -funswitch-loops -fweb -frename-regi
          sters -mv8 -msoft-float -I../kernel/inc main.c
          sparc-elf-gcc -MMD -MG -Wall -c -g -DNDEBUG -funswitch-loops -fweb -frename-regi
          sters -mv8 -msoft-float -I../kernel/inc spi.c
          sparc-elf-gcc -MMD -MG -Wall -c -g -DNDEBUG -funswitch-loops -fweb -frename-regi
          sters -mv8 -msoft-float -I../kernel/inc nmea.c
          sparc-elf-gcc -MMD -MG -Wall -c -g -DNDEBUG -funswitch-loops -fweb -frename-regi
          sters -mv8 -msoft-float -I../kernel/inc uart_intf.c
          sparc-elf-gcc  obj/*.o lib/*.o lib/kernel.lib -mv8 -msoft-float -Ttext=0x4000000
          0 -lm  -o bin/soc
          sparc-elf-mkprom -Tdata=0x60000000 -freq 50 -rmw -romws 5 -ramwidth 16 -ramrws 3
           -ramwws 3 -stack 0x60013fe0 -baud 38400 -msoft-float -mv8 obj/main.o obj/spi.o
          obj/nmea.o obj/uart_intf.o lib/gps_main.o lib/uart.o lib/binmsg.o lib/pll_clock.
          o lib/flash.o lib/lte_flash.o lib/logdata.o lib/set_system.o lib/kernel.lib
      
          LEON MKPROM prom builder for BCC v1.0.29c
          Copyright Gaisler Research 2004, all rights reserved.
      
          Section in rom detected, switching off compression
          :
          :
          creating LEON3 boot prom: prom.out
                 1 Datei(en) kopiert.
      
          mv prom.out bin
          sparc-elf-objcopy -O binary bin/prom.out bin/prom.bin
          sparc-elf-objdump -d -S bin/prom.out > bin/prom.asm
          rm -f tmp.out
          rm -f bin/prom.out
      
    • For a detailed information about the prom.bin, download the External link MinGW "GNU-Binutils".
    • Extract "size.exe" from the downloaded file (e.g. with External link7-zip v9.20) and copy it to
      "C:\opt\GnuWin32\bin".
    • Now you can add the following (blue) lines to your "Makefile":
          :
          $(LD)  $(OBJ_DIR)...
          $(MKPROM) -Tdata=0x6...
          size prom.out
          sparc-elf-readelf -a prom.out >> prom.map
          mv prom.out $(BIN_DIR)
          mv prom.map $(BIN_DIR)
          sparc-elf-objcopy -O binary $(BIN_DIR)/prom.out $(BIN_DIR)/prom.bin
          sparc-elf-objdump -d -S $(BIN_DIR)/prom.out > $(BIN_DIR)/prom.asm
          rm -f tmp.out
          rm -f $(BIN_DIR)/prom.out
          :
      
    • Now "\bin\prom.map" contains the mapping information of all the variables of your code.

  • "BMSG_UserDefine is called by SkyTraq software which will process user defined binary message (following AN003 spec). Refer to the attached example.c file, I have used 2 examples inside the BMSG_UserDefine The first one is similar to SkyTraq query software version, except the request ID and response ID are different. The second is the set function which set the one GPIO data to be high or low."
    (SkyTraq engineers answer and example code)
        U08 BMSG_user_reply_sw_version(U08 *buf, U08 *repbuf)
        {
            U08 retVal = FALSE
            
            if ( buf[0] == 1 )
            {
                U08 ndx = 1;    // reserve ndx=0 for internal assigned reply id
                retVal  = TRUE;
                
                repbuf[ndx++] = buf[0];
    
                repbuf[ndx++] =      0;
                repbuf[ndx++] = (U08)1;
                repbuf[ndx++] = (U08)2;
                repbuf[ndx++] = (U08)3;
                repbuf[ndx++] =      0;
                repbuf[ndx++] = (U08)4;
                repbuf[ndx++] = (U08)5;
                repbuf[ndx++] = (U08)6;
                repbuf[ndx++] =      0;
                repbuf[ndx++] = (U08)7;
                repbuf[ndx++] = (U08)8;
                repbuf[ndx]   = (U08)9;
            }
    
        return retVal;
        }
    
        U08 BMSG_user_configure_gpio(U08 *buf, U08 *repbuf)
        {
            U08 gpio_num = buf[0];
            U08 data     = buf[1];
            
            if ( data == 1 )
                gpio_high(gpio_num);
            else
                gpio_low(gpio_num);
        
        return TRUE;
        }
        
        //currently 0x51~0x6F, 0x95~0xa7, 0xf2~0xff are not used, others are used internally
        #define USER_QUERY_SW_VERSION_ID 0x51
        #define USER_REPLY_SW_VERSION_ID 0x95
        #define USER_SET_GPIO 0x52
        
        U08 BMSG_UserDefine(U08 reqID,U08 *reqbuf,U08 *repID,U08 *repbuf,U16 *replen)
        {
            U08 retval = FALSE;
            *repID = 0;
            *replen = 0;
            
            switch(reqID)
            {
                // example: set and need to reply
                case USER_QUERY_SW_VERSION_ID: 
                    retval  = BMSG_user_reply_sw_version(reqbuf, repbuf);
                    *replen = 14;   //this is the same format as the skytraq query sw version
                    *repID  = USER_REPLY_SW_VERSION_ID;
                    break;
                
                // example: set only
                case USER_SET_GPIO:
                    retval = BMSG_user_configure_gpio(reqbuf, repbuf);
                    break;  
            }
            return retval;
        }											
    
  • "The process_nmea_message is called by process_kernel_output_data API. Without process_nmea_message, compile will fail. In process_nmea_message, we open NMEA_gga, NMEA_gll, NMEA_gsa, NMEA_gsv, NMEA_rmc, NMEA_vtg in nmea.c for user to change the output format of each message." (SkyTraq engineers answer)
  • "gps_process()" has to be called cyclically inside the main loop, otherwise, the chips watchdog will do a system reset after about 60s.
  • UART functions must not be used before calling "gps_init()", otherwise the CPU will hang.
  • The Venus638 uses the External link"SPI master core" from Opencores.org.
  • The SPI can run with a maximum of about 7.5 MHz (periph. bus frequency / 2).
  • If the SPI-master is used, PIO5 acts as alternative function SS #2 of the SPI. The pin can not be used as a GPIO in this case.
  • A Yamaichi "FPS009-3202-BL" SD-card socket fits the pads on the bottom of the Venus638-EVK.
  • For a proper operation of a SD-card, the MISO (pin 7 of the card socket) must be pulled to VCC33 with about 10k.
  • The Venus638 uses the External link"I2C controller core" from Opencores.org.
  • The I2C core can only be used in polling mode (polling "TIP", no IRQ).
  • The file External link"almanac.log" from the SkyTraq-FTP contains an actual "almarray[]" for the SDK.
    To always have the latest almanac data included automatically in your sources, the following steps must be done:
    If you are using the environment described above, download the External linkGnuWin32 "Wget" package and install it as suggested to "c:\opt\GnuWin32".
    The following (marked blue) has to be added to the "Makefile":
        :
        main.o: main.c almanac.log
        
        almanac.log:
            wget ftp://skytraq:skytraq@60.250.205.31/ephemeris/almanac.log
        
        $(BIN_DIR)/$(PRJ_NAME): $(system_objects)
        :
        :
        clean: 
            -rm -f obj/* dep/* bin/* almanac.log
        :
    
    Additionally the "almanac.log" must be included into the "main.c" (marked blue):
        :
        U32 odm_revision;
        U32 odm_version = 0x010101;
        
        #include "almanac.log"
        
        S16 GGA_count = 0,...
        :
    
    So if "alamanac.log" doesn't exist (e.g. after a "make clean"), the file is automatically downloaded at a "make". (Thanks to External linktz for that information and approach)

Projects

Venus 6 EVK/SDK

 

 

 

 

 

 

Disclaimer

 

Valid HTML 4.01!

Views since
04.03.2011:



Powered by

all-inkl.com webhosting  


Last update at 10.04.2011 by Thorsten Godau DL9SEC