mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 05:38:35 -07:00
Temporarily backport app updates from apps repo
This commit is contained in:
1
applications/external/swd_probe/adi.c
vendored
1
applications/external/swd_probe/adi.c
vendored
@@ -789,6 +789,7 @@ static const struct dap_part_nums {
|
||||
"Denver PMU",
|
||||
"(Performance Monitor Unit)",
|
||||
},
|
||||
/* https://github.com/stlink-org/stlink/blob/develop/doc/devices_boards.md */
|
||||
{0x20, 0x410, "STM32F10 (med)", "(ROM Table)"},
|
||||
{0x20, 0x411, "STM32F2", "(ROM Table)"},
|
||||
{0x20, 0x412, "STM32F10 (low)", "(ROM Table)"},
|
||||
|
||||
@@ -5,10 +5,12 @@ App(
|
||||
entry_point="swd_probe_app_main",
|
||||
requires=["notification", "gui", "storage", "dialogs", "cli"],
|
||||
stack_size=2 * 1024,
|
||||
order=10,
|
||||
resources="resources",
|
||||
fap_icon="icons/app.png",
|
||||
fap_category="GPIO",
|
||||
fap_icon_assets="icons",
|
||||
fap_author="@g3gg0 & (fixes by @xMasterX)",
|
||||
fap_version="1.0",
|
||||
fap_version="1.1",
|
||||
fap_description="ARM SWD (Single Wire Debug) Probe",
|
||||
)
|
||||
|
||||
1
applications/external/swd_probe/resources/apps_data/swd/100us.swd
vendored
Normal file
1
applications/external/swd_probe/resources/apps_data/swd/100us.swd
vendored
Normal file
@@ -0,0 +1 @@
|
||||
swd_clock_delay 100
|
||||
6
applications/external/swd_probe/resources/apps_data/swd/call_test_1.swd
vendored
Normal file
6
applications/external/swd_probe/resources/apps_data/swd/call_test_1.swd
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
message 0 "gonna call call_test_2" dialog
|
||||
|
||||
call call_test_2
|
||||
|
||||
message 0 "back now" dialog
|
||||
7
applications/external/swd_probe/resources/apps_data/swd/call_test_2.swd
vendored
Normal file
7
applications/external/swd_probe/resources/apps_data/swd/call_test_2.swd
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
# first do a beeeeeep
|
||||
beep 1
|
||||
|
||||
message 0 "Seems to work" dialog
|
||||
|
||||
beep 0
|
||||
6
applications/external/swd_probe/resources/apps_data/swd/dump_0x00000000_1k.swd
vendored
Normal file
6
applications/external/swd_probe/resources/apps_data/swd/dump_0x00000000_1k.swd
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
ap_select 0
|
||||
max_tries 50
|
||||
block_size 4
|
||||
mem_dump /ext/apps_data/swd/flash.bin 0x00000000 0x100000 2
|
||||
beep 1
|
||||
message 5 "Reading sucessful"
|
||||
6
applications/external/swd_probe/resources/apps_data/swd/dump_0x00000000_4b.swd
vendored
Normal file
6
applications/external/swd_probe/resources/apps_data/swd/dump_0x00000000_4b.swd
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
ap_select 0
|
||||
max_tries 50
|
||||
block_size 4
|
||||
mem_dump /ext/swd_scripts/flash.bin 0x00000000 0x100000 2
|
||||
beep 1
|
||||
message 5 "Reading sucessful"
|
||||
6
applications/external/swd_probe/resources/apps_data/swd/dump_STM32.swd
vendored
Normal file
6
applications/external/swd_probe/resources/apps_data/swd/dump_STM32.swd
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
ap_select 0
|
||||
max_tries 50
|
||||
block_size 1024
|
||||
mem_dump /ext/swd_scripts/flash.bin 0x08000000 0x100000 2
|
||||
beep 1
|
||||
message 0 "Reading finished" dialog
|
||||
7
applications/external/swd_probe/resources/apps_data/swd/goto_test.swd
vendored
Normal file
7
applications/external/swd_probe/resources/apps_data/swd/goto_test.swd
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
beep 1
|
||||
goto l2
|
||||
.label l1
|
||||
beep 0
|
||||
.label l2
|
||||
beep 1
|
||||
goto l1
|
||||
11
applications/external/swd_probe/resources/apps_data/swd/halt.swd
vendored
Normal file
11
applications/external/swd_probe/resources/apps_data/swd/halt.swd
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
# make sure errors do not cause a script abort
|
||||
errors ignore
|
||||
|
||||
message 0 "HAMMER TIME! Trying to halt CPU"
|
||||
ap_select 0
|
||||
|
||||
# loop writing the halt bits
|
||||
.label l1
|
||||
mem_write 0xE000EDF0 0xA05F0003
|
||||
goto l1
|
||||
8
applications/external/swd_probe/resources/apps_data/swd/reset.swd
vendored
Normal file
8
applications/external/swd_probe/resources/apps_data/swd/reset.swd
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
errors ignore
|
||||
status 0
|
||||
message 0 "HAMMER TIME! Try to halt the CPU"
|
||||
.label l1
|
||||
ap_select 0
|
||||
mem_write 0xE000EDF0 0xA05F0001
|
||||
mem_write 0xE000ED0C 0x05FA0004
|
||||
goto l1
|
||||
3
applications/external/swd_probe/resources/apps_data/swd/test_write.swd
vendored
Normal file
3
applications/external/swd_probe/resources/apps_data/swd/test_write.swd
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
mem_write 0x20002000 0xdeadbeef
|
||||
mem_write 0xE000EDF0 0xA05F0001
|
||||
mem_write 0xE000EDF0 0xA05F0007
|
||||
12
applications/external/swd_probe/swd_probe_app.c
vendored
12
applications/external/swd_probe/swd_probe_app.c
vendored
@@ -2,10 +2,13 @@
|
||||
|
||||
#include "swd_probe_app.h"
|
||||
#include "swd_probe_icons.h"
|
||||
#include <assets_icons.h>
|
||||
#include "jep106.h"
|
||||
#include "adi.h"
|
||||
|
||||
#include <toolbox/path.h>
|
||||
|
||||
#include <assets_icons.h>
|
||||
|
||||
#define SWD_PATH EXT_PATH("apps_data/swd")
|
||||
|
||||
static void render_callback(Canvas* const canvas, void* cb_ctx);
|
||||
@@ -944,19 +947,16 @@ static bool swd_scriptfunc_goto(ScriptContext* ctx) {
|
||||
return true;
|
||||
}
|
||||
|
||||
#include <toolbox/path.h>
|
||||
|
||||
static bool swd_scriptfunc_call(ScriptContext* ctx) {
|
||||
DBGS("call");
|
||||
|
||||
swd_script_skip_whitespace(ctx);
|
||||
|
||||
/* fetch previous file directory */
|
||||
char filename[MAX_FILE_LENGTH];
|
||||
FuriString* filepath = furi_string_alloc();
|
||||
path_extract_dirname(ctx->filename, filepath);
|
||||
// strncpy(filename, ctx->filename, sizeof(filename));
|
||||
|
||||
char filename[MAX_FILE_LENGTH] = {};
|
||||
bool success = false;
|
||||
do {
|
||||
/* append filename */
|
||||
@@ -964,8 +964,10 @@ static bool swd_scriptfunc_call(ScriptContext* ctx) {
|
||||
swd_script_log(ctx, FuriLogLevelError, "failed to parse filename");
|
||||
break;
|
||||
}
|
||||
furi_string_cat_printf(filepath, "/%s", filename);
|
||||
|
||||
swd_script_seek_newline(ctx);
|
||||
|
||||
/* append extension */
|
||||
furi_string_cat_str(filepath, ".swd");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user