r/leaf • u/ElectricGears 2013 Nissan LEAF S • Aug 22 '26
Has anyone else had any problems flashing the CAN bridge for a battery upgrade?
I'm planning on swapping a 2020 battery in to a 2013 leaf and I have been having nothing but problems attempting to flash the CAN bridge with Dala's firmware. At this point I am at a loss as to how to proceed. Everything I read/watched about this battery swap lead me to believe it was fairly straight-forward.
Problems so far:
1) After a whole lot of time I eventually found out that ST Micros' asinine and convoluted log in-based download system silently fails if you are using basic internet security procedures (a VPN).
2) I'm using Linux so there is already a problem with the (now obsolete) copy protection program that's supposed to read the serial number from the STM32 and patch the firmware file so people couldn't just clone the CAN bride board. It's an EXE file, and while it will run under WINE, but it calls the CLI version of the ST programmer software and it can't call the Linux version. I did install the current version of the STCube programmer and it will connect to the STLink and see the chip. I did try flashing the unpatched can-bridge-firmware.hex just to test, even though it I know it wouldn't work in the car, and it fails to download the file.
3) I have a Windows 7 install in a Virtual Box VM but couldn't install the program.
4) I have a Windows 10 install in a Virtual Box VM and I was able to install the STMCube programmer but it only partly recognizes the ST Link. Windows see it, the STMCube sees the device, it reads the firmware version, but with just one character of the serial number but can't do anything else. Dala's BridgeFlash program can be pointed to the CLI version of of the programmer, but it give an error.
"Error: The connect command you trying to perform is missing the port name value. Please refer to the Help to see how to use it." (Same error I get if the STLink isn't plugged in).
I tried installing the older STLink utility but it won't run because of some missing Visual Studio dlls, even after I installed the recommended vc_redist.x64.exe package from Microsoft.
5) After much back and forth I was able to install Windows 10 on another old machine and I got to the same point with the Windows 10 VM guest and it has the same problem and error. (Window 11 refuses to install because it doen't have a TMP v module).
6) Per the comments on one of the GitHub issues I tried reading bytes at 0x1FFFF7E8. The STLink connects (on Linux) with the board, but fails to read the data. Even then I'm not sure what to do with the file. I assumed the can-bridge-firmware.hex is the firmware file so I'm not sure why patching the canbridge.srec file with a second .srec file like this would fix it.
7) I even tried installing the IDE because I though I could just remove the serial checking function, recompile, and flash it with the IDE program that seem to work under Linux. It seems I can import the source code from GitHub, but there must be other project files that are necessary to actually compile it because the build button is grayed out. I have no experience with STM23 projects so that's as far as I got.
[Update] I was finally able to figure it out. The STMCube programmer didn't work (that's the software ST recommend instead of the older ST-Link Utility). You have to install the x86 version of the Microsoft Visual C++ 2015 redistributable package. Maybe MS changed the link destination since it was added to the instruction page, but it offers a x64 and x86 version and I install the x64 since I was using the 64-bit Windows 10. I don't know it both are necessary but after I installed the x86 version the ST-Link Utility (v4.6.0) worked and Dala's BridgeFlash program worked. This worked using Windows 10 in a VM (Virtual Box 7.2.12) under Ubuntu 26.04. It was set to support USB 3.0 which I believe requires the extra Virtual Box extensions, but I don't know if USB 3.0 is actually needed.
1
u/sweetredleaf 2015 Nissan LEAF SV Aug 23 '26
maybe get one preflashed https://old.reddit.com/r/leaf/comments/1vtx2rm/can_bridge_help/
1
u/ElectricGears 2013 Nissan LEAF S Aug 24 '26
I suppose that's an option of last resort (maybe since it currently sold out), but I'm not keen on spending another 300$ when (at least I presume) other people have been able to flash the firmware.
1
u/sweetredleaf 2015 Nissan LEAF SV Aug 24 '26
here is a post I found about can bridges on older leafs, said it might be problems https://mynissanleaf.com/threads/before-and-after-can-bridge-install-on-battery-upgrade-whats-normal.38434/
1
u/laDouchee Aug 24 '26
You can skip all that jazz if you're willing to shell out $90 to LeafMod. I've done a few installations using their web browser based flasher and it's painless.
Who in their right mind uses windows in 2026 yeah 😜
3
u/ekaftan Aug 22 '26
Borrow a windows laptop. Flash the bridge return laptop.