Commit Graph

106 Commits

Author SHA1 Message Date
Benjamin Vedder d8e3128e46 Optimization updates, added pwm-driver and added pwm extensions 2024-04-05 19:26:36 +02:00
Benjamin Vedder ebb0b339bb Use size-optimization on more files where performance is less important 2024-04-01 10:25:56 +02:00
Benjamin Vedder 341a7e67b1 Added cache support 2024-03-10 12:56:27 +01:00
Euan 0f36dee181 Add config for A50S V23c
V23c version includes EEPROM chip to store calibration data.
2024-02-23 19:38:49 +00:00
Benjamin Vedder f9da202eb8 Re-order uart initialization 2023-10-31 09:18:24 +01:00
Benjamin Vedder fd80107522 More hall sensor tweaks 2023-08-08 19:56:48 +02:00
Benjamin Vedder 90ea079389
Merge pull request #624 from Gabrielerusso/master
Duplicated include; improved shutdown.c; store data even without switch
2023-08-07 22:46:22 +02:00
Brian Silverman 98f302e69f Avoid comm_can dividing by 0 from unset appconf
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.
2023-05-14 20:28:51 -07:00
Gabriele Russo 8f2644044e Duplicated include; improved shutdown.c; store backup without power switch;
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.
2023-05-03 02:39:57 +02:00
Benjamin Vedder 572343fd18 Updated changelog and some tweaks 2023-03-29 12:04:12 +02:00
Euan e48f9fef51 Clean PPM in wizard. Temperature comp for HSI.
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.
2022-11-17 22:32:59 +00:00
Benjamin Vedder 23dabd249a Only send start frame when can-mode is vesc, added option to c lib build 2022-10-07 18:45:21 +02:00
Benjamin Vedder ff9679d336 Lisp code streaming, more native functions and checks, custom config support, moved global send buffer to mempools 2022-09-18 22:47:50 +02:00
Benjamin Vedder 90343e68ce Added ST lib support to c libraries, updated examples, added WS2812-example 2022-05-12 16:06:24 +02:00
Kenn Sebesta cf6f32332d [Utils] Update the header includes 2022-03-23 20:25:37 -04:00
secupol 9804dc0914
Update main.c 2022-02-21 17:12:20 +09:00
Benjamin Vedder 468c4f6353
Merge branch 'encoder_split' into master 2022-02-19 15:21:13 +01:00
rodale75 ed88dbe5b0 main: Added CAN boot-frame notification.
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>
2022-02-10 14:23:36 +01:00
rodale75 e328e34ea0 main: Moved the 500ms init-done delay outside of the BOOT_OK_PIN-switch.
And also, moved the  m_init_done-flag to be set before the delay.
This to make sure that the flag is set prior to the PIN notification.
2022-02-10 14:23:31 +01:00
Benjamin Vedder 9527f94cf8 First lisp integration with vesc tool and enabled lisp by default 2022-01-29 03:36:34 +01:00
Jakub Tomczak da4b3e0edd Merge branch 'master' into dev_fw_5_03 2022-01-21 15:07:44 +01:00
Benjamin Vedder 9c484d01e4 Decreased stack sizes to save ram 2022-01-16 21:57:12 +01:00
Benjamin Vedder 4f0388d507 Added lispbm test module (disabled by default) 2022-01-13 14:50:19 +01:00
Benjamin Vedder 16385f1706 Renamed compression to lzo, added observer offset parameter 2022-01-12 12:27:45 +01:00
Jakub Tomczak 2a120615be encoders to encoder refactor 2022-01-09 17:10:40 +01:00
Jakub Tomczak 4743194894 old encoder files deleted 2021-12-20 14:18:51 +01:00
Jakub Tomczak f26f3beb2d WIP: 3 encoders partially implemented, AS504x tested
compiled on gcc-arm-none-eabi-7-2018-q2
2021-12-14 16:40:40 +01:00
Benjamin Vedder e31cb50973 Moved LED control to its own thread 2021-11-01 08:52:18 +01:00
Benjamin Vedder 36c9db6718 Dual motor shutdown fix 2021-08-20 14:59:36 +02:00
Benjamin Vedder 7c6f1dd612 Added fusion IMU filter 2021-08-19 18:48:23 +02:00
Benjamin Vedder f81093922a Added event logging 2021-06-15 12:56:38 +02:00
Benjamin Vedder 75b84f1f2d Added kill switch support 2021-06-13 13:46:27 +02:00
Benjamin Vedder 77af43935a Removed outdated LED-support 2021-05-11 09:57:27 +02:00
Benjamin Vedder fcb7e12158 Made servo output a config option 2021-03-31 16:28:46 +02:00
Benjamin Vedder ecb43e70bb Cleanup 2021-01-13 21:51:55 +01:00
Jeffrey M. Friesen 8f703dace0 merge 2021-01-13 08:57:36 -08:00
Jeffrey M. Friesen e862f29298 Re-wrote uart driver a bit 2021-01-05 09:39:45 -08:00
Mitch Lustig e08d0e8b8c Only init IMU once so it doesn't override UART on reboot 2020-04-28 20:49:09 -07:00
Jeffrey M. Friesen f7964e20c2 Few small changes and fixed bug with duals
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.
2020-04-01 17:58:37 -07:00
Benjamin Vedder 52e17059e5 Major restructuring for dual motor support, and added unity hw files 2020-03-16 18:32:39 +01:00
Benjamin Vedder ceb8b7bf7d HW60_MK3 support, shutdown fix, added COMM_SET_CURRENT_REL, ramp fix, PPM timeout fix, IRQ prio fix 2019-12-19 16:55:38 +01:00
Benjamin Vedder dfc3ed2319 Final v3.62 2019-09-27 12:56:49 +02:00
Benjamin Vedder 602db7435b FW3.59. Many updates, see changelog for details 2019-09-03 20:39:05 +02:00
Benjamin Vedder 023d78679f Fixed flash CRC check 2019-04-18 22:30:01 +02:00
Marcos Chaparro 4fceb73db9 Continuous flash memory integrity check running on background
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>
2019-04-17 20:54:08 -03:00
Marcos Chaparro 1ae059349f CRC integrity check of flash memory
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>
2019-04-15 20:56:42 -03:00
Benjamin Vedder 1161f8417c Added SWD programming support (based on Black Magic Probe) and open loop duty cycle control 2019-03-31 10:49:18 +02:00
Benjamin Vedder 39bb8a6b09 FW 3.53: Limit foc_current_filter_const range, 1Mbit/de NRF speed, lower detect f_sw for resistance, no temp_comp by default 2019-03-20 22:46:36 +01:00
Benjamin Vedder 65298263b6 75/300 R2 support, terminal sync cmd, IMU support, option to disable permanent UART, collected timer functions in one place 2019-03-10 14:57:42 +01:00
Marcos Chaparro 32cf05629d Resolve merge conficts with major 2019 release
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-02-18 20:25:52 -03:00