Commit Graph

301 Commits

Author SHA1 Message Date
Lefucjusz
2e04d268c4 [MOS-1068] Fix A2DP stream not restarting after song changes
Workaround for the issue that A2DP stream
would sometimes not restart when music
player changes song to the next one.
2024-05-29 17:33:30 +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
0aa094875d [BH-1885] Increase stack size for battery charger task
The battery charger worker had only ~10% free
stack size so it was a possibility to stack overflow.
After increasing the stack by 512 bytes the worker
has ~40% free stack space.
2024-02-26 08:50:41 +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
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
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
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
Lefucjusz
da838b8c8f [BH-1706] Fix inaccessible MTP on Harmony
Fix of the issue that Harmony's MTP
was constantly locked after MOS-686
fix, as the mechanics of unlocking
was not handled for Harmony at all.
2023-06-02 14:47:29 +02:00
Lefucjusz
92d9902b02 [BH-1702] Fix RTWDOG main DCDC reset
Fix of the issue that RTWDOG performed
only CPU reset in case of timeout due
to IRQ misconfiguration resulting in
RTWDOG handler not being called.
2023-05-30 10:31:49 +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
Lefucjusz
3a5f668c98 [BH-1583] Fix SNVS LP lockup after debugging
* Fix of the issue that manifested after
running MuditaOS on Harmony via JLink,
which resulted in OS freezing when
trying to set time in normally booted
(via the bootloader) device.
* Minor RTC code cleanup.
* Partial T6 JLink script cleanup.
2023-05-05 15:51:49 +02:00
Mateusz Piesta
b6235923bf [BH-1595] USB charger detection issues
* Fixed issues with USB charging port detection
* Fixed memory leak in usb_stack/OS integration layer
* Fixed incorrect handling of software timer
* Minor cleaning/refactor.

[BH-1595] Turned off USB/PC charging

Charging enabled only for a dedicated charger. Users won't be able
to charger while connected to the PC.
2023-04-28 13:54:36 +02:00
Lefucjusz
68b8330e96 [MOS-981] Magnetometer driver cleanup
Cleanup of the magnetometer driver.
Added checks of all I2C operations
return codes and error messages
in case of failures.
2023-04-20 14:12:14 +02:00
Lefucjusz
f79313e397 [BH-1661] E-ink display power management tweaks
Tweaks and changes required to optimize
power consumption for Harmony.
2023-04-14 13:13:52 +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
Lukasz Mastalerz
3b2e1ef675 [CP-1665] Adding an information about device colour to USB descriptor
Getting information about device colour and changing it to number.
Pass information about device colour to usb_stack.
Set a bcdDevice with the corresponding value.
2022-12-02 09:24:10 +01: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
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
Mateusz Piesta
14f78ffc07 [BH-1552] Harmony crashes during startup
Fixed crashing device.
Bell temperature sensor refactor.
2022-08-12 14:40:56 +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
Paweł Joński
7a9ba7ffa8 [BH-1448] MTP closing routine and VCOM reset routine
MTP closing routine and VCOM reset routine
2022-04-20 11:17:55 +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
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
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
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
Alek Rudnik
9cf11913a1 [EGD-8129] Add atexit functionality
Added atexit functionality. All global destructors and functions
registered with atexit() should be called at program exit.
It was possbile to reuse original newlib implementation with
MALLOC_PROVIDED flag set.

Made sure logger destructructor is called as last one.

Due to mudita OS legacy, it was not possible to simply fix dependencies
in global objectes and hence there are neither global objects
destructors nor functions registered with atexit() called when exit()
is called.
Possibly it will be changed later.
2022-01-05 13:59:51 +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
Przemyslaw Brudny
21a5a23282 [EGD-8079] CPU frequency conversion PWM fix
Fixed CPU frequency conversion.
2021-12-07 15:52:00 +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
tomaszkrosnowski
90bc8a7eba [EGD-7899] Keypad light settings fix
Fixed keypad light settings - removed always on option which had
serious impact on battery life time.
2021-11-25 00:49:04 +01:00
Wojtek Rzepecki
1a66e73b78 [BH-1167] USB async receive
Polling routine replaced with event driven
implementation for USB receive
2021-11-10 16:57:02 +01:00