Commit Graph

799 Commits

Author SHA1 Message Date
Lefucjusz
181feb4f40 cleanup 2024-08-20 15:40:34 +02:00
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
5e52e0324f [BH-2009] Change charger chip name to proper one
Renamed some legacy name of battery charger
chip to the one that is used in the device.
Minor cleanups.
2024-06-12 15:20:13 +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
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
Lefucjusz
9367647f6a [BH-1921] Fix debug session disconnects on entering WFI
Fix of the issue that debug session would sometimes
disconnect when the CPU entered WFI mode due to
core clock being stopped.
2024-03-21 09:36:11 +01:00
Dawid Wojtas
7a55cea832 [BH-1913] Fix debug mode
Add init eMMC pins to make sure that the pins
are configured in debug mode. If we run a debug mode
the 1st bootloader is not run so the pins may have
incorrect config. Added config also for Pure.
Bump ecoboot version with this same fix.
2024-03-13 10:00:55 +01: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
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
d8293b8254 Revert "[MOS-1064] Fix no input language selected for French/Spanish"
This reverts commit 9ef454085e.
2024-02-21 17:49:30 +01:00
Lefucjusz
9ef454085e [MOS-1064] Fix no input language selected for French/Spanish
* Fix of the issue that choosing French
or Spanish as a system language
resulted in no input language selected.
* Added keyboard input parser unit
tests for French and Spanish input
maps.
* Minor cleanups.
2024-02-20 16:32:46 +01:00
Lefucjusz
5c1d6641fe [MOS-1061] Fix screen backlight flash when turning off
Fix of the issue that screen backlight
would sometimes flash lightly when the
phone is turning off.
2024-02-15 14:43:52 +01:00
Maciej Gibowicz
4add7e1703 [BH-1870] Fix displaying the menu after deep press on main screen
Add double checking debouncing timer with reference GPT timer to
eliminate incorrect behavior on deep press after exiting WFI
2024-02-02 12:24:57 +01:00
Lefucjusz
1e496a8fd7 [BH-1833] Fix debug after watchdog config change
Fix of the issue that waiting for RTWDOG
unlock bit to be set after issuing unlock
command caused the debug to crash
immediately after the OS started.
2024-01-25 14:23:32 +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
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
bc4ff20d71 [BH-1836] Increase range of volume adjustment
Extended volume scale from 10 to 15 point scale
Modified volume approximation function for better user experience
2023-12-14 11:00:52 +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
Dawid Wojtas
e39871f8a9 [BH-1814] Fix eink errors in logs
According to the newest fsl library the LPSPI_Reset function
shouldn't be invoked in LPSPI_MasterInit function.
As a result, the LPSPI module can't work after calling this API.

If the display returns the error the driver could invoke
EinkPowerDown function recursively which causes a crash.
2023-11-09 20:14:52 +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
7a8e35016d [MOS-1026] Add extended logging to Pure's charger driver
* Added extended logging to Pure's charger driver.
* Removed redundant handling of INOKB pin
interrupt - charger is configured to provide
the same interrupt via INTB pin.
* Minor code cleanup.
2023-08-28 10:14:51 +02:00
Lefucjusz
f1c49a60e5 [MOS-1018] ServiceAudio power management optimizations
Optimized power management strategy used by
ServiceAudio:
* changed minimum CPU frequency from 528MHz to 264MHz;
* added switching to 24MHz when operation active,
but paused;
* minor cleanup in several places.
2023-08-16 16:16:47 +02:00
Lukasz Mastalerz
a61fb7a0e2 [MOS-1014] Screen remains black after turning off the phone with dark mode enabled
Regression fixed by adjusting wipeout function.
2023-08-09 13:42:49 +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
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
882a6d0896 [BH-1714] Handling eink initialization errors
Added error detection while eink initialization.
Added mechanism to reinitialize the eink in case of error.
2023-07-25 12:55:06 +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
Dawid Wojtas
53b1ebf361 [BH-1730] Fix enter into SNVS mode
If the CPU fails during changing the frequency
the device can stuck in SNVS mode.
So the CPU frequency is checked and if
the frequency is wrong the CPU doesn’t enter SNVS mode.
The watchdog should restart the CPU.
2023-06-29 14:12:37 +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
Lefucjusz
13269271e6 [MOS-998] Provide additional info in crashdump filename
Added info about product, OS version and
commit hash to crashdump filename to
simplify analysis of the crashdumps
without corresponding logs available.
2023-06-22 12:14:07 +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
Dawid Wojtas
90b0252060 [BH-1708] Fix buttons behavior
When the button is pressed/released we get an interrupt
which falls or rises edge. We read the gpio state a bit
later so in case of debouncing we can register
the wrong pin state.
After the debounce interval the state is stable.
2023-06-20 09:18:40 +02:00
Dawid Wojtas
3ba8663430 [BH-1718] Add extra logs to the RTC module
Add extra logs when the RTC timeout error occurs.
In that, we can find reason in registers of what happened.
2023-06-19 16:13:14 +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
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
Lefucjusz
3193f6fa59 [MOS-230] Print last instruction address before RTWDOG reset
Added mechanism that stores address of last
executed instruction before RTWDOG timeout
to enable some basic debugging in such cases,
as such resets do not create crashdumps and
leave no information in logs.
2023-06-06 13:50:23 +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
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
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
Lefucjusz
3e1170daf7 [BH-1673] Harmony random resets fixes
* Switching VDD_SOC_IN only after PLL2 is turned off.
* Weak LDO stabilization delay.
* Removed switching to 1.275V before frequency change.
* Cleanups in LDO switching.
* Removed switching PeriphClk2Div for fCPU <= 24MHz,
using AhbDiv instead.
* Removed log from _exit that caused logger mutex deadlock
2023-05-24 13:34:55 +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
3c2728e5dd [BH-1695] Fix Harmony crash on startup
Fix of the bug in PWM driver that
resulted in accessing array out of
bounds, what caused occasional
system crash on startup.
2023-05-17 11:47: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