Commit Graph

52 Commits

Author SHA1 Message Date
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
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
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
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
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
Adam Dobrowolski
cc02ffffbb [MOS-258] System profile util works with separate rtt
Profiling Move RTT handling to interfacing library
Library for msgpack sink
magic enum updated
performance monitor fixups
2022-04-07 11:32:49 +02:00
Adam Dobrowolski
43cd960523 [MOS-278] Fixed frequency hold algorithm behaviour
fixed hold frequency algorithm behaviour
added basic tests for frequecy changing
updated catch for newer gcc
tests added
2022-03-15 17:26:09 +01:00
Adam Dobrowolski
1fff92e9d6 [MOS-225] Review applied
As above.
2022-03-04 07:05:02 +01:00
Adam Dobrowolski
dd12853503 [MOS-226] Moved algorithms and their data to separate classes
This way we have controll over what does what, and can test
them separatelly
Logging statistics update more and better data presented
2022-03-04 07:05:02 +01:00
Adam Dobrowolski
30487c6008 [MOS-110] Statistics api for system
Gets data from freertos and prints on frequency change depending
if it's important. Gathering is not costly, printing is though.
For less intrusive checks I would rather disable names gathering
as in worst case scenario it hangs rtos context switching till
thread id is found.
2022-02-17 16:46:56 +01:00
Lucjan Bryndza
3596802273 [MOS-114] Frequency scalling skip 12MHz Level
Skip 12MHz freq level in the scaller
2022-02-14 11:59:46 +01:00
Lucjan Bryndza
ebc8e76a27 [MOS-114] CPU frequency scalling improvements
Add minimal frequency ~4Mhz, more aggressive CPU freq
optimizations.

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2022-02-14 11:04:49 +01:00
Pawel Olejniczak
6566ad7ae3 [CP-1007] Add API for rebooting to USB MSC mode
It will allow to reboot the device to USB MSC mode
without need to interact with a physical keyboard.
2022-02-01 15:26:20 +01:00
Maciej Gibowicz
7f9bc6bf6f [EGD-7922] Added Permanent Frequency Setting
Added Permanent Frequency setting in Advanced Developer
Mode with simple set window.
2021-12-06 13:57:38 +01:00
Wojtek Rzepecki
6e69eb6aa6 [BH-990] Adjist CPU frequency chages
Adjusted Bell frequency low-power mode changes
2021-10-15 13:22:43 +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
958ce4906c [BH-897] Split module-sys
Split system module to better manage dependencies between system
components.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-09-21 16:11:59 +02:00
Maciej Gibowicz
7394811560 [EGD-4809] Add LDO switching
To reduce the power consumption, we switch LDO
to the low power mode.
2021-09-09 09:34:59 +02:00
Maciej Gibowicz
1134a38584 [EGD-4875] Add internal load resistor switching
To reduce the power consumption, we disconnect
internal load resistor
2021-09-08 11:03:55 +02:00
Piotr Tański
90e7a48198 [EGD-7362] Merge release/0.76.1 into master
Merge release/0.76.1 into master.
2021-09-02 11:12:59 +02:00
Wojtek Rzepecki
b19ddb719e [EGD-6928] Fix system powe instability
Improved frequency switching mechanism
2021-07-15 11:36:40 +02:00
Lucjan Bryndza
97538c8969 [CP-319] Extends reboot reason code
Extends reboot reason codes after reboot to updater
to detect updater command requests: Update, FactoryReset
and the Recovery.

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-07-08 17:13:02 +02:00
Lucjan Bryndza
5324fcc0a6 [CP-312] Add reboot to update function
Because update procedure it is splitted to the two stages
downloading and update throught separate binary we need
to pass ecoboot special flag to request reboot to updater
bin after update procedure.
This patch adds this functionality to the PureOS.

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-07-07 10:46: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
677e18cada [EGD-5658] Add eInk CPU frequency hold
While the screen is being redrawn,
we block CPU frequency decreasing
2021-03-15 08:54:40 +01:00
Maciej Gibowicz
9f87dead1c [EGD-4853] Add Wake up GSM modem on demand
System wakes up Cellular when there is a need to communicate
with the modem, e.g. to handle an outgoing call
2021-03-10 13:08:48 +01:00
Maciej-Mudita
11aa4c7ffb [EGD-5382] Add LowPower CpuSentinels
In order to synchronize the Low Power mode, the services were
immediately informed about the frequency change,
so that they can update their resources (e.g. PWM filling)
and services may request the maximum CPU frequency in order
to perform a task (e.g. screen redraw, telephone conversation)
2021-02-12 09:40:36 +01:00
Maciej-Mudita
ec56afc933 [EGD-5381] Add Low Power Drivers
Peripherals clock synchronization dependent on PLL2
2021-02-10 08:46:13 +01:00
Maciej-Mudita
a3d6c7987d [EGD-5186] Change minimum CPU frequency to 132 MHz
Temporary minimum CPU frequency limitation
2021-01-13 13:57:31 +01:00
Maciej-Mudita
1521858134 [EGD-4887] Add PLL2 clock switching
Pll2 will be disabled at the lowest CPU frequency,
which will save power
2021-01-12 10:02:58 +01:00
Maciej-Mudita
0c0fdef19b [EGD-4881] Add oscillator clock switching mechanisms
Osc will change automatically at the lowest CPU frequency,
which will save power
2021-01-08 10:00:11 +01:00
Maciej-Mudita
f9b9967b0e [EGD-4694] Add CPU frequency shift mechanism
The CPU frequency changes automatically which saves energy
2020-12-22 18:00:57 +01:00
Maciej Gibowicz
0cc2af0850 [EGD-4472] PowerManagement: Separation of CPU clock into separate clock domain (#1125)
Change CPU clock into separate clock domain

We can control the CPU frequency independently of the peripherals.
2020-12-03 12:04:53 +01:00
Przemyslaw Brudny
e131dae68f [EGD-3743] Removed old doxygen copyright statements from project. 2020-10-20 12:55:10 +02:00
Radoslaw Wicik
2276ceed67 [EGD-3743] Update copyrights in fies 2020-10-20 12:55:10 +02:00
Adam Dobrowolski
2cee195e09 EGD-3056 subscribtion based execution (on typeid) added and works fine
Till now there was no clear way to register hanlder for message in
Service, with this approach one can register function/lambda handler
for Message which encurages handling messages in functions rather than
in hudge switch cases.
With aproach like this our Messages resembe something between Command
and State pattern. In state pattern `Message` would be `Event` send,
whereas Service would be `Context`.
2020-04-15 16:50:19 +02: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
Radoslaw Wicik
a8573a404c Apply new style 2020-03-17 10:03:16 +01:00
Adam Dobrowolski
8f4b33c1b5 [EGD-2327] Disabled PM and lock screen 2019-11-19 13:57:26 +01:00
Mateusz
6c7c622d42 WiP: Added actual poweroff procedure into system manager 2019-10-03 12:26:00 +02:00