Commit Graph

45 Commits

Author SHA1 Message Date
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
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
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
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
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
Dawid Wojtas
5098d06067 [BH-1627] Enable brownout detection
There is the possibility of hanging
the MCU due to a power glitch
if the voltage drops to 2.8V
and the system wants to use some
peripherals like the eink or the backlight.

To prevent this situation brownout
detection has been enabled
which monitors the 1.1V and 2.5V
LDO regulators. If the voltage
will drop to the trigger voltages
then the interrupt is invoked.
The interrupt checks the source
of the interrupt and then reset
the MCU using WDOG_B pin
which is connected to the main power source.

After restarting, the MCU checks
the voltage. If it is too low
the system enters SNVS mode.
2023-03-02 10:57:30 +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
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
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
Lucjan Bryndza
4d09846d1f [EGD-7774] Fix compile on ARM GCC11
Fix compile on ARM GCC11

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-10-12 16:30:33 +02:00
Lucjan Bryndza
efa0a16543 [BH-848] Split board h for bell and pure
Split board.h for the bell and Pure

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-09-06 11:19:47 +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
Lucjan Bryndza
7a59458d55 [BH-724] Split board code for pure and bell
Split board specific code especially GPIO for the
Pure and bell

[BH-724] Split Pure and Bell PINMUX

Split Pure and Bell PINMUX

[BH-274] Split clocks for the pure and bell

Split clocks configuration for the pure and bell

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>

[BH-724] Split IRQ GPIO for bell and pure

Split IRQ GPIO handling for bell and pure

[BH-724] Add to cmake board specific files

Add to cmake board specific files

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-08-30 11:20:54 +02:00
Wojtek Rzepecki
1da915ace9 [BH-777] Add Bell specific ld script configuration
Added bell specific ld script configuration for
board memory layout
2021-08-18 08:40:44 +02:00
Maciej Gibowicz
aea9e64bea [EGD-7088] SDRAM configuration on T7 board
Add configuration for new, increased to 64 MB SDRAM.
2021-07-15 17:02:37 +02:00
Borys Jelenski
085bccb7a1 [EGD-6355] Adjust MuditaOS to be used with Secure Boot
The start address of the OS image adjusted to comply with HAB
Secure Boot. Proper SNVS initialization performed at system startup.
SNVS drivers updated to most recent version. Image signing can be
performed as a part of build process. See doc/secure_boot.md for
more info.
2021-04-22 15:02:59 +02:00
Maciej Gibowicz
8f8a1b3ca1 [EGD-6499] Fix audio initialization
Now the peripherals and the audio clocks will be turned on
only when the user is using the audio, which will save energy.
2021-04-22 09:37:23 +02:00
Artur Śleszyński
33d652c1a1 [EGD-6156] Create crash dumps
Integrate the CrashCatcher library in order to store phone state after
a fault occurs. The dumps are stored in the CrashCatcher hex format and
can be debugged using the CrashDebug stub built for x86_64 via the
'debug_crash_dump.sh' script.
2021-04-02 14:58:42 +02:00
Marcin Smoczyński
bda18b5b54 [EGD-5706] Refactor creating audio device
Audio devices are created in the audio subsystem and it is not possible
to send a device to bt service upon creation.

Introduce hookable audio device factory to allow sharing bluetooth
audio device. Move audio devices from bsp to audio allowing removal of
unwanted bsp -> audio dependency.

Remove Bluetooth proxy device which turned out to be a dead end.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-02-17 16:20:59 +01:00
Maciej-Mudita
83ec53d470 [EGD-5078] Fix Debug UART conditional enabling
Uart debug will be enabled only when redirecting logs to Uart
2021-01-08 10:24:40 +01:00
Przemyslaw Brudny
e131dae68f [EGD-3743] Removed old doxygen copyright statements from project. 2020-10-20 12:55:10 +02:00
Marcin Smoczyński
2635367efb [EGD-4003] audio: fix workers destroying (#806)
Improve workers destroying by replacing sudden death with a gentle close
request.

Make (De)Init static - when creating second instance of a codec there
was a situation when destructing one instance was causing first one to
stop working, because they share common hardware resources.
2020-10-20 11:02:40 +02:00
Marcin Smoczyński
c34f7ddb53 [EGD-2592] bsp: change heap and code size
Change SDRAM configuration from 4M for code and 13M (which is invalid)
for heaps to 6M for code and 10M for heaps.

Usermem heap's size has been decreased to 9M.

Use heap start symbol __sdram_cached_start for MPU configuration instead
of using magic values which are easy to miss when they are need to be
changed.

This change is required to be able to fit in libphonenumber.
2020-04-08 18:23:45 +02:00
Alek-Mudita
36be49c15b Egd 3046 unexpected reset (#274)
* [EGD-3046] fix HF handler
added boot reason printing and clearing

* [EGD-3046] added prining of  GPR_5 on checking boot reason

* [EGD-3046] added halt if debugging

* [EGD-3046] halt if debugging only in exit

* [EGD-3046] rename

* [EGD-3046] added DEBUG check

* [EGD-3046] fixed formatting

* [EGD-3046] fixed includes
2020-04-01 16:34:56 +02:00
Mateusz Grzywacz
faa6d72dea [EGD-2961] T4 - vibrator conf (pinmux) + off @ init 2020-03-23 16:47:54 +01:00
Mateusz Grzywacz
05ac844b77 Revert "vibrator_master_off Disable wibrator enabled in bootloader in PurePhone code"
This reverts commit 7d2bd511
2020-03-23 16:47:54 +01:00
Przemyslaw Brudny
8f3cc846d2 [EGD-2978] SystemView build parameter added and log_redirect cleanups 2020-03-20 14:28:57 +01:00
Przemyslaw Brudny
e7cb0cb579 [EGD-2978] Formatter cleanups 2020-03-20 14:28:57 +01:00
Przemyslaw Brudny
2f30344740 [EGD-2978] Performance improvements, RTT logs redirected to SystemView 2020-03-20 14:28:57 +01:00
Adam Dobrowolski
87f3f8044a vibrator_master_off Disable wibrator enabled in bootloader in PurePhone code 2020-03-20 09:19:22 +01:00
Radoslaw Wicik
a8573a404c Apply new style 2020-03-17 10:03:16 +01:00
Mateusz
2f8cec37c5 Fix: DCDC CCM/DCM mode
Fix: Removed test code.
2019-10-25 11:33:00 +02:00
Mateusz
2c7b14d564 Fix: Parsing file attributes in VFS::listdir method 2019-10-09 13:23:06 +02:00
Mateusz
99c0143ca6 WiP: Power switch off, ready to be tested 2019-10-03 12:18:04 +02:00
Mateusz
22ad981b01 WiP: Suspend/Resume procedure implementation + testing 2019-09-04 13:43:27 +02:00
Mateusz
ed1beb2212 Added printing PerphSourceClocks at startup 2019-08-22 14:14:15 +02:00
Mateusz
14dba1a715 Fixed wrong peripheral clock settings 2019-08-22 13:31:10 +02:00
Mateusz
285fca1f57 WiP: replace dmamux,dma and pll drivers inside bsp-audio,bsp-cellular,bsp-eink with new implementations 2019-08-14 10:58:55 +02:00
Mateusz
e412f71b49 WiP: DriverI2C implemented & switched I2C driver implementation inside audio,batt-charger and keyboard modules 2019-08-09 13:43:48 +02:00
Mateusz
dd4474f3c3 WiP: Massive refactor in module-bsp, cleaned up include paths and compilation warnings/errors 2019-08-08 10:27:45 +02:00
Mateusz
36d2e45e6b Merge remote-tracking branch 'origin/master' into module-cell 2019-07-03 14:35:37 +02:00
Mati
3714b4e6db PowerUp sequence tests 2019-06-18 15:55:24 +02:00
Mati
6487c1d60d WiP: implementing RT1051 cellular driver
Cleaned up BSP layer
2019-06-17 12:04:22 +02:00