This device is an open source (both firmware and board level design) GPS data logger.
You mount it with magnets on some vehicle, flip the power switch and the location
data is saved onto SD card installed in the device. To increase battery life,
device enters sleep mode when it sees no movement for 60 seconds and when some
activity is detected it starts to save new incoming data in a new file. Files are
named TRK*.TXT, where * is a number of the track. Files are named in the order they
are created. After enough data was saved, you retrieve the device and convert the nmea
dump files in a gpx format file (with a program such as gpsbabel) and then you feed
the gpx file to some analysis software (example: viking). All these example softwares
are open source and available for many OS types.
project is designed using KiCad 5.0.0
check KiCad pcb file for PCB manufacturing info
check KiCad sch file component fields + BOM.txt for component info
programmer device used in this project is ST-Link V2
you can use single pin female-female jumpers or a 20cm 1x5pin jumper cable
make sure to plug the programming cable into the header the right way
SIM28 comes in several variants which have different UART speeds by default.
Firmare here expects 9600 baudrate version. if you have different module version
modify USART1 baud rate configuration in /firmware/main/main.c file (USART1->BRR line)
To retrieve data from SD card you will need an SD card reader (recommended), or use
your phone as a USB disk. SD card must be formatted as a FAT filesystem and the files
are saved in first partition by default.
USB socket on the board is used for battery charging only.
current consumption while tracking is 40mA; while waiting for activity less than 1mA.
lowest acceptable battery voltage is approximately 3V, if lower voltage is detected,
the device turns off until the power switch is reset (off) and battery recharged.
firmware was developed on debian 10 (buster) system, using gcc-arm-none-eabi toolchain (compiler, linker,
binutils) and does use gcc specific extentions. was successfully compiled and tested with gcc version 6.3.1
flashing software used = openocd.
IDE used = emacs text editor + Makefile (you will need to have make utility installed)
depends on newlib-nano, libnosys, libgcc. all these libraries, along with the linker script, startup code
and openocd configuration files are included in this repository.
for bulk conversion of TRK*.TXT files to GPX you can use GUI version of gpsbabel, or copy and
then run bash script /firmware/bulkConvert.sh in the directory with TRK*.TXT files.
This will produce TRACKS.GPX output file
to build the firmware cd into the /firmware/ directory, then type:
make
this will produce several output files, among which is firmware.bin
this is a file that contains the firmware to flash. To do it,
insert ST-LINKv2 programmer into the board, then into computer and type:
make upload
/firmware/ --------------- contains makefile, linker script, source files; this is a build directory
/firmware/cmsis/ ---------- necessary header files from CMSIS compliant STM32F0xx standard peripherals library
/firmware/stdlib/ ---------- standard statically linked libraries (libgcc.a, libc_nano.a, libnosys.a)
/firmware/openocd/ ------- standard configuration files for openocd
/firmware/fatfs/ ----------- chan fatfs module for working with FAT filesystem + diskio.c, diskio.h (custom low level driver for SD card communication over SPI)
/firmware/main/main.c ------- file that contains main application
/firmware/main/support.c ------- file that contains interrupt vector table, IRQ handlers and startup code
/hardware/SD_Track.symbols/ -- project specific symbol library
/hardware/SD_Track.pretty/ --- project specific footprint library
/hardware/gerbers/ ----------- gerber+excellon fabrication output files