Commit Graph

39 Commits

Author SHA1 Message Date
Daniel Agar 986cf288da dataman: remove obsolete persistence and reset reason 2021-12-12 12:06:35 -05:00
Daniel Agar fd1fff89d4 dataman: remove flash backend 2021-02-26 00:28:48 +01:00
Silvan Fuhrer 99dd229d71 Rally Point: fix typo of save to safe in mission_safe_point_s
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2019-10-28 09:54:59 +01:00
Daniel Agar 8185334994 navigation.h handle mission item structure padding explicitly
- also applies to mission_stats_entry_s, mission_fence_point_s,
   mission_save_point_s
 - -Wpadded warning is disabled by default because the snapdragon
   toolchain doesn't respect the pragma pop
2019-02-13 08:08:01 +01:00
Daniel Agar 916d6a15fd Mission merge offboard + onboard and simplify 2018-01-14 12:53:53 +01:00
Beat Küng 72501df88e dataman: add dm_trylock & add lock for FENCE_POINTS items 2017-08-04 18:08:51 +02:00
Beat Küng c4cdaa48e0 dataman, mission_feasibility_checker: remove unneeded uorb includes 2017-08-04 18:08:51 +02:00
Beat Küng b9cddfb75b dataman: account for new geofence & rally point structs 2017-08-04 18:08:51 +02:00
Beat Küng 52ca49c682 geofence: remove fence & fence_vertex messages
- this was never read
- it was implemented wrong, leading to memory access violations in
  publishFence (an integer was passed instead of the fence_s struct)
2017-08-04 18:08:51 +02:00
Beat Küng 28e5268497 dataman: rename to .cpp & add module documentation 2017-07-14 11:57:11 +02:00
José Roberto de Souza 10f54e718e modules: dataman: Optimize memory usage
Use the size of each item type instead of the biggest one.

In AeroFC that runs is constrained mode it was using 7860 bytes
and now it uses 6930 bytes almost 1KB less.
2017-07-13 15:21:26 +02:00
José Roberto de Souza e2aae04c95 modules: dataman: Add a ram_flash backend
This backend will keep all updated data in RAM and
persist the data between reboots using flash memory.

Using only flash memory would result in a slow backend that
would decrease the lifetime of the flash memory, using both
we can reduce the several cycles of erase & write into flash
and keep the performance of the backend almost as fast
as the RAM only backend.

Note: Do not use this backend on a sector from the same flash memory
bank as the memory bank that STM32 read instructions or it can block
the CPU from fetching instructions from flash during the erase and
write operations and cause your drone crash.
2017-03-10 11:31:07 +01:00
Julian Oes 8c1e85a65f dataman: don't wrap around at 256
The dataman started overwriting contents after 256 items because the
item index were only uint8_t. This fix allows for more than 256
waypoints.
2017-02-15 22:29:24 -05:00
Lorenz Meier 5ddd69c872 Dataman: Make versioning define more explicit 2016-10-23 16:26:03 +02:00
Lorenz Meier c7cdef2a4b Clarify version flag for dataman 2016-10-23 16:26:03 +02:00
Lorenz Meier 9e7d5f088e dataman: Ensure compat field is set and read correctly 2016-10-23 16:26:03 +02:00
Lorenz Meier ff0d7613b1 Add manual seed to dataman hash to allow later incrementing the seed number for incompatible changes 2016-10-23 16:26:03 +02:00
Lorenz Meier db774798fa Dataman: Store sizes of all containers and reset file if any of them changes. 2016-10-23 16:26:03 +02:00
Lorenz Meier c2285c84a9 Dataman: Do nnot pack structs to avoid reading back wrong values on existing systems 2016-10-18 00:26:40 +02:00
David Sidrane ecbe8c2179 Packed union to save more space 2016-10-18 00:23:58 +02:00
David Sidrane b2bf9e15eb Use union of datatypes supported by dataman to reduce wasted space 2016-10-18 00:23:58 +02:00
David Sidrane 44b5b52bcb Add suport for Memory Constrained systems 2016-10-18 00:23:58 +02:00
Lorenz Meier b6c4501d0e Adjust data size of dataman to force reset of all existing user data 2015-12-02 09:15:37 +01:00
Lorenz Meier d18d43b0da dataman: fix code style 2015-09-05 22:16:38 +02:00
Lorenz Meier cb7a4f5799 dataman: Adjust to uORB mission changes 2015-08-20 11:07:53 +02:00
Lorenz Meier f5ce8e4826 Update dataman to reflect topic updates 2015-05-27 15:21:31 -07:00
Anton Babushkin 29bf1fe6fa dataman: added macro for offboard storage selection 2014-07-07 15:18:12 +02:00
Anton Babushkin 91b590ef58 Move MISSION_STATE read/write from mavlink to navigator and commander 2014-06-13 23:40:48 +02:00
Anton Babushkin 2951962c21 dataman: rename SYSTEM_STATE section to MISSION_STATE 2014-06-12 13:11:45 +02:00
Anton Babushkin 4ad435b483 dataman: allow writing empty items with nullptr pointer to data 2014-06-09 16:09:03 +02:00
Jean Cyr a6cf04a6ff Create system state entry in dataman - ATTN Anton
Create persistent system state id for data manager to store system state
that will persist across resets.
2014-06-08 14:08:22 -04:00
Lorenz Meier 19dc0b9509 dataman: Fix doxygen, no functional changes 2014-05-15 07:15:41 +02:00
Jean Cyr ab257ebcce Proper data manager restart handling
Introduce SYS_RESTART_TYPE parameter having one of 3 values: boot
restart, inflight restart, or unknown restart, and defaulting to unknown
restart.

px4io.cpp sets this parameter according to the type of restart detected.

dataman.c retrieves this parameter and clears data entries according to
their persistence level. Does nothing if unknown restart.
2014-04-28 00:52:19 -04:00
Jean Cyr bf4558c31b Reduce data manager SD card wear and tear
When the data manager was first designed each file record contained a 2
byte header and an 126 byte data section, resulting in a record length
of 128 bytes. Along the way it was decided to add 2 spare bytes to the
record header, but regrettably the data section was not correspondingly
reduced in size so we end up with a record length of 130 bytes. This is
bad since it does not align with SD card flash sectors and results in
more erase/write flash cycles than necessary thus reducing the SD cards
life.

This update reduced the data section of the data manager to 124,
resulting in an optimal record length of 128 bytes.

In order to avoid the reuse of data previously written data in the old
format, which could result in catastrophic misinterpretation, the data
manager file is checked at startup. If it is found to be in the old
format, it is deleted and recreated with in the new record length. In
this case previously stored data is lost, but that is far safer than the
unpredictable result of using the old file.
2014-04-22 01:19:01 -04:00
Julian Oes b10fa3d047 Waypoints/Navigator: Use two different dataman storage places, keep old waypoints until all new ones are written 2013-12-25 11:23:58 +01:00
Julian Oes 6a624abd7c Datamanager: Rename mavlink/offboard key 2013-12-16 17:13:17 +01:00
Julian Oes e8df08f139 Dataman: Also reserve space for onboard missions 2013-12-16 17:12:37 +01:00
Julian Oes e034f5135e Dataman: Some minor fixes 2013-12-03 16:25:46 +01:00
Jean Cyr 1cf9f72f62 Add data manager module and fence support to navigator
- Add function to geo.c to determine if global position is inside fence
- Add navigator support/commands for maintaining fence coords.
- Add data manager module to support persistence fence storage. Can
store other data, but only used for fence at this time.
- Add unit tests for data manager
2013-11-03 12:40:13 -05:00