Closed nitrousnrg closed 2 years ago
The baud rate is calculated using 80Mhz
this funcition is called here https://github.com/luna-cycle/vesc_bms_fw/blob/6af13f26a5b80cb0026c5afb4cc41fe033e8d19c/comm_can.c#L118
we can re configure can baud rate here:
also baud rate parameter mus be saved in the backup memory
Yes, just hardcode it from hw_luna_init()
and check if it works.
If it works lets close the issue. The tab in vesc tool that allows changing the baudrate is an XML stored inside our own firmware, we can modify it. If we decide 250kbps is the way to go we can leave it hardcoded.
Btw bafang uses 250kbps so we probably want to stay there.
fixed in fe670fd
To connect to a VESC controller at 500kbps, we need to configure the BMS at 1Mbps.
This probably started when we halved the peripheral clock frequency from 80MHz to 40MHz, so we gotta make the CANbus configuration consideral the PCLK frequency.