Can't read logs from data source

98 views
Skip to first unread message

Robbie Yeoman

unread,
Aug 17, 2016, 7:04:13 PM8/17/16
to OpenXC
Hi all,

Very new to OpenXC, using chipkit, and creating custom firmware. I have set up my test environment and all was working with some basic custom firmware using passthrough.json. Things were finally progressing past set-up.

Unfortunately, after creating a custom .json file with bit numbering and custom messages I can no longer communicate with the hardware through openxc-dump or openxc-control version from command line. It seems like a driver issue or maybe a path issue but I have uninstalled and reinstalled python made sure it was 32 and not 64. Checked my Path requirements and reinstalled the USB backend. I am lost. Everything was working earlier today 


Here is what I see when I try to open up the communication via CMD line and MicroUSB Any help is greatly appreciated.

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\ryeom_000>cd Documents\GitHub\vi-firmware\script

C:\Users\ryeom_000\Documents\GitHub\vi-firmware\script> upload_hex.bat C:\Users\Ryeom_000\Documents\GitHub\vi-firmware\src\Build\CHIPKIT\vi-firmware-CHIPKIT.hex com3
ECHO is off.
ECHO is off.

avrdude.exe: no programmer has been specified on the command line or the config file
             Specify a programmer using the -c option and try again


C:\Users\ryeom_000\Documents\GitHub\vi-firmware\script> upload_hex.bat C:\Users\Ryeom_000\Documents\GitHub\vi-firmware\src\Build\CHIPKIT\vi-firmware-CHIPKIT.hex com3
-q -V -p
-c  -b  -P
avrdude.exe: invalid baud rate specified '-P'

C:\Users\ryeom_000\Documents\GitHub\vi-firmware\script> upload_hex.bat C:\Users\Ryeom_000\Documents\GitHub\vi-firmware\src\Build\CHIPKIT\vi-firmware-CHIPKIT.hex com3
-q -V -p 32MX795F512L
-c stk500v2 -b 115200 -P com3

avrdude.exe: AVR device initialized and ready to accept instructions
avrdude.exe: Device signature = 0x504943
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: current erase-rewrite cycle count is -1145324613 (if being tracked)
avrdude.exe: erasing chip
avrdude.exe: reading input file "C:\Users\Ryeom_000\Documents\GitHub\vi-firmware\src\Build\CHIPKIT\vi-firmware-CHIPKIT.hex"
avrdude.exe: writing flash (257696 bytes):
avrdude.exe: 257696 bytes of flash written

avrdude.exe: safemode: Fuses OK

avrdude.exe done.  Thank you.


C:\Users\ryeom_000\Documents\GitHub\vi-firmware\script>openxc-control version
Can't read logs from data source -- stopping: ("USB device couldn't be read", USBError(None, 'usb_reap: timeout error'))
Can't read from data source -- stopping: ("USB device couldn't be read", USBError(None, 'usb_reap: timeout error'))
Device is running version None

C:\Users\ryeom_000\Documents\GitHub\vi-firmware\script>openxc-dump
{"bus": 1, "data": "0x0027000000000000", "id": 0, "timestamp": 1471473976.871}
Can't read logs from data source -- stopping: ("USB device couldn't be read", USBError(None, 'usb_reap: timeout error'))
Can't read from data source -- stopping: ("USB device couldn't be read", USBError(None, 'usb_reap: timeout error'))

C:\Users\ryeom_000\Documents\GitHub\vi-firmware\script>

Robbie Yeoman

unread,
Aug 18, 2016, 12:30:18 PM8/18/16
to OpenXC
I also wanted to add that when I am using emulated data there is no issue with the USB and all data comes across with no errors. Is it something in my .json file that could be causing the issue? 
Here is my simple template that seems to be giving USB issues. Any help is greatly appreciated.
{   "name": "AiM CAN",
    "buses": {
        "hs": {
            "controller": 1,
            "speed": 1000000
        }
    },
    "messages": {
        "0x420": {
            "name": "Engine_RPM",
            "bus": "hs",
            "signals": {
                "Engine_Speed": {
                    "generic_name": "RPM",
                    "bit_numbering_inverted":"true",
                    "bit_position": 0,
                    "bit_size": 8

Kyle Kelly

unread,
Aug 19, 2016, 9:55:12 AM8/19/16
to OpenXC
Typically the baud rate for the HS CAN is 500000, I think you should try that. Although, I am not sure what you mean by AiM CAN...

Robbie Yeoman

unread,
Aug 19, 2016, 11:50:03 AM8/19/16
to OpenXC
I am trying to interpret CAN data from a bus that I know very intimately. I have a full template for the bus traffic. The template runs 1Mbit and it is Least Significant Bit first. I was using this bus as a stepping stone to understand the chipkit hardware and firmware creation process. 

Using this same CAN bus I can stream raw CAN data but once I try to assign values and names to the ID's the USB communication drops out. I hope that helps shine a bit more light on the issue.

Zac

unread,
Aug 22, 2016, 12:15:22 PM8/22/16
to OpenXC
Hi Robbie,

Have you tried compiling with DEGUG enabled? This might provide a bit more information for us to look at. Here's a link: http://vi-firmware.openxcplatform.com/en/master/testing.html?highlight=debug

The only other issue I can think of (potentially) could be the bit numbering/bit position. You've got a bit position of "0" and size of "8." Can you check that signal in the generated signals.cpp file to make sure it's not trying to go from 0 to -8? 

One other idea would be to try 1 translated signal at a time to see if you can narrow it down to a particular signal that's causing issues.

- Zac
Reply all
Reply to author
Forward
0 new messages