Commit Graph

94 Commits

Author SHA1 Message Date
Lucjan Bryndza
9fba3f1ecf [EGD-7727] Fix userrealloc to ANSI standard capable
Fix userrealloc() function to the ANSI to comply
ANSI C standard

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-11-24 06:01:40 +01:00
Lucjan Bryndza
e9177f23aa [EGD-7996] Prevent crashdump recursion from ISR
Calling abort() or exit() from the interrupt context
causes that the phone enters into bootloop, because
in the exception mode ISR cannot be used.
We are add guards for prevent clean system shudown
when abort is called from the ISR context.

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-11-23 14:10:01 +01:00
Alek Rudnik
65d67e2690 [EGD-7948] Extend log dumping
Log are now dumped:
* on system shutdown including hard faults and aborts
* every 5 minutes

Fixed some logs
2021-11-16 17:56:28 +01:00
Lucjan Bryndza
47a1183165 [EGD-7976] Umount all filesystems on failure
Umount all mounted filesystems in case of fault like
Hardfault, abort, uncautched exception.

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-11-16 15:57:36 +01:00
Lucjan Bryndza
22cf942253 [CP-670] Fix save crash dump
Fix saving crash dump and add create crash dump
when exit function is called.
Also crashdumps size is slighthy reduced
because for backtrace we don't need to grab
the text section and heap section.

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-11-16 13:24:10 +01:00
Alek Rudnik
5418f9b5e7 [EGD-7423] Fix for _exit() not included in binary
Looks like recent cmake changes introduced this issue.
For some reason overwritten _exit() function was not included in
binary
2021-11-05 13:37:00 +01:00
Kuba
1ab84f774f [EGD-7720] Unmounting file system on system closure
Make sure file system is properly unmounted on gentle system
shut down.
2021-10-20 14:38:08 +02:00
Marcin Smoczyński
bd90e57516 [BH-907] Split utils module into components
Split module-utils into smaller components for better dependency
management. Fix many dependencies throughout the project.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-09-23 15:14:40 +02:00
Marcin Smoczyński
e0fae087a6 [BH-908] Fix macros header location
Remove duplicated header for linux; move header for rt1051 to the same
tree as for linux.
_exit.c uses os so it should be placed in the os.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-09-22 10:26:32 +02:00
Adam Dobrowolski
3e57a07b43 [EGD-7495] Fixed log use on Linux to be the same as on Rt1051
- Log headers were incomplete
- Log filtering was broken on linux
2021-09-06 09:12:21 +02:00
Marcin Smoczyński
b355d5ce00 [BH-733] Cleanup target dependencies
Remove obsolete target dependencies across modules.
Remove 'cross' and 'unittests' targets.
Refactor some remaining target dependencies to use board include macro.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-08-13 01:43:56 +02:00
Marek Niepieklo
6c32205e1b [CP-371] Updater miscelanous developer mode and logs changes
This reverts commit cb93d58d85.
2021-07-27 17:03:28 +02:00
Adam Dobrowolski
cb93d58d85 [CP-371] Updater miscelanous developer mode and logs changes
Changed:
- Runtime disabled logs which didn't add value from ServiceDesktop
- Runtime disabled logs which didn't add value from SystemManager
- Added possibility to change runtime logging levels
- Integrated ServiceDesktop developer code a bit - it might be used
  as virtual base with little to no modifications for other endpoints
  which would result with less redundant code
2021-07-27 13:56:37 +02:00
Mateusz Grzegorzek
8521193df8 [BH-362] Move segger to a separate directory
Move segger to a separate directory
2021-07-12 15:19:40 +02:00
Radoslaw Wicik
943fef9643 [BH-353] Add Documentation for main targets
* clean up mimimu required cmake version
* fixes for release workflow

Add documentation for targets, fixes for cmake
and release workflow.
2021-06-11 09:07:41 +02:00
Lukasz Skrzypczak
2911b6b4a1 [BH-378] PR changes
PR changes - mainly includes
2021-06-08 12:24:29 +02:00
Lukasz Skrzypczak
7fee0d9cfb [BH-378] Utils move log to library
Moved log to separate library
2021-06-08 12:24:29 +02:00
Maciej Gibowicz
77e37561cd [EGD-6769] Preventing use of allocators in interrupts
Abort when trying to use an allocator in an interrupt.
This prevents the heap from being overwritten.
2021-05-19 09:34:08 +02:00
Adam Dobrowolski
b38adceced [EGD-6019] Minimum settings ownership lifetime fixups
added weakptr link to settings and checks
    it wont crash on deinitialized setings now
Pseuto UT are passing
Added:
    - deregistration on Settings destrution
    - weak referencing of Service to not crash Settings on missuse
    - Proxy as initialization parameter to Settings
Unused code removed
Enabled tests to be written for Settings
Removed dependency from freertos in test global file
EntryPath tests updated and compilation slimed
2021-05-18 13:25:54 +02:00
Marek Niepieklo
55de4a64a0 [EGD-6603] Add and enable catching of OOM failures
Catch Out-Of-Memory and stack overflow in OS hooks
2021-04-27 10:33:58 +02:00
Maciej Gibowicz
2b313398f0 [EGD-6344] Fix SystemView compilation
Add necessary FreeRTOS configurations to run SystemView
2021-04-22 09:51:14 +02:00
Mateusz Grzegorzek
a60e27fa4b [EGD-4593] Dump logs to file on timeout
- Dump logs to file every 10 sec.
- max file size is 50 MB
  (after reaching it, no more logs will be logged),
- Add `LockGuard` with locking mechanism
  supporting IRQ and use it in `Logger`.
- Fix minor style issues in `Logger`.
- Add `mount_user_lfs_partition.py` script for mounting LFS on Linux FS
  in order to get `MuditaOS.log` file from `user` partition
2021-03-17 16:33:02 +01:00
Marcin Smoczyński
bd92e3759a [EGD-6065] Increase system heap size
Increase system heap size by 64 kB to fight with heap shortage.
2021-03-08 11:37:54 +01:00
Marcin Smoczyński
7c65f04452 [EGD-5893] Disable optimization for os
Disable FreeRTOS optimization for RelWithDebInfo configuration in order
to be able to analyze system memory (heap and tasks' stacks).

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-02-25 15:35:36 +01:00
Wiktor S. Ovalle Correa
3b141041e9 [EGD-5737] Merge master into experimental
Keep experimental up to date with changes from master
2021-02-17 17:09:37 +01:00
Hubert Chrzaniuk
bb92b333da [EGD-5355] Fix emulator crash
lIndexOfLastAddedTask is shared between two separate functions
that should run consecutively but in some cases the thread
running can be yield in between which results in broken thread
stack.

This change reduces the risk but it does not entirely solve
the problem. It is still possible for the threads to return in
different order. Nevertheless the tests did not confirm that.
2021-02-17 17:06:59 +01:00
Lucjan Bryndza
dcc72e0bec [EGD-5332] Fix heap size and other merge fixes
After merge with master we are unable to run any application
It was caused by the insufficent heap size
2021-02-17 17:06:49 +01:00
Artur Śleszyński
8bbb57776a [EGD-4115] Implement FreeRTOS configASSERT macro
The configASSERT() macro was modified to use assert instead of
an infinite loop.
2021-02-08 10:40:46 +01:00
Alek Rudnik
f08ad0a038 [EGD-5620] Increase configTOTAL_HEAP_SIZE for linux
configTOTAL_HEAP_SIZE was set too small for linux build
2021-02-05 12:12:23 +01:00
Piotr Tański
3f29c30bed [EGD-4968] Change GUI service to optimize flow and memory management
Gui and Eink services refactor.
Displaying frames performance optimization.
Critical resources management.
2021-01-08 16:36:12 +01:00
Marcin Smoczyński
871b250d86 [EGD-4534] Change audio data path synchronization
Refactor audio data path to fix several synchronization issues and
excessive copy operations on large memory blocks. Introduce
audio::Stream data structure to allow connecting audio source and sink
with a zero-copy capability.

Introduce system mechanisms:
 - critical section guard lock needed for stream synchronization
 - non-cacheable memory allocator to allocate memory for DMA safe
   buffers

Update the Googletest CMake template to match the capabilities of the
Catch2 template.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
Signed-off-by: Hubert Chrzaniuk <hubert.chrzaniuk@mudita.com>
2020-12-17 12:20:40 +01:00
Piotr Tanski
5c57dff00e [EGD-4713] Add task control block into a heap allocated memory block for debug purposes. (#1143) 2020-12-14 11:44:56 +01:00
Maciej Gibowicz
9c9e921ab4 [EGD-4693] PowerManagement: CPU load measurement (#1156)
Add FreeRTOS idle tasks Run Time Statistics

This will allow to measure the CPU load
2020-12-10 17:27:54 +01:00
Maciej Gibowicz
fb22548963 [EGD-4723] PowerManagement: Enable FreeRTOS Run Time Statistics (#1147)
Add FreeRTOS Run Time Statistics for measuring CPU load
2020-12-08 10:58:36 +01:00
Lucjan Bryndza
e5199a3764 [EGD-4261] stdlib file access syscalls for RT1051 platform (#952)
* [EGD-4261] Initial version of syscalls

* [EGD-4261]  CR small fixes

* [EGD-4261] Rename namespace and fsync call

Rename namespace vfs::internal for clarify that syscall functions are for internal use only

* [EGD-4261] Handle manager for stdlib

Handle manager layer for STDIO compatibility.

* [EGD-4261] Initial version of sysscall (old vfs)

* [EGD-4261] Direntry syscalls completed

* [EGD-4261] Fixes in handle manager

* [EGD-4261] Add support for std::filesystem.

libstdc++ from compiler is compiled without <dirent.h>
, so std::directory_iterator doesn't work.
Our implementation fix this issue and override
libstdc++ library code

* [EGD-4261] Compile syscalls only on RT1051 target

* [EGD-4261] RT compile fix

* [EGD-4261] Code review small fixes

* [EGD-4261] Code review fixes

* [EGD-4261] Remove redundant noisy debug log msg.

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-11-06 09:45:15 +01:00
Adam
f5f27d642f EGD-2955 EGD-3588 Timers fully refactored & updated (#721)
* Timers now are Application thread safe
* Timers now have consistent API independend of Application (no more c style timers)
* Timers can have either: callback or override onTimer() method - this
  way we can create more complicated timers or just use existing ones
* gui::Timer added via adapter class GuiTimer to decouple sys::Timer
  with gui::Timer
* Fixed race in wrapper
* Updated docs
* fixed using std and cpp_freertos and DataReceivedHandler hidden in Application.hpp
2020-10-02 14:04:57 +02:00
Tomas Rogala
78904a6b5d [EGD-3307] Review changes 2020-08-13 21:07:42 +02:00
Tomas Rogala
97fdb2cdcd [EGD-3307] Calendar DB interface update
Implement adding record to db
Implement Removing elements from DB functionality
Implement Update element in DB functionality
Implement Get elements by date time period
Add time zone field
2020-08-13 21:07:42 +02:00
Bartek Cichocki
39d24d1420 [EGD-3379] fixed build flags, suppressed warnings for protobuf, sbini and port.c in module-os 2020-07-08 14:09:42 +02:00
Marcin Smoczyński
b6ad543f2c build: remove configure warning for module-os
There are no tests in module-os, no reason for this warning.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2020-06-26 16:12:21 +02:00
Marcin Smoczyński
1a498ce90d os: fix heap's taken list corruption 2020-06-01 23:16:57 +02:00
Radoslaw Wicik
733a7c8d6b [EGD-3230] Increase Total HEAP_SIZE so Linux implementatio of CelularService fit memory 2020-05-26 11:46:49 +02:00
Marcin Smoczyński
50723f4f5e os: remove -Wno-error flag 2020-05-22 16:15:15 +02:00
Marcin Smoczyński
588084fb4e os: add system heap integrity check fields
Add fields to system heap which are needed to do an integrity check
and harvest some additional usage stats. Add only for Debug build type.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2020-05-14 13:27:13 +02:00
Marcin Smoczyński
86bdeb347d [EGD-3113] Add thread safety to libphonenumber
Add thread safety based on the RTOS wrapper and FreeRTOS mutex. The
mutex protects regexp cache only so additional safety on regexp level is
needed.

Add method to get currently running thread - needed by thread checker
class in libphonenumber.
2020-04-28 17:01:33 +02:00
Radoslaw Wicik
096a6e6f75 Resolve Linux port compile warning about redefinition of _GNU_SOURCE 2020-04-22 16:02:54 +02:00
Adam Dobrowolski
42ccb924cf EGD-3055 FreeRTOS asssert fixed, added force printf check on logging macros in log.h 2020-04-08 12:23:53 +02:00
pholat
91e05fcf65 fix gtk & FileAttributes 2020-03-25 15:28:52 +01:00
Przemyslaw Brudny
c0822b6658 [EDG-3019] Moved log.hpp and debug.hpp into main PurePhone repo 2020-03-24 15:55:32 +01:00
Przemyslaw Brudny
8f92715951 [EDG-3019] Segger utils moved to git submodule 2020-03-23 18:37:37 +01:00