* WIP
* start of implement m10 code
* Fetch MON-VER from unit to check for unit version
* test nav5 m10 command
* missing empty lines
* offload detect to config file
* copy from hasli and organization
* fix platform.h include
* fix cli_unittest gps include
* fix cli_unittest for gps calls
* guard ublox version in gpsData
* print human readable hw version
* add utc_standard param and transfer with nav5 set
add nav5x message for autonomous mode for m10
* fix typo
* revert order structure, remove functions and reduce flash size
* revert order structure, remove functions and reduce flash size
* fix gps init and navx5 message
* generalized nav5 message
* remove unguarded debug
* change ubx version detection, baud rate negotiation fix and save found baud
* revert indentation
* revert indentation and refactorings
* the new code works with faster baud rate changes
* remove unguarded debug statement
* fix cli commands, major space reduce finished, removed extensions for now
* ubx version checks, add valset for M10
* beta of valset, change suggestions from ledvinap and macgivergim
* valset helper function and combine set nav rate valsets
* more valset refactoring
* remove big array and replace with macro
* remove assert, as it can stop bf completely
* refactoring to offsetof
* making reconnect more resilient, reorganize rate setup, so it doesnt get missed on init
* improved lost communcation detection, dont rely on ACK/NACK anymore
* paket rate debug
* adding debug mode, fixing major flight mode bug
* revert fake flight "isConfiguratorConnected"
* fixed proto detection, fixed reconfigure on too low updaterate
* valset doesnt always send ACK, so we dont wait for it
* size optimization, debug mode rename, minor fixes
* implemented some requested changes
* changed wait delay millisecond based
* fixes from ctzsnooze and zzXyz
* timer fixes
* CamelCase new settings names
* indent
* Fix failure to enter flight model on GPS Fix
* remove old commented out debugs
* simplify timeouts
* Clarify skip_acc and remove development valset code
* accept PL's advice to remove >> (8 * 0
* Simplify package counter, remove reconfiguration based on packet count
* fix error in package count introduced in previous commit
* Fix delay detecting Configurator, ANA disable (for another PR)
* address payload comments and fix logical error
* indentation edits
* delete old enum
* log gps and firmware nav interval times
* fix payload size, inc Rx buffer to 256, ifDef for sw_proto
* remove token parsing (Petr suggestions)
* fixes from reviews
* Basic NMEA improvements
* Address comments from karate
* only check platform version - thanks zzyzx
* Fix for too many sats problem - thanks zzyzx
* tidy up comments, ifdef some ublox definitions
* Use Nav packet intervals, NMEA and UBX, for time delta
* Resolve comments and flatten conditionals
* editorial change
* single function for gpsSol.navIntervalMs
* adam-ah suggestion for payload optimisation
* ACK/NAK & polled message timer fixes
* Revert timer fixes - unexpected side effects
* Revert adam-ah suggestion for payload optimisation"
This reverts commit 42fc8c04fdbc436c9ef196b88f0764ffcbb9239f.
Broke the display of sat info when more than 32 sats in view
* implement a number of comments
* Fast task rate on new data, don't spam at the start
thanks adam-ah
* include PDOP for M10 via NAV-PVT
* Address some of PL's recent comments
* don't recalculate millis so many times
* tidy up baudrate connect code
* Split receiving of GPS bytes from processing by adding GPS_STATE_PROCESS_DATA
* Split receiving of GPS bytes from processing by adding GPS_STATE_PROCESS_DATA
* Preserve state whilst processing packets
* Set gpsData.state directly as gpsSetState() clobbers gpsData.state_position
* Restore original read time check
* Schedule gpsUpdate() to run immediately again when a packet is received for processing
* add debugs to display scheduler valuesl
* simpler scheduler solution
* minor debug change
* FIxes: M10 connection, pDop, NMEA disable; thanks zzyxz
NB: Breaks unit's neat reconnection methods
M8 need a lot of settling time before using the serial port
* ubx parse length sanity + cleanup + dashboard conditional compiles
* Address recent comments from PL
---------
Co-authored-by: ctzsnooze <chris.thompson@sydney.edu.au>
Co-authored-by: ZzyzxTek <zzyzx@zzyzxtek.com>
Co-authored-by: Steve Evans <Steve@SCEvans.com>
* Add gps lap timer
* change timing to GPS time instead of local time
* rebase and minor changes
* implement KarateBrot's suggestions
* follow ledvinap's suggestions, some OSD symbol changes
* move platform.h include to the top
Co-authored-by: Jan Post <Rm2k-Freak@web.de>
* fix osd elements not showing, remove useless block
* cleanup, move pg stuff to pg folder
* cleanup from review
* minor mods to gps lap timer update, add number of laps tracked
* rename time variable
* add const to timeMs
Co-authored-by: Jan Post <Rm2k-Freak@web.de>
* Update licenses, add is_sys_element macro
* update licenses
* round to nearest centisecond
Co-authored-by: Jan Post <Rm2k-Freak@web.de>
---------
Co-authored-by: Jan Post <Rm2k-Freak@web.de>
* Add GPS status line to cli status output: connected status, UART + serial port baud + configured baud, configured status.
* Fixed unit test link fail.
* Really fixed unit test link fail (I hope).
* Really fixed unit test link fail (no really this time).
* Updated to address code reviews.
* Updated to address code reviews.
* Updated to address code reviews.
* Modification to allow src/config to be a repo within a repo.
* Moving config files to own repository, and including using make.
* Removing all old config files.
* Correct CI errors.
* Playing with pulling the configuration files from the API
* Attempt to get past github actions issue
* Adding additional assistance when configs not hydrated
* Move the workflow to support hydration before outputing target list.
* Correction for revision targets
* Requires additional config hydration
* Better messaging on what to do:
- when you have a local config.h for a new target, ignore hydration of target list if you are building the target config in question.
- when you are doing any activity that does not require hydration, e.g. printing out help or installing arm_sdk etc.
* Anything suffixed with clean should be allowed through
* Adjusting to simply use a copy of the repository. Noting we will need to decide whether or not to include MFTR name in the config directory or not.
* Refactor Feedforward Angle and RC Smoothing
* update rc_smoothing at regular intervals
* add Earth Ref to OSD, update pid and rate PG
* Initialise filters correctly
* refactoring to improve performance
* Save 24 cycles in Horizon calculations, other optimisations
At a cost of 40 bytes
* save 25 cycles and 330 bytes in rc_smoothing
* feedforward max rate improvements
* typo fix
* Karatebrot's review suggestions part one
* Karatebrot's excellent suggestions part 2
* more efficient if we calculate inverse at init time
Co-Authored-By: Jan Post <post@stud.tu-darmstadt.de>
* Horizon delay, to ease it in when returning sticks to centre
* fix unit tests after horizon changes
Co-Authored-By: 4712 <4712@users.noreply.github.com>
* horizon_delay_ms, default 500
* fix unit test for feedforward from setpointDelta
* Final optimisations - thanks @Karatebrot for your advice
* increase horizon level strength default to 75 now we have the delay
* restore Makefile value which allowed local make test on mac
---------
Co-authored-by: Jan Post <post@stud.tu-darmstadt.de>
Co-authored-by: 4712 <4712@users.noreply.github.com>
* STM32H730/STM32H750 - Fix use of USE_LP_UART1 instead of USE_LPUART1.
* STM32H723 - Prepare for being able to build for using non-internal-flash
config storage.
* STM32H723 - Prepare for using non-default strings.
* STM32H723 - Disable 'use custom defaults' when using USE_EXST.
* STM32H723 - Disable CUSTOM_DEFAULTS_EXTENDED when EXST is used.
* OCTOSPI - Add initialisation code.
* Add support for RAM_CODE.
* STM32H730 - Add support for RAM_CODE via the .ram_code attribute.
* OCTOSPI - Proof-of-concept for disabling/enabling memory mapped mode on
a running system.
NOTE: The HAL libs are compiled into a memory mapped region, and this cannot be used for OctoSPI access when memory mapped mode is disabled.
* OCTOSPI - Drop HAL support after determining that it's not suitable for
the memory mapped flash use-case.
* OCTOSPI - Sometimes, when disabling memory map mode, the abort fails.
Handle this by disabling the OSPI peripheral first and re-enabling it
afterwards.
* SD/FLASH - Update comments regarding possible solutions to the catch-22
issue with SD/SPI/QUADSPI/OCTOSPI pin configurations.
* OCTOSPI - Use device instance directly.
* OCTOSPI - Prepare W25Q flash driver for octospi support.
* OCTOSPI - Add octospi flash detection.
Note: The method to detect flash chips is similar to the method used for
QUADSPI and as such the code was used as a base. However the initial
OCTOSPI implementation doesn't support the non-memory-mapped use-case so
the un-tested code is gated with `USE_OCTOSPI_EXPERIMENTAL`.
The key differences are:
* uses octospi api not quadspi api.
* flash chip clock speeds should not be changed for memory-mapped flash
chips, bootloader already set it correctly.
* only certain flash chips are capable of memory mapped support.
* W25Q - Ensure w25q128fv_readRegister returns 0 if the receive fails.
* OCTOSPI - Implement octoSpiTransmit1LINE, octoSpiReceive1LINE and
octoSpiReceive4LINES.
* OCTOSPI - Specify device from init.
* OCTOSPI - More fixes and work on init.
Current status is that memory mapped mode is disabled and flash chip is
detected, but w25q128fv_detect should not be calling w25q128fv_reset.
* FLASH - Add comment regarding wasted flash space on targets that only
use one bus type for the flash chip.
* FLASH - Split `detect` into `identify` and `configure`.
* OCTOSPI - Extract flashMemoryMappedModeEnable/Disable to separate
methods.
* FLASH - Reduce size of targets that don't support the use of multiple
flash interfaces.
* Single-flash-chip targets usually only support one type of io
interface.
* Without this, compiler warnings are generated in `flashSpiInit` for
targets that only use flash chip drivers that support quadspi or octospi
that don't even use SPI for flash.
* FLASH - Use MMFLASH_CODE/DATA to conditionally move code/data to RAM.
Only targets compiled to support memory mapped flash chips need the some
specific code in RAM. Otherwise the code/data should be in the normal
linker section.
* FLASH - W25Q Prepare for memory mapped flash usage.
* Wait/Delay functions must work with interrupts disabled.
* Code used for reading/writing must run from RAM.
* OCTOSPI - Implement remaining required methods.
* OCTOSPI - Fixes for earlier code (not last commit).
* FLASH - W25Q update timeout values from Datasheet Rev L.
* FLASH - Prepare flash driver for use when memory mapped flash is
disabled.
* System - Prepare microsISR for use when memory mapped flash is disabled.
* FLASH - Add support for CONFIG_IN_MEMORY_MAPPED_FLASH.
* Flash - Fix incorrect gating on cli flash commands.
When compiling with USE_FLASH_CHIP and without USE_FLASHFS there were
compiler warnings.
* MMFLASH - Fix release-mode build.
* FLASH - Allow SPI pins to be reconfigured when using CONFIG_IN_MEMORY_MAPPED_FLASH.
MMFLASH only works via QuadSPI/OctoSPI peripherals.
* EXST - Disable the 2GB workaround which is now causing a different
error.
The error we get with 'remove-section' enabled is:
"error in private header data: sorry, cannot handle this file". The
cause of this new error in the objcopy codebase is an out of memory
condition, somehow the 2GB files and this error are related but the root
cause of both is still unknown.
* OCTOSPI - Add support for STM32H723.
* STM32H723 - Add linker scripts for EXST usage.
* NucleoH723ZG - Add build script to demonstrate OCTOSPI and Memory Mapped
flash support.
* FLASH - WUse the size in bits to set the size of the buffer.
* FLASH - Fix typo in W25N driver defines.
Was using W28N instead of W25N
* OCTOSPI - Fix missing semilcolon when compiling without
USE_FLASH_MEMORY_MAPPED.
* OCTPSPI - Fix missing call to 'memoryMappedModeInit'.
* SPRacingH7RF - Add example build script to allow for testing prior to
unified target / cloud-build support.
* AT32F435: new target (#12159)
* AT32F435: New target (WIP)
* IO and Timer Updates
* Adding pseudonyms for the STM TypeDef items.
- implementation to follow
* Adding config_streamer support for AT32
* Implementation for IO
* Adding in Peripheral mapping from emsr.
* Warnings cleanup for AT drivers
* Getting things to the linking stage
* Add AT-START-F435 LEDs as default in AT32F435 as a temporary measure to aid bringup
* Remove tabs
* Enable selection of serial port to use for MSP
* Setup defaults for AT-START-F435 to use MSP on UART1
* Fix for most recent 4.5.0 Makefile changes
* Solve for sanity check.
* Add AT32F435 MCU type
* Fix compilation issue with SITL
* Merge conflict resolution
* Minor cleanup
* Adding line feed.
---------
Co-authored-by: Steve Evans <Steve@SCEvans.com>
* Missing define to activate TABLE_VIDEO_SYSTEM
* USE_PWM should only be for RX (parallell RX inputs), USE_PWM_OUTPUT is for all others.
* Updated gate naming so there is less confusion
* Simplified. Note there maybe further occurences.
* Flash - Fix incorrect gating on cli flash commands.
When compiling with USE_FLASH_CHIP and without USE_FLASHFS there were
compiler warnings.
* Fix typo in `flash_info` cli command output.
- Including ability to define custom defaults as char[] that is baked into the build
- removed unnecessary size of custom defaults header parsing (defines provided by build process or in board.h for devs).
- add the 'MSP2_GET_TEXT' and 'MSP2_SET_TEXT' MSP2 commands
- Support getting/setting the 'MSP2TEXT_PILOT_DISPLAY_NAME' config prop ('pilotConfigMutable()->displayName')
- rename 'display_name' to 'pilot_name'
- Add the new 'OSD_PILOT_NAME' OSD element in place of the
'OSD_DISPLAY_NAME' one (as they are semantically identical)
- Add the 'osd_pilot_name_pos' cli prop in place of 'osd_display_name_pos'
- rename 'pilotConfigMutable()'s 'name' to 'craftName'
- remove the legacy 'GET_NAME' / 'SET_NAME' MSP commands
- replace the 'name' CLI prop for 'craft_name'
- add the 'MSP2TEXT_CRAFT_NAME' constant for 'MSP2_GET_TEXT' and 'MSP2_SET_TEXT'
Fixed some review findings
Unified dshot average rpm calculations into one single function
Renamed calcEscRpm to erpmToRpm, and moved function to dshot.c
Removed unused esc_sensor.h header file from dshot.c
Removed esc_sensor.h header from modules that no longer needs it
Average RPM calculated by demmand only when rpm data is updated
Renamed rpm to averageRpm and fixed a bug
Update average rpm when telemetry data is received
Removed blank line
Fixed review findings
Fixed return values for erpmToRpm and getDshotAverageRpm so rpm value doesn't truncate
Restored osd_esc_rmp_alarm setting. This setting is used to set an alarm to notify when rpm goes down a specified threshold. Rpm can go over 109krpm (1s 26kv motors setup), but a low rpm alarm doesn't have to be set to a so high value so at this time [0-32767] seems an acceptable range
Rebased to master
Extended DSHOT telemetry
Fixed broken unit testing
Rebased to master
Extended DSHOT telemetry
Added DSHOT ESC fail to OSD warnings
Initial extended DSHOT implementation
DSHOT telemetry ranges readjusted
Added shot_telemetry_data to cli
Added DSHOT telemetry warnings
Added extended DSHOT telemetry temperature data to osd elements
Fixed DSHOT telemetry osd warnings
Make cli dshot telemetry types human readable
Fixed ESC temperature OSD element
Added extended dshot telemetry enable command to dshot command queue to enable it in tryArm function.
Fixed broken automated unit testing
Fixed text output for dshot_telemetry_data cli command
Decode extended telemetry only when it has been activated in the ESC
DSHOT extended telemetry is only enabled when an extended telemetry enable frame is being processed
Fixed broken automated unit testing
Update tail's dshot command in queue when running blocking commands, so extended dshot telemetry command responses can be associated to their corresponding extended dshot telemetry enable/disable command request
Added clariffication to dshot_get_telemetry_type_to_decode to explain mechanish used for processing DSHOT_CMD_EXTENDED_TELEMETRY_ENABLE response
Tabs cleanup
Added dshot motor stop fix when writting blocking commands
Added extended DSHOT telemetry to osd warnings
Fixed extended DSHOT telemetry in osd elements
Implemented msp extended dshot telemetry
Optimized osd warnings
Fixed code style
Added max temp to osd stats
Fixed automated unit testing
Fixed broken automated unit testing
Fixed missing extended dshot telemetry voltage and wrong current
Fixed unadverted change in gitignore file
Print esc number besides max esc tempetature in osd stats
issues and some other minor issues
ESC temperature is coded as an uint8 going from 0 to 255. Updated osd config esc_temp_alarm from int8_t to uint8_t to match esc temperature coding
issues and some other minor issues
Enable extended dshot telemetry when no esc sensors avaliable and dshot telemetry is enabled
Arranged dshot.h header and removed unnecessary headers from dshot.c
Updated dshot_telemetry_data cli command output
Fixed dshot_telemetry_data command
motor_output_unittest fixed
Fixed motor number printing in dshot_telemetry_data cli command
fixed motor_output_unittest
Merged dshot_telemetry_data into dshot_telemetry_info cli command
Fixed tabs
Fixed motor_output_unittest
Support extended DSHOT telemetry on DJI FPV
Fixed Compiling fails without USE_ESC_SENSOR and USE_DSHOT_TELEMETRY defines.
Fixed whencompiling without USE_ESC_SENSOR and USE_DSHOT_TELEMETRY
Reworked so code can be compiled with USE_ESC_SENSOR and USE_DSHOT_TELEMETRY separately
Enabling EDT the correct way
Removed unecessary conversions
Changed motorIndex datatype to uint8_t in dshot functions
The H730 is a value-line CPU, similar to the H723/H725, but with only
128kb RAM.
The FC firmware code is designed to RUN from external flash in MEMORY
MAPPED mode, via OctoSPI. Use of ITCM/DTCM advised for core loops, like
PID control.
A bootloader is required to enable memory-mapped mode and jump to the
firmware, similar to how EXST bootloader system works.
Config storage is not part of this commit and is a problem when using a
single flash chip in memory mapped mode because the CPU can't run
read/write routines from the flash chip while writing to the flash chip.
Until flash read/write routines are updated the solution requires either
a second flash chip on an SPI interface, or the use of an SD card for
config storage.
Additional commits will support read/write of config to the code/data
storage flash chip to enable cheap and space efficient single-flash-chip
FC solutions.
Squashed commits:
STM32H730 - Workaround issue with 2GB `.elf` files being created.
STM32H730 - Reduce firmware size to 1MB.
STM32H730 - Add USB HS configuration.
STM32H730 - Add ADC internal tag mappings.
STM32H730 - Update all ADC mappings based on the referenced ST
documentation. Add the VBAT channels.
STM32H730 - Fix DMA continuous requests.
STM32H730 - Fix ADC_INTERNAL confusion.
STM32H730/G4 - Disambiguate use of ADC_CHANNEL_INTERNAL_FIRST_ID.
STM32H730 - Fix documentation reference.
STM32H730 - Add DMA request mapping for ADC3.
STM32H730 - Explicitly set the ADC clock.
STM32H730 - Configure PLL2 speeds correctly.
* Tested with Ultrafast 64GB SanDisk SDXC card.
STM32H730 - Use 50Mhz clock for SDXC cards.
* Tested with SanDisk Ultra 64GB. 100Mhz clock gave CRC errors.
STM32H730 - Ensure USB has a lower NVIC priority than the SDMMC card
reads.
If it's higher, 0, then the SDMMC's DMA IRQ handler doesn't get called
when handing USB MSC storage reads.
STM32H730 - Support CPU name in CLI.
STM32H730 - Rebuild when linker scripts changes.