cancom_status_thread divides by conf->send_can_status_rate_hz. If that's
0, this is undefined behavior. It will be 0 until app_set_configuration
is called by main.
I have some custom hardware which ties CAN_RX high and reliably triggers
this bug every time I start up. The same firmware binary usually starts
up on a 75_300_R2, although occasionally it has the same symptom of
resetting so I wonder if it happens sometimes with a real CAN
transceiver too, depending on the exact timing of startup.
commands.c: delete duplicated "mc_interface.h" include
shutdown.c/shutdown.h/main.c:
- reducing possibility to write backup data frequently, now requires minimum distance to be traveled before it enables storing, common condition if push to start is enabled with a low shutdown time, say 10s, or in any other condition where user turn on/off ESC a lot of times. Saves chip life at the cost of not having updated data during very short trips.
- Data is stored even when using "always on"
- Introducing possibility to store data without a power-switch by using a combination of trip distance and inactivity timer. It can be deactivated by using "always off" in app setting Shutdown Mode.
Option to only send back valid servo pulse lengths to VESC Tool. Stops ground noise making the PPM mapping wizard unusable.
Add temperature compensation for HSI oscillator. Needed to stop PPM pulse length changing drastically over temperature. Fairly simple map at the moment but seems to work very well.
The boot CAN frame is dispatched at system boot and contains a
payload that holds the hw-name (ASCII). This to serve as a notifier
for other nodes on the CAN bus.
Change-Id: I2edb3d58bb51003d9160ceb83905cf93b63a9396
Reviewed-on: https://review.gerrithub.io/c/RadinnAB/vedder_vesc_fw/+/530857
Tested-by: Mr. Jenkins <jenkins@radinn.com>
Tested-by: aleksandar rodzevski <aleks@radinn.com>
Reviewed-by: aleksandar rodzevski <aleks@radinn.com>
Reviewed-by: Daniel Nordahl <daniel.nordahl@radinn.com>
Added ramping to current measurement to avoid steps during current calibration with an un-tuned current controller.
Added terminal command for mapping to internal nrf pins, useful when you want to erase_mass a locked nrf chip and dont want to cycle between a bunch of windows to scan connect etc.
Made fault led on duals blink if motor 2 is faulting.
Added break on inductance measurement if motor faults.
Added placeholder commands for changing name and pin of BLE module.
Create a new, low priority thread that checks that the CRC of the
flash memory matches the CRC stored in flash.
8kB chunks are computed every 50 milliseconds. A reset is invoked if
CRC does not match.
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
The check only covers address 0x08008000 to 0x805FFFF, where application
code is stored. It excludes virtual eeprom area (first 0x8000 bytes)
because it is modified on runtime with user configurations.
After a fresh flash programming the CRC is read as 0xFFFFFFFF and firmware
computes and stores the new CRC and a reset is invoked.
After reset the CRC will be available for checking code integrity.
Linker file had a wrong flash2 size, it was set to 480kB, thus allowing
the linking of binaries larger than 393216 (x3 128kB sectors).
The bootloader won't program binaries that span more than 3 sectors.
Now flash2 length is set as (393216 - 8) to ensure that the last 8 bytes
are left blank (0xFFFF) and reserved for CRC information.
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>