Tesla charger STM32 firmware now open source

Topics concerning the Tesla front and rear drive unit drop-in board
Post Reply
User avatar
johu
Site Admin
Posts: 6709
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1536 times
Contact:

Tesla charger STM32 firmware now open source

Post by johu »

I finally got around to publishing the charger firmware.
Janosch has added unit tests to it for that finishing touch, thanks very much!

https://github.com/jsphuebner/stm32-teslacharger

Please understand that with this step I completely withdraw from development and support of this firmware and would be happy to find a new maintainer.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
evolver1566
Posts: 6
Joined: Mon Dec 05, 2022 5:36 am
Has thanked: 5 times
Been thanked: 6 times

Re: Tesla charger STM32 firmware now open source

Post by evolver1566 »

Thank you for everything that you've done, Johannes. It's such a terrific effort.
nathaniel
Posts: 95
Joined: Thu Jun 09, 2022 10:17 am
Been thanked: 50 times

Re: Tesla charger STM32 firmware now open source

Post by nathaniel »

hi, can someone build the .bin and .hex for me, i'm messing around with the terminal and cubeIDE but i keep getting the same error messages. I would like to try this version but I just can't get it to build.

thx
royhen99
Posts: 261
Joined: Sun Feb 20, 2022 4:23 am
Location: N. Wiltshire. UK
Has thanked: 22 times
Been thanked: 130 times

Re: Tesla charger STM32 firmware now open source

Post by royhen99 »

Files below, but it's version 1.17.R which I think you are already using.
Attachments
stm32_charger.hex
(65.97 KiB) Downloaded 192 times
stm32_charger.bin
(23.44 KiB) Downloaded 194 times
nathaniel
Posts: 95
Joined: Thu Jun 09, 2022 10:17 am
Been thanked: 50 times

Re: Tesla charger STM32 firmware now open source

Post by nathaniel »

Thx men!
I'm the meantime I got the building also working! But when I make some changes in the chargercan file and build it and then upload the changes are not working. I changed the DC set current to ac set current but when I flash the new bin file the DC current is still changing via the can messages and not the AC current.
I think the flashing via the web interface is not working. I got the upload complete message followed bij 0% until 100% so normal that would be ok. But maybe got a old bootloader and the flashing via web is not working. Try tomorrow via stlink.
User avatar
johu
Site Admin
Posts: 6709
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1536 times
Contact:

Re: Tesla charger STM32 firmware now open source

Post by johu »

Ah, what it does is checking whether the canmap loaded successfully from flash. Only if it didn't it will execute the code in chargercan. That change was necessary to allow user mappings again. You'd need to erase the second-to-last flash page for it to be reinitialized.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jsimonkeller
Posts: 80
Joined: Sun Oct 30, 2022 2:21 am
Has thanked: 4 times
Been thanked: 9 times

Re: Tesla charger STM32 firmware now open source

Post by jsimonkeller »

royhen99 wrote: Sat Apr 29, 2023 7:09 pm Files below, but it's version 1.17.R
Hi guys. I was wondering if 1.17R is still the most current version of the firmware (which I am running). If not, is it possible to post a download for the latest version in .bin and .hex? Thanks!
Zieg
Posts: 360
Joined: Mon Apr 25, 2022 3:31 am
Has thanked: 151 times
Been thanked: 146 times

Re: Tesla charger STM32 firmware now open source

Post by Zieg »

I'm not certain, but looking through the source code I think there is a newer version than 1.17R. One of the files seems to reference 1.6 if I am reading it right.

I'm trying to compile the code but hit a roadblock. After getting Ubuntu running on my laptop (something I wanted to do anyway) and getting my SSH key attached to my github account, I managed to clone the repository and get-deps, but when running the make command I seem to be missing my_fp.c and my_fp.o? Obviously, this stuff is clearly beyond me. I do have my_fp.h. And, the .bin and .hex files do actually appear after running the command. It looks like the error is coming up in the 'test' phase but not sure if that is a problem or not.

If I can sort it out I may post the bin after uploading it to my board to verify the version.. though I'm not sure anyone would want to trust it in case I still managed to compile it wrong etc.
Attachments
Screenshot from 2024-08-10 12-19-10.png
royhen99
Posts: 261
Joined: Sun Feb 20, 2022 4:23 am
Location: N. Wiltshire. UK
Has thanked: 22 times
Been thanked: 130 times

Re: Tesla charger STM32 firmware now open source

Post by royhen99 »

That has compiled the file. OBJCOPY stm32_charger.bin creates the bin file which will be in the project folder.
There is something wrong in the makefile that is causing the error, but it can be ignored.

I posted bin file here yesterday. viewtopic.php?p=73725#p73725
Zieg
Posts: 360
Joined: Mon Apr 25, 2022 3:31 am
Has thanked: 151 times
Been thanked: 146 times

Re: Tesla charger STM32 firmware now open source

Post by Zieg »

Ah, okay, thanks. I knew the bin was made but couldn't tell if it was complete or not. Hate to ignore an error when I don't understand what it is, haha.



EDIT: Discovered the problem was I didn't have g++ installed. Discovered this by trying to repeat the command right before the error, and it said g++ was not installed. Once installed I ran the compile again and this time it gave me some debugging info and said all the tests passed. Uploaded to the board (which is still on the bench, charger is in the mail) and it comes back as 1.19.R just like yours.
Post Reply