The ZombieVerter VCU Project

Locked
User avatar
mdrobnak
Posts: 692
Joined: Thu Mar 05, 2020 5:08 pm
Location: Colorado, United States
Has thanked: 1 time
Been thanked: 5 times

Re: The ZombieVerter VCU Project

Post 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.
User avatar
Jack Bauer
Posts: 3646
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 288 times
Contact:

Re: The ZombieVerter VCU Project

Post 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?
I'm going to need a hacksaw
User avatar
mdrobnak
Posts: 692
Joined: Thu Mar 05, 2020 5:08 pm
Location: Colorado, United States
Has thanked: 1 time
Been thanked: 5 times

Re: The ZombieVerter VCU Project

Post 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
User avatar
johu
Site Admin
Posts: 6645
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 348 times
Been thanked: 1508 times
Contact:

Re: The ZombieVerter VCU Project

Post 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.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 6645
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 348 times
Been thanked: 1508 times
Contact:

Re: The ZombieVerter VCU Project

Post by johu »

Found it :) Pretty weird syntax:

Code: Select all

ifneq ($(shell test -s libopencm3/lib/libopencm3_stm32f1.a && echo -n yes),yes)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jon volk
Posts: 574
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: The ZombieVerter VCU Project

Post 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
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
mdrobnak
Posts: 692
Joined: Thu Mar 05, 2020 5:08 pm
Location: Colorado, United States
Has thanked: 1 time
Been thanked: 5 times

Re: The ZombieVerter VCU Project

Post 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?
User avatar
mdrobnak
Posts: 692
Joined: Thu Mar 05, 2020 5:08 pm
Location: Colorado, United States
Has thanked: 1 time
Been thanked: 5 times

Re: The ZombieVerter VCU Project

Post by mdrobnak »

Cleaned up warnings:
https://github.com/damienmaguire/Stm32-vcu/pull/10

Please review.

-Matt
User avatar
Jack Bauer
Posts: 3646
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 288 times
Contact:

Re: The ZombieVerter VCU Project

Post by Jack Bauer »

I'm a simple guy. I see a pull request, I merge it.
I'm going to need a hacksaw
User avatar
johu
Site Admin
Posts: 6645
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 348 times
Been thanked: 1508 times
Contact:

Re: The ZombieVerter VCU Project

Post by johu »

:D

How do you think about removing the binaries from repo? Usually they reside in the releases
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
mdrobnak
Posts: 692
Joined: Thu Mar 05, 2020 5:08 pm
Location: Colorado, United States
Has thanked: 1 time
Been thanked: 5 times

Re: The ZombieVerter VCU Project

Post 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.
User avatar
Jack Bauer
Posts: 3646
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 288 times
Contact:

Re: The ZombieVerter VCU Project

Post by Jack Bauer »

Sounds like a plan to me:)
I'm going to need a hacksaw
User avatar
mdrobnak
Posts: 692
Joined: Thu Mar 05, 2020 5:08 pm
Location: Colorado, United States
Has thanked: 1 time
Been thanked: 5 times

Re: The ZombieVerter VCU Project

Post by mdrobnak »

User avatar
mdrobnak
Posts: 692
Joined: Thu Mar 05, 2020 5:08 pm
Location: Colorado, United States
Has thanked: 1 time
Been thanked: 5 times

Re: The ZombieVerter VCU Project

Post 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
User avatar
Jack Bauer
Posts: 3646
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 288 times
Contact:

Re: The ZombieVerter VCU Project

Post by Jack Bauer »

Thanks again Matt and everyone on here. I did get some work done the E46 today:)
Attachments
2021-01-23 13.12.23.jpg
I'm going to need a hacksaw
User avatar
Jack Bauer
Posts: 3646
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 288 times
Contact:

Re: The ZombieVerter VCU Project

Post 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.
I'm going to need a hacksaw
User avatar
johu
Site Admin
Posts: 6645
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 348 times
Been thanked: 1508 times
Contact:

Re: The ZombieVerter VCU Project

Post 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.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
mdrobnak
Posts: 692
Joined: Thu Mar 05, 2020 5:08 pm
Location: Colorado, United States
Has thanked: 1 time
Been thanked: 5 times

Re: The ZombieVerter VCU Project

Post by mdrobnak »

Try now, Damien.
User avatar
Jack Bauer
Posts: 3646
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 288 times
Contact:

Re: The ZombieVerter VCU Project

Post by Jack Bauer »

We're back in business. Added in v2 and v3 data from the isa shunt and the charger mode menu.
I'm going to need a hacksaw
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: The ZombieVerter VCU Project

Post 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.
Attachments
auris_data_27-1-2021.zip
(446.9 KiB) Downloaded 153 times
User avatar
Jack Bauer
Posts: 3646
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 288 times
Contact:

Re: The ZombieVerter VCU Project

Post by Jack Bauer »

That's fantastic!
I'm going to need a hacksaw
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: The ZombieVerter VCU Project

Post 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.
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: The ZombieVerter VCU Project

Post 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...
User avatar
Jack Bauer
Posts: 3646
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 288 times
Contact:

Re: The ZombieVerter VCU Project

Post by Jack Bauer »

Will give that a shot this morning and report back.
I'm going to need a hacksaw
User avatar
Jack Bauer
Posts: 3646
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 9 times
Been thanked: 288 times
Contact:

Re: The ZombieVerter VCU Project

Post 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?
I'm going to need a hacksaw
Locked