mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-14 02:28:30 -04:00
Page:
Create a simple external app
Pages
2 Tone RX
2 Tone TX
2048
3d printed enclosure
ACARS
ADS B(S)
AFSK
AIS Boats
APRS RX
APRS TX
About firmwares
Access Radio Hardware
Add GPIO to H2
Adult Toys
Analog TV Receiver
Antennas
Applications
At first glance
Audio Receivers
Automatic dependent surveillance–broadcast (ADS B)
BHT
BLESpam
Battleship
Bitmap reverse decode
Blackjack
Bluetooth Low Energy Receiver
Bluetooth Low Energy Transmitter
Boot Process
Breakout
Burger Pager
C16 format
CVS Spam
Calculator
Capture
Care
Cart Lock
ChibiOS Notes
Clifford's version
Code contribution rules
Code formatting
Compile firmware
Compile on Arch based distro (exclude Asahi)
Compile on WSL with ninja
Completely reset
Config Menu
Contributing Guidelines
Contributors
Create a Custom Map with Offline Map Maker
Create a Simple App
Create a custom splash screen
Create a custom splash screenhome
Create a simple external app
Creating a prod stable release
DFU overlay
Dead Coin Cell Battery
Debug via SWD & JTAG
Debug with serial
Debug
Decoder for NRF24L01
Description of the Structure
Detector
Dev build versions
Diagnose firmware update in Windows
Differences Between H1 and H2 models
Digital Rain
Dino Game
Dissecting the Temperature logger
Documentation Standards & Guidelines
Doom
EPIRB RX (Emergency Position‐Indicating Radio Beacon Receiver)
EPIRB RX
EPIRB TX
ERT
Encoder
External App Roadmap
External apps informations
FAQ
FLEX TX
FPV Detect
Factory Defaults
Features
File manager
Firmware Architecture
First steps
Flash Mayhem onto bare HackRF
Flash Utility
Flex RX
FlipperTX
Fox Hunt
Freq manager
Freqman manager
Full reset
GPS Sim
GSG hackrf
GUI Widget Preview
Games
General Compiling Guide (Linux)
H2 Enclosure
H2 PLUS RESET and DFU push buttons fix
H2 Plus speaker modifications
HackRF Pro
HackRF
Hardware overview
Help! Im not receiving anything! Receive Quality Issues
Home
Hopper
How to Format SDCard
How to ask questions in correct way
How to collaborate
How to compile faster with WSL 2
I2C external device driver integration
IQ trim
Information on APRS
Intended Use and Legality
Internal speaker
Interpret Guru meditation crashes
Jammer
KISS TNC
KeeLoq TX
Key fob TX
Keyboard view
LCR
LGE Tool
Level
Looking Glass
MDC TX
MDC 1200 TX
Main Controls
Main Menu
Maintaining rules
Make airlines db
Make icao24 db
Meteor
Metronome
Microphone Tranceiver
Microphone Transceiver
Morse P
Morse RX
Morse TX
NOAA
No TX or RX
Notepad
Notes About ccache
OOK Brute
OOK Editor
OOK
Original GSG HackRF One
P25 TX
POCSAG Receiver
POCSAG TX
PR process
Pac‐Man
Persistent Memory
Playlist Editor
Playlist
PortaPack Versions
Powering the PortaPack
Preamplifier IC replacement
ProtoView
Push buttons and button caps
RDS
RTTY RX
RTTY TX
Radio
Radiosonde
Random password
Receivers
Receviers 2‐Tone‐RX
Recon
Redirections
Remote
Replay
SAME TX
SD Card (DEV)
SD Card Content
SD Over USB
SD card not recognized by PC with the SD card over USB selected
SMA connector replacement or removal
SSTV RX
SSTV
Scanner
Screenshots
Search
Security Plus TX
Settings
Signal Generator
Signal Hunter
Sleep mode
Snake
Software Dev Guides
Soundboard
Space Invaders
Spectrum Painter
Splash and other images
Stealth Mode
Stopwatch
SubCar
SubGhzD
TPMS RX
TPMS TX
TX Carrier Only
Tetra RX
Tetris
Text Entry
Theme system
Time Sink
Title Bar
TouchTunes
Transceivers
Transmitters
Troubleshooting
Trusted Contributors
Tuner
UI Screenshots
UI positioning with macros
USB Serial Console
USB‐C charging modification for older HackRF boards
Unit Tests
Update firmware for more detailed information
Update firmware troubleshooting
Update firmware
Updating the Xilinx CPLD on hackrf board
Usage cautions
User interface
Using MAC OS
Utilities
VOR Navigation
WardriveMap
Waterfall Designer
Wav viewer
Weather
WeatherFax
Web USB Serial
What if I don't like some of the apps
Widgets
Wipe SD Card
Won't boot
Won
Wont boot
Work Needed
World map generation
etak
gfxEQ
imagemagick.org
waterfalls color schemes
No results
6
Create a simple external app
NotPike edited this page 2026-01-06 19:43:12 -08:00
Table of contents
Workflow
- create a new subdir with your app name in firmware/applications/external, like firmware/applications/new_external_app
- create your empty hpp and cpp basic structure. It must contain a main.cpp and at least two other files, example:
main.cpp:
/*
* Copyright (C) 2023 Bernd Herzog
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "ui.hpp"
#include "ui_new_external_app.hpp"
#include "ui_navigation.hpp"
#include "external_app.hpp"
namespace ui::external_app::ui_new_external_app {
void initialize_app(ui::NavigationView& nav) {
nav.push<NewExternalAppView>();
}
} // namespace ui::external_app::ui_new_external_app
extern "C" {
__attribute__((section(".external_app.app_ui_new_external_app.application_information"), used)) application_information_t _application_information_ui_new_external_app = {
/*.memory_location = */ (uint8_t*)0x00000000,
/*.externalAppEntry = */ ui::external_app::ui_new_external_app::initialize_app,
/*.header_version = */ CURRENT_HEADER_VERSION,
/*.app_version = */ VERSION_MD5,
/*.app_name = */ "NewExternalApp",
/*.bitmap_data = */ {
0x54,
0x15,
0x54,
0x15,
0xFF,
0x7F,
0xFC,
0x1F,
0xFF,
0x7F,
0xCC,
0x19,
0xAF,
0x7A,
0x6C,
0x1B,
0xEF,
0x7B,
0xEC,
0x1B,
0xFF,
0x7F,
0xFC,
0x1F,
0xFF,
0x7F,
0x54,
0x15,
0x54,
0x15,
0x00,
0x00,
},
/*.icon_color = */ ui::Color::cyan().v,
/*.menu_location = */ app_location_t::DEBUG,
/*.desired_menu_position = */ -1,
/*.m4_app_tag = portapack::spi_flash::image_tag_none */ {0, 0, 0, 0},
/*.m4_app_offset = */ 0x00000000, // will be filled at compile time
};
}
new_external_app.hpp:
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2018 Furrtek
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef __UI_NEW_EXTERNAL_APP_H__
#define __UI_NEW_EXTERNAL_APP_H__
namespace ui::external_app::new_external_app {
class NewExternalAppView : public View {
public:
NewExternalAppView(NavigationView& nav);
void focus() override;
std::string title() const override { return "NEwExternalApp"; };
private:
NavigationView& nav_;
Text text_widget{
{0 * 8, 19 * 8, 30 * 8, 16},
""};
Button button_exit{
{22 * 8, 34 * 8, 8 * 8, 32},
"Exit"};
};
} // namespace ui::external_app::new_external_app
#endif /*__UI_NEW_EXTERNAL_APP_H__*/
new_external_app.cpp:
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2018 Furrtek
*
* This file is part of PortaPack.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "ui_new_external_app.hpp"
namespace ui::external_app::new_external_app {
NewExternalAppView::NewExternalAppView(NavigationView& nav)
: nav_{nav} {
add_children({&dump_output,
&button_exit});
button_exit.on_select = [this](Button&) {
nav_.pop();
};
}
void NewExternalAppView::focus() {
button_exit.focus();
}
} // namespace ui::external_app::new_external_app
- replace app_location_t in main.cpp by the place you want your app (RX, TX, DEBUG, UTILITIES, HOME)
- don't forget adjust header guard, class name, external namespace according to your new app name
- don't forget to adjust the /*.m4_app_tag = portapack::spi_flash::image_tag_none */ {0, 0, 0, 0}, line in main.cpp to use the needed baseband if ever. You can find the list in firmware/common/spi_image.hpp. If your app is using multiple basebands, you have to put here the biggest possibe one (usually NFM)
- change bitmap icon, copy the one you want from firmware/applications/bitmap.hpp
- if you used the example files, replace all occurrences of new_external_app by your new app name and NewExternalAppView by your new class name
- edit external.ld and add a new address line in the first board, incrementing the address. Example:
ram_external_app_new_external_app (rwx) : org = 0xADDF0000, len = 32k"
- still in external.ld, add a new external bloc in SECTION. Example:
.external_app_new_external_app : ALIGN(4) SUBALIGN(4)
{
KEEP(*(.external_app.app_new_external_app.application_information));
*(*ui*external_app*new_external_app*);
} > ram_external_app_new_external_app
- in external.cmake, add a block to EXTCPPSRC with your source, example:
# new_external_app
external/new_external_app/main.cpp
external/new_external_app/new_external_app.cpp
- in external.cmake, add a line with your app name in the EXTAPPLIST block, example:
new_external_app
- done, you can now build the firmware and your new external app will be built along with it
- flash the ppfw via the hackrf.app website or copy it to the sdcard and use the on device flasher
Online example
User aquilestraigo who contributed the OOK Editor app also made a nice page on his adventure creating an external app.
You can check it here: https://blog.hawktesters.com/rookremote-on-off-keying-for-to-portapack-hackrf/
It's pretty explanatory, and you will maybe find there some explanations you missed here.
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Start here
Contributors
How to collaborate
Contributing Guidelines
Trusted contributors
How to ask questions correctly
Hardware
- PortaPack Versions (which one to buy)
- Features
- HackRF Versions
- Description of the hardware
- Enclosure/cases
- Repairs
- Mods
User manual
Intended use and Legality
- Usage cautions
- First steps
- Firmware update procedure
- 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
- 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
- What if I don't like some of the apps
Applications
- 📥 Receivers
- 2-Tone-RX
- ACARS
- ADS-B
- AFSK
- AIS Boats
- Analog TV
- APRS RX
- Audio
- BLE RX
- Detector
- EPIRB RX
- ERT Meter
- Flex RX
- Radio
- Fox-Hunt
- FPV-Detect
- gfxEQ
- Level
- Meteor
- Morse RX
- NOAA
- NRF
- POCSAG
- ProtoView
- Radiosonde
- RTTY RX
- Scanner
- Search
- Signal Hunter
- SSTV RX
- SubCar
- SubGhzD
- Tetra RX
- Time Sink
- TPMS RX
- Weather
- WeFax
- VOR RX
- 📤 Transmitters
- 2-Tone-TX
- ADS-B(S) TX
- Adult Toys
- APRS TX
- BHT Xy/EP
- BLE TX
- BLESpam
- Burger Pager
- CVS Spam
- EPIRB TX
- Flex TX
- FlipperTX
- GPS Sim
- Hopper
- Jammer
- KeeLoq TX
- Key fob TX
- LGE Tool
- MDC-1200 TX
- Morse TX
- OOK
- OOK Brute
- OOK Editor
- P25 TX
- POCSAG TX
- RDS
- RTTY TX
- SAME TX
- Security+ TX
- Signal gen
- Soundboard
- Spectrum Painter
- SSTV
- TEDI/LCR
- TouchTunes
- TPMS TX
- VOR TX
- 🔄 Transceivers
- 🟡 Recon
- 🔴 Capture
- ▶️ Replay
- 🖲️ Remote
- 🔍 Looking Glass
- 🛠️ Utilities
- 🎮 Games
- ⚙️ Settings
- 💻 HackRF Mode
Misc
Developer Manual
- 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), or other weird distros
- 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