How to setup a PC to edit and compile a bin that can be uploaded to the VCU or Mini board

Post Reply
ted.walsh
Posts: 26
Joined: Fri Jun 19, 2020 10:24 pm
Location: Ulverston UK Lakedistrict
Has thanked: 10 times
Been thanked: 11 times
Contact:

How to setup a PC to edit and compile a bin that can be uploaded to the VCU or Mini board

Post by ted.walsh »

Allright, I've hacked around with various code formats over the years, BASIC, DOS, BATCH, VB et al, I can probably hold my own at a Noobs convention and hack my way across the open plains of coding but FFS what development environment, what programme do i need to install on my PC to hack about with the source off Damiens GIT, compile it and then upload it to the VCU etc?. Can anyone just give me PDF on how to endanger myself so I can get on with it? please...
Jacobsmess
Posts: 533
Joined: Thu Mar 02, 2023 1:30 pm
Location: Uk
Has thanked: 266 times
Been thanked: 72 times

Re: How to setup a PC to edit and compile a bin that can be uploaded to the VCU or Mini board

Post by Jacobsmess »

I'm no coder, and someone will be along shortly to correct me but I believe it's all c/c++. Arduino IDE or similar should be all you need to look at the binaries (I think). Otherwise, the code is completely uploaded by the web interface, no other software required.
Also, please do not endanger yourself or anyone else (pot calling the kettle black here perhaps!)
User avatar
Bigpie
Posts: 1607
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 314 times

Re: How to setup a PC to edit and compile a bin that can be uploaded to the VCU or Mini board

Post by Bigpie »

https://github.com/crasbe/ZombieBuild will help with the VCU firmware building and also OI. Be aware and changes you make could result in unexpected behaviour, obviously.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
ted.walsh
Posts: 26
Joined: Fri Jun 19, 2020 10:24 pm
Location: Ulverston UK Lakedistrict
Has thanked: 10 times
Been thanked: 11 times
Contact:

Re: How to setup a PC to edit and compile a bin that can be uploaded to the VCU or Mini board

Post by ted.walsh »

Bigpie wrote: Thu Apr 18, 2024 6:41 am https://github.com/crasbe/ZombieBuild will help with the VCU firmware building and also OI. Be aware and changes you make could result in unexpected behaviour, obviously.
Thanks for your help on this BP,
can you tell me where I might find a source of stdint.h and its associated mates? there appear to be pointers in the STM32 making ref and throwing errors?
peterdiffey
Posts: 17
Joined: Sun Aug 20, 2023 8:30 pm
Location: South Cumbria, UK
Has thanked: 6 times
Been thanked: 4 times

Re: How to setup a PC to edit and compile a bin that can be uploaded to the VCU or Mini board

Post by peterdiffey »

Hi Ted,

I just did my first Openinverter compile this very afternoon. From knowing nothing to firmware loaded took less that 1 hour.
I am assuming the VCU has a web interface, that allows you to upload the new firmware.

If you have a Raspberry Pi, it's a doddle

A very quick howto - assuming you have a raspberry pi with Raspian installed. and are doing an OpenInverter build

All done from the command line

sudo apt-get install git
mkdir zombbieverter
cd zombbieverter/
git clone https://github.com/damienmaguire/Stm32-vcu
cd Stm32-vcu/
sudo apt-get install *arm-none*
make get-deps

## Do all yer dodgy hacks and then

make

ls -al stm32_vcu.bin ## check for a sensible date on the new file ie a few secs ago

The first compile took about 2 minutes on a RPI 5, subsequent small code changes took about 3 secs.

getting it to the VCU board can be abit of a faff, I use a USB stick, plug it in to the RPi

sudo mkdir /z
dmesg | grep sd ## and note the last device - probably sda
sudo mount /dev/sda1 /z

cp stm32_vcu.bin /z

ls /z ## check it is really there

sudo umount /z ## to avoid possibly trashing the USB stick when you unplug it

Now you can plug in the USB stick to your laptop and upload the file to your VCU.

I was very surprised how easy it was, I can now get HV battery voltage out of the VCU via Canbus

Pete
Pete
Post Reply