Page 12 of 38

Re: The ZombieVerter VCU Project

Posted: Fri Jan 22, 2021 5:16 pm
by mdrobnak
johu wrote: Fri Jan 22, 2021 5:06 pm ok thanks, will try next time. Actually I have updated the CHAdeMO module in stm32-car so I could PR that next

Also cloned Damien repo and compilation is a bit rough.

First time make: it tries to build but can't because it doesn't have the deps. THEN it pulls the deps.
Second time make: it generates the headers again and then makes flawlessly

I personally wouldn't run get-deps in the default target as it clutters the screen on every build even if you changed just one file.
That's so odd. I did try a fresh copy and had no issues. Maybe some sort of cache I'm unaware of.

I debated on the make get-deps thing. It's easier from the user perspective to not have to deal with it.

opencm3 should be smart enough to not regen the headers on every run. ;) But I had some trouble with the makefile and getting figuring out how to make that work right.



Re this warning:

Code: Select all

src/isa_shunt.cpp: In static member function 'static void ISA::handle528(uint32_t*, uint32_t)':
src/isa_shunt.cpp:179:48: warning: unused parameter 'time' [-Wunused-parameter]
On all the CAN related items - what are we expecting to do with the time parameter? Is there something we should be setting for performance stats? Or should I rip that parameter out?

I'm trying to reduce the amount of warnings generated.

Re: The ZombieVerter VCU Project

Posted: Fri Jan 22, 2021 5:40 pm
by Jack Bauer
Hey guess what? I'm a moron. Seem you need to run "make" twice. I didn't. Anyway, made a start on the charger module then my brain went a bit weird so will pick up tomorrow. Serious question : is there a book I could get on this type of programming?

Re: The ZombieVerter VCU Project

Posted: Fri Jan 22, 2021 5:45 pm
by mdrobnak
Jack Bauer wrote: Fri Jan 22, 2021 5:40 pm Hey guess what? I'm a moron. Seem you need to run "make" twice. I didn't. Anyway, made a start on the charger module then my brain went a bit weird so will pick up tomorrow. Serious question : is there a book I could get on this type of programming?
Heh.

Good question. My C++ is weak sauce.

So there's a couple pieces at play here:
* Algorithm design
* Object-oriented design
* Build process (Makefiles)
* Version control

That goes into 'this type of programming'. It's not simple, which is why it's takes some time to get up to speed.

-Matt

Re: The ZombieVerter VCU Project

Posted: Fri Jan 22, 2021 6:08 pm
by johu
I learned a lot from "Clean Code": https://www.oreilly.com/library/view/cl ... 136083238/

Examples are given in java but it is almost identical to C++ structurally. It's high level concepts.

Matt, do you see a way to only run "get-deps" if a certain file is not present? I'm no Makefile guru.

Re: The ZombieVerter VCU Project

Posted: Fri Jan 22, 2021 6:47 pm
by johu
Found it :) Pretty weird syntax:

Code: Select all

ifneq ($(shell test -s libopencm3/lib/libopencm3_stm32f1.a && echo -n yes),yes)

Re: The ZombieVerter VCU Project

Posted: Fri Jan 22, 2021 6:50 pm
by jon volk
johu wrote: Fri Jan 22, 2021 6:08 pm I learned a lot from "Clean Code": https://www.oreilly.com/library/view/cl ... 136083238/

Examples are given in java but it is almost identical to C++ structurally. It's high level concepts.

Matt, do you see a way to only run "get-deps" if a certain file is not present? I'm no Makefile guru.
Github .pdf of said book.
https://github.com/ontiyonke/book-1/blo ... tin%5D.pdf

Re: The ZombieVerter VCU Project

Posted: Fri Jan 22, 2021 7:01 pm
by mdrobnak
johu wrote: Fri Jan 22, 2021 6:47 pm Found it :) Pretty weird syntax:

Code: Select all

ifneq ($(shell test -s libopencm3/lib/libopencm3_stm32f1.a && echo -n yes),yes)
LOL. Yet to me that makes sense. ;)

Let's break this down.

"ifneq (thing,other thing)"

$() < Make variable
shell ... < run this shell command
test -s < Non-zero file size
&& execute command on right only if left side is true

Thus..
If bash sees a file in libopencm3... that's not zero, run "echo -n yes" which outputs yes without a newline (-n switch)

yes matches yes, therefore it's equal...and doesn't run the build piece.

-Matt

Edit: Any thoughts on the CAN function question I had?

Re: The ZombieVerter VCU Project

Posted: Sat Jan 23, 2021 6:46 am
by mdrobnak
Cleaned up warnings:
https://github.com/damienmaguire/Stm32-vcu/pull/10

Please review.

-Matt

Re: The ZombieVerter VCU Project

Posted: Sat Jan 23, 2021 10:53 am
by Jack Bauer
I'm a simple guy. I see a pull request, I merge it.

Re: The ZombieVerter VCU Project

Posted: Sat Jan 23, 2021 4:59 pm
by johu
:D

How do you think about removing the binaries from repo? Usually they reside in the releases

Re: The ZombieVerter VCU Project

Posted: Sat Jan 23, 2021 5:38 pm
by mdrobnak
johu wrote: Sat Jan 23, 2021 4:59 pm :D

How do you think about removing the binaries from repo? Usually they reside in the releases
Yes please. I was not too bothered by the .hex file, but the others definitely hehe.

As for long term, that makes sense. Some releases a version and that's what you download. Otherwise build it yourself.

Re: The ZombieVerter VCU Project

Posted: Sat Jan 23, 2021 5:38 pm
by Jack Bauer
Sounds like a plan to me:)

Re: The ZombieVerter VCU Project

Posted: Sat Jan 23, 2021 6:06 pm
by mdrobnak

Re: The ZombieVerter VCU Project

Posted: Sat Jan 23, 2021 6:14 pm
by mdrobnak
As all branches are merged, all removed except for master.

Something to note: Don't worry if a branch you base stuff off of 'disappears' - git knows the differences based on the actual commit hash. A branch is nothing but a pointer to a hash.

I'll be doing life stuff, and data analysis on the Charge Port for the remainder of the day, unless I broke something (unlikely. ;)).

-Matt

Re: The ZombieVerter VCU Project

Posted: Sat Jan 23, 2021 6:15 pm
by Jack Bauer
Thanks again Matt and everyone on here. I did get some work done the E46 today:)

Re: The ZombieVerter VCU Project

Posted: Mon Jan 25, 2021 2:09 pm
by Jack Bauer
So cloned the repo fresh and loaded on the vcu. No parameters are displayed and the board does not respond to a "reset" sent as custom command. Loaded up my old working copy and all is fine.

Re: The ZombieVerter VCU Project

Posted: Mon Jan 25, 2021 2:56 pm
by johu
Narrowed it down to TX DMA not working, will dig in a bit more.

EDIT: haha, ok the VCU never used DMA for TX :) Had an older version of terminal.c and TX DMA wasn't enabled in usart_setup() because you hard coded REV1 hardware.

EDIT2: pull request made.

Re: The ZombieVerter VCU Project

Posted: Mon Jan 25, 2021 3:33 pm
by mdrobnak
Try now, Damien.

Re: The ZombieVerter VCU Project

Posted: Tue Jan 26, 2021 1:27 pm
by Jack Bauer
We're back in business. Added in v2 and v3 data from the isa shunt and the charger mode menu.

Re: The ZombieVerter VCU Project

Posted: Wed Jan 27, 2021 8:19 am
by Dilbert
OK I used 2 FTDI cables to grab both sides of the MTH/HTM stream from the Auris hybrid last night. I used 2 copies of real term (capture as hex to file) to capture both sides of the communication at 500Kbits and it appears to have worked really well. The data looks much better than before, see attached CSV files. I also wrote a decoder in python to format the hex data into CSV files.

There's two sets of data in the attached zip file, one where the car was started but not driven and the other where it was driven in EV mode using just MG2. The temperature was warmer last night so the car didn't start when driving in EV mode.

The first 3 rows of the HTM frame is used to initialize the inverter. It appears that there's a byte in each frame reserved as a heartbeat byte, HTM byte 94 is incremented every second frame, i'm not sure if this is being echo'd in MTH byte 117 or it is just running the same type counter.

Re: The ZombieVerter VCU Project

Posted: Wed Jan 27, 2021 8:31 am
by Jack Bauer
That's fantastic!

Re: The ZombieVerter VCU Project

Posted: Wed Jan 27, 2021 8:37 am
by Dilbert
It would be worth trying to add the following line to state 9 in the 1mS state machine:

if(++frame_count & 0x01){
htm[94]++;
}


frame_count would need to defined as static int, but this should increment the HB counter for every second transmission to the inverter.

In one of my data captures i see that the possibly HB signal only increments by 1, so the 10mS clock generating it is possibly not sync'd to the inverter frames, but i don't see this as an issue.

Re: The ZombieVerter VCU Project

Posted: Wed Jan 27, 2021 8:41 am
by Dilbert
Jack Bauer wrote: Wed Jan 27, 2021 8:31 am That's fantastic!
Yes very happy with the data!

One thing which we could probably do is try a replay of the HTM data frames, if we can figure out a way to clock it out at the right time(s). But this will probably be a last resort...

Re: The ZombieVerter VCU Project

Posted: Wed Jan 27, 2021 8:46 am
by Jack Bauer
Will give that a shot this morning and report back.

Re: The ZombieVerter VCU Project

Posted: Wed Jan 27, 2021 10:11 am
by Jack Bauer
So added this to the bottom of case 9 :

Code: Select all

        //checksum
        if(++frame_count & 0x01){
        htm_data[94]++;
        }

		CalcHTMChecksum(100);
and declared frame_count as a uint8_t. Sadly still no life from the inverter. Worth me grabbing some data?