Commit Graph

309 Commits

Author SHA1 Message Date
Lefucjusz
024faff77e [BH-2035] Update relaxation paused window
Updated looped relaxation windows to match
new design.
Fixed issue with misaligned pause button
on timed relaxation windows.
2024-07-12 09:10:28 +02:00
Lefucjusz
09efb75ed5 [MOS-1068] Cleanup BTStack intergration
Code cleanup in various places of
BTStack integration.
2024-05-29 17:33:30 +02: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
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
Lefucjusz
8b3ae7b48c [BH-1857] Fix improper PWM module clock frequency computation
* Fix of the issue that source clock for PWM
module was improperly assumed to be derived
from AHB_CLK, while in reality it is
derived from IPG_CLK, what resulted in
module generating signal with 4 times
lower frequency than the configured
one.
* Cleanups.
2024-01-16 13:58:26 +01: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
Lefucjusz
674a768364 [MOS-669] Add too hot battery notification when charging
* Added notification showing on the main
screen if the battery has reached too
high temperature to continue charging.
* Code cleanups.
2023-10-16 12:54:13 +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
b53dec1ff2 [MOS-1012] Fix occasional crash when unplugging Pure from PC
Fix of the unhandled error issue that resulted
in occasional device crash when disconnecting
from PC with MC app running.
2023-08-03 09:42:18 +02:00
Lukasz Mastalerz
21171bb474 [BH-1714] Eink refactor and error handling
Cleanup and refactor for eink code.
Changed turning on/off procedure.
Add error handling.
2023-07-14 10:23:42 +02:00
Lefucjusz
561e4e7a0d [MOS-599] Fix undefined phone mode in simulator
Fix of the issue that on simulator phone mode
was in 'undefined' state, what resulted in
no phone mode selected in settings.
2023-06-29 10:50:25 +02:00
Dawid Wojtas
8883bf2df5 [BH-1717] Fix no clock update
The secure RTC can lock and the clock is not updated.
To prevent this situation we reset LP registers (except for
timestamps and alarms) and clear the LVD flag. Then we
enable again LP SRTC.
2023-06-21 17:29:16 +02:00
Lefucjusz
2643d9a92f [MOS-997] Fix failing sync with Mudita Center
Fix of the issue that sync with Mudita Center
would fail often after changes introduced in
CP-1968.
2023-06-20 11:02:21 +02:00
Lefucjusz
2620191e73 [MOS-238] Use on-chip hardware TRNG as an entropy source
Use hardware TRNG integrated into RT1051 MCU
as an entropy source for builds complied
for RT1051.
2023-06-19 15:57:05 +02:00
Maciej-Mudita
1b03981b06 [BH-1701] Add extended user heap statistics for debugging
Added extended statistics to help track potential memory leaks:
* used user heap size per task
* number of successful allocations
* number of successful frees
2023-05-31 14:39:33 +02:00
Lefucjusz
e1d3862feb [BH-1673] Fixes for Harmony random resets
Next part of Harmony random resets fixes:
* added RC OSC startup delay as in newest lpm.c;
* changed order of clock source, oscillator and
LDO switching;
* removed connecting internal DCDC load resistor,
as it is only required to speed up converter
startup after it was turned off completely;
* changed DCDC operation mode to continuous
conduction;
* set low VDD_SOC_IN voltage back to 950mV as
suggested in RM.
* added switching DCDC converter mode to
discontinuous conduction for two lowest CPU
clock frequencies, as using CCM mode resulted
in very high current consumption that would
shorten Harmony's life on battery
significantly.
2023-05-29 14:22:05 +02:00
Dawid Wojtas
ff18f17e52 [BH-1700] Add date and time to logs at the startup
Save date and time at the startup of the system for analysis purposes.
2023-05-29 10:03:27 +02:00
rrandomsky
c96dc7dc30 [MOS-686] Fixed MTP availability only after phone unlocked
Fixed file access via MTP even when phone is not unlocked.
Now access is granted when the phone is unlocked by the user entering
a passcode. If the phone is not passcode protected (passcode is nor set)
then access to the files is always possible via MTP.
2023-05-18 15:57:09 +02:00
Mateusz Piesta
205fedb9a6 [BH-1595] USB reset procedure
* Fixed incorrect reset procedure
* Minor refactor
2023-05-16 09:42:34 +02:00
Dawid Wojtas
2cbadc6a00 [BH-1630] Turn off the device for low voltage
The system closes only if the SoC is 0%, but
it doesn't react if the voltage has low level.
The new implementation invokes the close
procedure if the voltage is less than 3.4V.
This solution should avoid possiblity to
hang the MCU.
2023-03-16 11:14:38 +01:00
Dawid Wojtas
f7980fea6d [BH-1649] Reimplement I2C communication attempts
The CW2015 driver should avoid any logic.
Thus I2C communication attempts were moved
to the BatteryCharger which is product specific.
2023-03-14 15:49:29 +01:00
Lefucjusz
c057799904 [MOS-887] Fix black screen left after power off
Fix of the issue that after powering off
the phone with dark mode enabled the
screen remained black instead of being
cleared to white.
2023-01-25 18:59:49 +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
Bartosz Szostak
25096a1e8b [MOS-820] Fix crashes caused by plugging the charger
The deleting of the USBLinuxReceive task has been added
in the USB stack de-initialization process to avoid creating
multiple instances during next initializations.
2022-12-01 20:40:53 +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 Wulkiewicz
49bbaf51a0 [MOS-550] Improve refresh of the display
1. Implement partial refresh.
2. Implement refresh canceling mechanism.
3. Refactor some parts of the gui and display code.

ad 1.
- Detect parts of the screen changed since last update and merge them
  into bigger regions. These regions defines parts of the context sent
  to the display.
- Refresh the region covering all of the parts since this is the most
  time consuming part and the size of the refreshed region doesn't
  change the time much.
- Refresh the whole screen if deep refresh is requested and previously
  fast refresh was used. This is needed to prevent unwanted artifacts
  in some cases.

ad 2.
- Separate display update and refresh logic.
- Divide image display message handling into two handlers, one updating
  and other one refreshing the screen.
- Add cancel refresh message and use it to cancel refresh during update.
- Store sum of refresh regions gathered during updates to refresh them
  all at once at the end.
2022-10-11 20:00:33 +02:00
Adam Wulkiewicz
f7771013f9 [MOS-550] Revert - Implement eink partial refresh
This reverts commit 41d6e786b6.
2022-09-27 13:14:54 +02:00
Adam Wulkiewicz
41d6e786b6 [MOS-550] Implement eink partial refresh
Detect parts of the screen changed since last update and merge them into
bigger regions. These regions defines parts of the context sent to the
display.
Refresh the region covering all of the parts since this is the most time
consuming part and the size of the refreshed region doesn't change the
time much.
Refresh the whole screen if deep refresh is requested and previously
fast refresh was used. This is needed to prevent unwanted artifacts in
some cases.

Refactor some parts of the gui and display code.
2022-09-22 15:50:30 +02:00
Maciej-Mudita
6ebd1550db [MOS-686] Revert - Fix the accessibility of user files by MTP
This reverts commit 42ca53a732.
2022-09-22 10:20:36 +02:00
Maciej-Mudita
42ca53a732 [MOS-686] Fix the accessibility of user files by MTP
User files accessible via MTP only if phone is unlocked
2022-09-16 09:52:27 +02:00
Mateusz Piesta
5fc2f024db [CP-1560] MTP root path
Make MTP root path configurable.
2022-09-14 12:41:54 +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
Lefucjusz
2f74db29a6 [MOS-608] Fix crash on phone turn off
Fix of the crash that sometimes happened
during system closing.
2022-08-25 16:13:58 +02:00
Maciej Gibowicz
90543e264f [MOS-648] Fix USB connection/disconnection detection
If there were errors while charging the battery,
e.g. too high temperature, the detection of USB
connection/disconnection failed.
2022-08-12 14:55:46 +02:00
Mateusz Piesta
14f78ffc07 [BH-1552] Harmony crashes during startup
Fixed crashing device.
Bell temperature sensor refactor.
2022-08-12 14:40:56 +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
Kuba
ff393d34ec [MOS-451] Drop invalid SoC
Invalid state of charge is now dropped. Invalid SoC was interpreted
as 0% battery.
2022-05-26 10:16:33 +02:00
Lefucjusz
434a335ef3 [MOS-411] Wired headset audio fix
Fixes non-working wired headset audio
during call
2022-05-16 10:20:48 +02:00
Mateusz Piesta
1ea2c45350 [BH-1452] Remove board directory from module-os
Moved board-specific code to module-bsp.
Extracted several smaller CMake targets to avoid
circural dependencies and reduce compile time.
2022-04-13 13:14:22 +02:00
Mateusz Piesta
2f42cd5e73 [BH-1424] FreeRTOS update
Updated FreeRTOS source code to 10.4.6.
Moved FreeRTOS sources to the third-party directory.
Added necessary changes to the CMake configuration.
Split FreeRTOSConfig.h. From now, each board has its own.
Added missing log headers.
Minor refactor of the module-os cmake.
Fixed stack overflows in bell application main and time service.
2022-04-07 13:31:28 +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
Mateusz Piesta
6ad290366f [MOS-296] Merge SNVS cherry-pick conflicts fixed
Fix SNVS Harmony approach conflicts with master
2022-03-09 19:34:39 +01:00
Maciej Janicki
5dc42c2be6 [MOS-296] Merge new master commits into merge-stable-wip
Merge new master commits
2022-03-09 19:32:59 +01:00
Maciej Janicki
2b2bb13a49 [MOS-296] Merge remote-tracking branch 'origin/stable'
Merge stable Harmony branch into merge wip branch
2022-03-09 19:27:50 +01:00
Maciej Gibowicz
d3bba9da05 [MOS-256] Turn off torch driver when not in use
We save on power consumption ~0.7 mA.
2022-03-08 09:21:50 +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
Maciej Gibowicz
30789d3d9c [EGD-8191] Magnetometer deinitialisation
We stop reading from the magnetometer
during the system shutdown procedure
2022-01-28 14:03:42 +01:00
Mateusz Piesta
1946d53efa [BH-1333] Battery subsystem refactor
Interfaces clean up.
Fixed logic flow.
Fixed various bugs.
2022-01-21 13:48:10 +01:00
Lucjan Bryndza
e9ee2af0dc [EGD-8131] Add Reboot/Poweroff for _platform_exit()
Add support for Reboot and Power off for the
_platform_exit code.

Add _platform_exit mode handle

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-12-22 15:55:24 +01:00