Problem flashing Freematics Vehicle Data Logger

Inquiry and support for Freematics products
Post Reply
jacealot
Posts: 4
Joined: Wed Aug 05, 2015 11:08 pm

Problem flashing Freematics Vehicle Data Logger

Post by jacealot »

I'm using a Arduino Uno as ISP and when I try to write the datalogger v3 sketch I get the following:

Code: Select all

avrdude: Version 6.0.1, compiled on Apr 14 2015 at 16:30:25
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/jason/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem143341
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "/var/folders/lp/db6ljhb56jnchnzc695wm3d80000gn/T/build7708092321181310918.tmp/datalogger.cpp.hex"
avrdude: writing flash (28948 bytes):

Writing | ################################################## | 100% 35.33s

avrdude: 28948 bytes of flash written
avrdude: verifying flash memory against /var/folders/lp/db6ljhb56jnchnzc695wm3d80000gn/T/build7708092321181310918.tmp/datalogger.cpp.hex:
avrdude: load data flash data from input file /var/folders/lp/db6ljhb56jnchnzc695wm3d80000gn/T/build7708092321181310918.tmp/datalogger.cpp.hex:
avrdude: input file /var/folders/lp/db6ljhb56jnchnzc695wm3d80000gn/T/build7708092321181310918.tmp/datalogger.cpp.hex contains 28948 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 21.55s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x042a
         0x86 != 0xa8
avrdude: verification error; content mismatch

avrdude done.  Thank you.


Any ideas what is going wrong?

Thanks,
Jason
jacealot
Posts: 4
Joined: Wed Aug 05, 2015 11:08 pm

Re: Problem flashing Freematics Vehicle Data Logger

Post by jacealot »

Well found the following site http://www.gammon.com.au/bootloader
And the tools under https://github.com/nickgammon/arduino_sketches work to flash the bootloader and the Atmega_Hex_Uploader (http://www.gammon.com.au/forum/?id=11638) needed some fixes but it did help to program the Data logger with v3.
I have not tried it out in my car, but it does write log files to the SD card.

Cheers,
Jason
markiempje
Posts: 5
Joined: Wed Aug 05, 2015 7:59 am

Re: Problem flashing Freematics Vehicle Data Logger

Post by markiempje »

Hey Jason,

i happen to have the same error, appart from the memory location and the value to be different. Verification error; content mismatch.
did you test your solution? Are there some steps you are willing to share to help me out?

Stanley, maybe any help here?

thanks,
Mark
jacealot
Posts: 4
Joined: Wed Aug 05, 2015 11:08 pm

Re: Problem flashing Freematics Vehicle Data Logger

Post by jacealot »

markiempje wrote:Hey Jason,

i happen to have the same error, appart from the memory location and the value to be different. Verification error; content mismatch.
did you test your solution? Are there some steps you are willing to share to help me out?

Stanley, maybe any help here?

thanks,
Mark


Hi Mark,

Flashing the datalogger v3 sketch was successful, my problems now are that the OBD data is not being read correctly. I believe the cause of this is my car (Toyota Prius model 2010). The bus always is powered in my car. So I guess when I plugin the Data Logger it startes and isn't able to read data because the car is not on en therefore fails and does't try again.
When I plugin the data logger during driving ("Kids do not try this at home, we are professionals!") and I have the App running on my ipad I get one reading on the "Live data" part of the app. But then it stop sending OBD data.

I need to find some time to create my own debugging script to see what is going on. I will have to create something that keeps on trying to read OBD data and logs to the SD card and/or log it over bluetooth (BLE) so that I can look at live on my ipad with a bluetooth terminal app.

Enough of my problems, do you want me to write up the steps I did to get the datalogger v3 sketch on the datalogger with the "Atmega_Hex_Uploader" and which fixes I made to it to get it working?
Just let me know.

Cheers,
Jason
stanley
Site Admin
Posts: 1026
Joined: Sat Mar 01, 2014 3:15 am

Re: Problem flashing Freematics Vehicle Data Logger

Post by stanley »

Do you know what protocol (CAN or others) your car uses?
markiempje
Posts: 5
Joined: Wed Aug 05, 2015 7:59 am

Re: Problem flashing Freematics Vehicle Data Logger

Post by markiempje »

Hey Jason,

thanks for the offer, i managed to fix it eventually!
I unplugged the SD card from the obd logger and it programed like a charm. no errors.
I do have another problem (as if it was not enough).
The logger makes a large amount of csv files, with like +-20 data points. and other times it makes a file of 1gb, 800mb. this thing is so unpredictable...

Hey but i can now (eventually) program it, after a couple days of full time trail and error. Mainly driver issue of the programmer i use...

Mark
jacealot
Posts: 4
Joined: Wed Aug 05, 2015 11:08 pm

Re: Problem flashing Freematics Vehicle Data Logger

Post by jacealot »

stanley wrote:Do you know what protocol (CAN or others) your car uses?

It should be ISO 15765-4 (CAN 11/500). I got the info from http://www.obdkey.com/fv_toyota_prius_2010.asp

I have tried to set OBD_ATTEMPTS in config.h to 0, but that doesn't help. It just makes all slow.

Code: Select all

/**************************************
* Hardware setup
**************************************/

// number of attempts of connecting OBD-II (0 for always)
#define OBD_ATTEMPTS 3
Post Reply