-
-
Notifications
You must be signed in to change notification settings - Fork 600
Persistent Memory
This is part of the RTC (Real Time Clock) subsystem, inside the LPC43xx chip on the Portapack hardware.
The RTC subsystem keeps the actual clock (date / time) running, powered by a back up coin battery (which needs to be installed on the portapack board),even when the unit is not connected to an USB power source. And on top of this RTC functionality, the same coin battery will keep persistent a small region of VBAT-maintained SRAM (0x40041000, 256 bytes) for saving system state settings when the device is powered off.
The persistent memory map is defined at /firmware/chibios-portapack/os/hal/platforms/LPC43xx/lpc43xx.inc
:
**LPC_RTC_DOMAIN_BASE** (0x40040000)
**LPC_ALARM_TIMER_BASE** (LPC_RTC_DOMAIN_BASE + 0x0000)
**LPC_BACKUP_REG_BASE** (LPC_RTC_DOMAIN_BASE + 0x1000) <-backup_ram region!
**LPC_POWER_MODE_CTRL_BASE** (LPC_RTC_DOMAIN_BASE + 0x2000)
**LPC_CREG_BASE** (LPC_RTC_DOMAIN_BASE + 0x3000)
**LPC_EVENT_ROUTER_BASE** (LPC_RTC_DOMAIN_BASE + 0x4000)
**LPC_OTP_CTRL_BASE** (LPC_RTC_DOMAIN_BASE + 0x5000)
**LPC_RTC_BASE** (LPC_RTC_DOMAIN_BASE + 0x6000)
The backup_ram region is a small amount of ram (only 256 bytes), defined in /firmware/common/memory_map.hpp
using the LPC_BACKUP_REG_BASE label, thus starting at address 0x40041000
The Portapack firmware uses the backup_ram region to store several uint32_t (and one uint64_t) variables, inside a struct, called "data_t", declared on /firmware/common/portapack_persistent_memory.cpp
Found in original portapack, but only carrying a few configuration variables, it was later expanded by furrtek's HAVOC version, incorporating several new configuration parameters.
Among those new variables, there is a uint32_t config_t
used as storage for a few boolean flags.
On MAYHEM's version, we've added two new boolean configuration parameters, particularly useful for H1 users including "Speaker is present" and "Back Buttons on menus".
You can find them implemented as two new configuration checkboxes inside OPTIONS->UI.
These two new boolean parameters have been added into the uint32_t ui_config
variable, Which now it is mapped as following:
- 31 (HAVOC)Splash screen
- 30 (HAVOC)Login
- 29 (HAVOC)Start in stealth mode
- 28 (MAYHEM H1 Branch)Place a back ("..") button in each menu
- 27 (MAYHEM H1 Branch)Use speaker output (H1 model accepts a speaker)
They can be reached from anywhere by adding (if not already there) this include:
#include "portapack_persistent_memory.hpp"
and then you can check the configuration status for each parameter with:
portapack::persistent_memory::config_backbutton()
and
portapack::persistent_memory::config_speaker()
They return either TRUE or FALSE, depending on how they've been configured.
Note
The wiki is incomplete. Please add content and collaborate.
Important
- This is a public wiki. Everything is visible to everyone. Don't use it for personal notes.
- Avoid linking to external tutorials/articles; they may become outdated or contain false information.
How to collaborate
How to ask questions correctly
- First steps
- Usage cautions
- Intended use and Legality
- Features
- PortaPack Versions (which one to buy)
- HackRF Versions
- Firmware update procedure
- Description of the hardware
- User interface
- Powering the PortaPack
-
Troubleshooting
- Won't boot
- Config Menu
- Firmware upgrade
- Diagnose firmware update in Windows
- Receive Quality Issues
- No TX/RX
- TX Carrier Only
- H2+ speaker modifications
- Dead Coin Cell Battery
- Factory Defaults
- SD card not recognized by PC with the SD-card over USB selected
- DFU overlay
- Full reset
- SolveBoard
- How to Format SDCard
- Applications
-
Compilation of the firmware
- Compile on WSL with ninja
- How to compile on Windows faster with WSL 2
- Using Docker and Kitematic
- Docker command-line reference
- Using Buddyworks and other CI platforms
- Notes for Buddy.Works (and other CI platforms)
- Using ARM on Debian host
- All in one script for ARM on Debian host
- Compile on Arch based distro (exclude Asahi)
- Dev build versions
- Notes About ccache
- Create a custom map
- Code formatting
- PR process
- Description of the Structure
- Software Dev Guides
- Tools
- Research
- UI Screenshots
- Maintaining
- Creating a prod/stable release (Maintainers only)
- Maintaining rules
- Development States Notes