Commit Graph

359 Commits

Author SHA1 Message Date
Lefucjusz
181feb4f40 cleanup 2024-08-20 15:40:34 +02:00
Lefucjusz
8a25c9e1d2 [BH-2001] Fix debug build with new FSL
* Fixed some issues that have been
caught by asserts in debug build.
* Minor cleanup.
2024-06-04 11:02:17 +02:00
Maciej Gibowicz
919288eef2 [BH-1950] Fix incorrect Power Management statistics in the logs
When the CPU is in WFI mode, the CPU usage statistics should only
reflect the WFI range and not the other frequency ranges.
2024-04-26 08:44:09 +02:00
rrandomsky
93eb6be683 [BH-1799] Refactor usage of unicasts to dispatch BatteryStatusChangeMessage
Unicast type of sending BatteryStatusChangeMessage is changed to multicast type.
Thanks to this, the flow of messages is more transparent
and there is no unnecessary transmission to non-existent services.
2024-03-12 11:31:45 +01:00
Dawid Wojtas
54bf8311b0 [BH-1770][BH-1677] Update fsl drivers
Now the system uses 2.14.0 version.
Add only necessary drivers:
- pit
- pmu
- rtwdog
- snvs_hp
- snvs_lp
- src
- trng
- wdog
- gpio
- gpt
- lpi2c
- lpuart
- lpuart_edma
- common
- common_arm
- dmamux
- edma
- flexram
- flexram_allocate
- clock
- cache
- CMSIS
- dcp
- iomuxc

Changed speed of the USDHC clock from ~109MHz to ~81MHz.
Also changed bus timing from kMMC_HighSpeedTiming to
kMMC_HighSpeed200Timing for better efficiency.
2024-02-21 18:58:12 +01:00
Lefucjusz
1d51c5c4bc [BH-1833] Enable RTWDOG in WFI mode
* Fixed initial RTWDOG config procedure, which
put watchdog module in some non-deterministic
state due to not waiting after unlock request
and config change, what prevented the watchdog
to be reconfigured later in the OS.
* Configured RTWDOG to continue running in
WFI to prevent potential freezes caused by
CPU not being woken up by periodic RTC
interrupt.
2024-01-23 13:18:19 +01:00
Lefucjusz
32c6769cb6 [BH-1657][BH-1833][BH-1854] Add WFI and SDRAM self-refresh mode
* Added mechanism enabling CPU to
enter WFI mode when the OS is
in idle, what results in large
power consumption reduction.
* Added mechanism to switch SDRAM to
self-refresh mode before entering
WFI, what resulted in further power
consumption reduction.
2024-01-22 12:32:35 +01:00
Mateusz Szczesny
6e76dc3e5f [BH-1787] Reboot to MSC endpoint
To allow the automation of gathering logs and swapping out OS images during tests a MSC reboot
endpoint was added. Together with a change to ecoboot, this allows the sending of a "reboot to
MSC" command. The deivce will then reboot and enter MSC mode.
2023-12-04 12:41:37 +01:00
Maciej Gibowicz
920db59b2e [BH-1791] Add CPU frequency lock during log dump
This will improve security and peripheral stabilization when downloading
logs to a file.
2023-10-27 12:53:20 +02:00
Maciej Gibowicz
cbe1ed63e5 [BH-1801] Fix incorrect calculation of requested CPU frequency
Sometimes when the frequency is locked, e.g. at 132 MHz, the algorithm
still calculated a lower frequency, e.g. 66 MHz.
2023-10-27 12:23:12 +02:00
Lukasz Mastalerz
d9a1194e6f [BH-1688] Create a standard for logs
* Adding document describing how to use logger
* Adjusting logs to follow a new guide
* Change order in log header:
  line number is now before function name
2023-10-23 15:17:44 +02:00
Maciej Gibowicz
635ad1ac05 [BH-1774] Fix frequency lock during user activity
- Sentinel locks the frequency when pressing buttons and the encoder.
- The "user activity" sentinel will be properly managed by the system
(CpuGovernor) just like other sentinels.
- Adding information about active sentinels in the power management
statistics logs
2023-09-26 11:04:50 +02:00
Lefucjusz
3cbbeff551 [MOS-1011] Fix frequency switching stability
Multiple fixes of clock switching related
stability issues:
* added RC oscillator hysteresis as in NXP example;
* changed DCDC converter config;
* configure PLL2 to be able to run on any CPU
frequency level;
* added switching to 1.275V (overdrive) voltage
when applying any clock change above 12MHz as
well as LDO or bandgap switching, as done in
Mbed OS' lpm.c for RT1050;
* changed BMCR AXI queues weighs for SDRAM
in JLink scripts to disable operations
reordering, as it is known to cause data
integrity issues;
* extracted some code to separate files;
* smaller or bigger code cleanups.
2023-09-07 17:19:15 +02:00
Lukasz Mastalerz
9752788304 [BH-1412] Whitelist update
Whitelist removed for Harmony
Changed the way whitelist is obtained
Added missing logs for Eink Dispaly
2023-08-08 10:43:58 +02:00
Lukasz Mastalerz
462a7393d9 [BH-1412] Fix system shutdown procedure
Changed startup services order.
Prevent handling multiple "close ready" messages from one service while closing
system.
Introduced a new state in ServiceGUI.
Fixed a problem with turning on Harmony with a connected USB cable.
2023-08-08 09:35:54 +02:00
Lukasz Mastalerz
f7ad63c951 [BH-1412] Fix services dependencies
Changes in dependecy managment
Replacing state flags with states in ServiceGUI
Unifying some parts of code
2023-08-01 17:22:48 +02:00
Lukasz Mastalerz
4c661d4f2c [BH-1412] Improve system shutdown procedure
Changed default Worker join timeout to a more realistic value
 in case of system shutdown procedure.
2023-08-01 16:06:25 +02:00
rrandomsky
4b8543912a [MOS-30] Fix for Alarm not being handled properly during a phone call
During the phone call, the alarm was not displayed and subsequent alarms
after this scenario did not work. This has now been fixed and the alarm
during a phone call will be automatically snooze.
2023-07-12 10:46:44 +02:00
Maciej Gibowicz
8614428407 [BH-1722] Fix unswitchable alarm audio
Disabling the alarm by clicking "deep press" on the system shutdown
screen only visually deactivated the alarm
but the alarm sound continued to ring.
2023-06-26 11:26:26 +02:00
Lefucjusz
783ebcbb6c [MOS-183] Fix RT1051 debug build
Fix of multiple issues that resulted
in debug build failing.
2023-06-14 13:12:50 +02:00
Dawid Wojtas
8c2b5aa7b0 [BH-1624] Fix shutdown procedure
In some cases, the system wasn't able to turn off
because the GUI service got stuck. The device
was still working in the background. The cause
was an empty queue in DrawCommandQueue which
hang the GUI worker.

The interface was modified and synchronization
mechanism was removed.
The thread no longer waits in dequeue().

Also changed the worker to close in the right
way the logger worker.
2023-03-06 21:47:11 +01:00
Adam Wulkiewicz
0e7ae160e6 [BH-1639] Add welcome message with charging info
Add new bell welcome window
Add new close reasons
Add new actions
Bump assets version
Remove bold text from welcome message
Remove bold text from onboarding popups
2023-03-06 14:11:04 +01:00
Lefucjusz
9ece62c171 [MOS-903] Remove reboot to USB MSC mode
Remove mechanics enabling to perform reboot
to MSC mode by sending request to one of the
endpoints via serial port, as it is not
implemented in bootloader and may potentially
be unsafe.
2023-02-14 10:59:43 +01:00
Bartosz
8d1da66936 [MOS-237] Removed unnecessary workaround for system reboot
Removed workaround for rebooting into recovery (update)
2023-02-09 14:37:38 +01:00
Lefucjusz
d28fdb6594 [MOS-882] Fix FLAC file playback with USB cable connected
Fix of the issue that caused system crash when
trying to play 96kHz FLAC file with USB cable
connected. The reason of the issue was the lack
of FreeRTOS heap space left, what caused
pvPortMalloc() to fail when allocating
memory for stream buffer.

Additionally minor code cleanup.
2023-01-20 10:50:06 +01:00
Lefucjusz
82e0c6df09 [MOS-851] Remove factory reset screen from backup and restore
Fix of the issue that factory reset screen
informing user of need to manually turn
on the phone to continue the process
was appearing also when restarting to
backup or restore.
2023-01-19 16:41:56 +01:00
Bartosz
fef2ad61a8 [MOS-786] A/B Booting - fixed factory reset from menu
Now factory reset works both from ecoboot and from menu
2023-01-19 16:41:56 +01:00
Bartosz
01857dd1bd [MOS-786] Added support for A/B boot codes in OS
Further implementation of A/B booting
2023-01-19 16:41:56 +01:00
Pawel Olejniczak
0867d17242 [CP-1424] Refactor backup and restore endpoints
Redesign of backup and restore endpoints in the
service-desktop to delegate responsibility for
execution of the actual backup and restore process
onto the Updater.
2023-01-19 16:41:56 +01:00
Maciej-Mudita
4bd7b1acf4 [MOS-275] Fix alarm rings on the low battery screen
When we had a critical battery level and the alarm clock rang,
it was impossible to turn it off.
2023-01-19 12:07:19 +01:00
Maciej-Mudita
7fff20a0e7 [MOS-788] Fix incorrect total CPU usage in logs
After a long time, a counter overflow appeared
2022-11-02 10:59:17 +01:00
Maciej-Mudita
f4aaf4e302 [MOS-775] Create run-time statistics for tasks
Every hour, statistics of tasks that put a heavy load
on the CPU will be logged
2022-10-25 18:46:54 +02:00
Dawid Wojtas
e77b5d6702 [MOS-424] Improvement of logger module
Due to losing bytes the logger has a worker
which is responsible for dumping logs to
the file. The logger also has its own timer
to dump logs every 15 minutes. EventManager
is not responsible for interval dumping logs
now.
2022-09-15 11:58:09 +02:00
Dawid Wojtas
b7330da36c [MOS-662][MOS-301] Fix E-ink shutdown while restoring data
While restoring system data the timer can turn off power of E-ink
to save the power. To avoid this situation we need to power on
the E-ink before wiping out the display. The restore procedure
also performs reversing services list to close. In this case
we do it twice so the order is wrong.
2022-08-30 11:00:04 +02:00
Dawid Wojtas
ded7e1a7a5 [MOS-676] Fix destroying wrong sentinels
If the service is closed the governor removes connected
sentinel. The base iterator refers to the element that is next
in the reversed list. Adding std::next the iterator points to
the correct element.
2022-08-30 08:54:55 +02:00
Adam Wulkiewicz
fe708cdf31 [MOS-670] Change clang-format AlwaysBreakTemplateDeclarations to Yes
Add --all and --fix-all options to style-check-hook
2022-08-26 15:22:39 +02:00
Maciej Gibowicz
c9b16c3064 [MOS-598] Improved keyboard responsiveness
Add sentinel that increases and hold the CPU frequency
after a button press event
2022-07-28 12:16:36 +02:00
Lefucjusz
ab02490917 [MOS-559] Fix phone unlock after mode change
Correction of the previous fix addressing this issue.
Previous idea didn't work when popup tried to
display in application other than ApplicationDesktop
2022-06-30 13:31:18 +02:00
Paweł Joński
870250433a [MOS-298] HALize ServiceEink
Add HAL to ServiceEink
Remove dead code from Linux eink substitute
Fix LUTS.bin refresh problems on simulator
2022-06-29 13:37:20 +02:00
Bartosz Cichocki
228fca4b83 [MOS-463] Unify cellular namespace
Unified cellular namespace, fixed test buildiing,
removed some unused includes
2022-06-08 10:54:29 +02:00
Lefucjusz
c6e08f47ce [MOS-42] Tethering popup with SIM not present fix
Fix of the issue that tethering popup showed
after the USB cable has been connected even
if selected SIM card was not present, so
there was no connection to network.
2022-06-06 10:13:13 +02:00
Adam Dobrowolski
409b9b77e5 [MOS-516] FIX: tethering while call disabled
We discard tethering while call now
2022-06-03 16:00:45 +02:00
Lefucjusz
a5f621bc83 [MOS-487] Added call events state machine
Added tests and calls substate
bluetooth sm diagram created
All old bluetooth tests reviewed and updated
removed new - with queue it's not required
removed TODO
Co-authored-by: Bartosz Cichocki <sp2fet@gmail.com>
2022-05-26 16:19:02 +02:00
Adam Dobrowolski
2664e8ccec [MOS-487] Move switch case to sm
massive switch case removed
added logger
moved state machine implementation
added double dispatch
2022-05-26 16:19:02 +02:00
Adam Dobrowolski
720f56e3cf [MOS-419] Removed AbortCall as popup and fixed tethering poup
Removed dead code causing harm
Moved tethering to call logic
2022-05-24 07:50:59 +02:00
Maciej Gibowicz
fc05d5e618 [MOS-389] Fix phone stuck on shutdown screen
The phone sometimes remained on the power off screen
during system shutdown.
2022-05-05 14:16:03 +02:00
Adam Dobrowolski
3343f02809 [MOS-266] Call StateMachine implementation
With some tests, documentation and so on
2022-05-02 15:54:33 +02:00
Mateusz Piesta
97e9d7b79f [BH-1449] Fix gui/eink dependencies
* Dependencies between service-gui and service-eink
have been correctly defined.
* System close routine was replaced with the sequential one
which should solve many bell issues.
* It also fixes BH-1406 and BH-1442.
* Fixed some weird CMake issues in module-audio and
several other modules.
* Fixed service-gui closing routine
* Removed unneeded messages/states from service-gui/eink.
* Enhanced app-mgr closing routine. Fixed closing action handling.
2022-04-26 13:47:12 +02:00
Adam Dobrowolski
fc64a97b8e [MOS-380] Sentinels for each added that removes bad data
As in topic
2022-04-15 10:54:57 +02:00
Maciej Gibowicz
619685d70a [MOS-339] Fix rapid change of CPU frequency
After disconnecting the USB cable, the CPU consumption
increased to over 80% (for 4 MHz), which resulted
in a cyclical change in the CPU frequency and finally
a much shorter battery life.
2022-04-11 08:54:54 +02:00