Temporarily backport app updates from apps repo

This commit is contained in:
Willy-JL
2023-11-12 11:06:02 +00:00
parent 79e7f491fe
commit e309fa8a88
1498 changed files with 1325977 additions and 20227 deletions

View File

@@ -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)"},

View File

@@ -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",
)

View File

@@ -0,0 +1 @@
swd_clock_delay 100

View File

@@ -0,0 +1,6 @@
message 0 "gonna call call_test_2" dialog
call call_test_2
message 0 "back now" dialog

View File

@@ -0,0 +1,7 @@
# first do a beeeeeep
beep 1
message 0 "Seems to work" dialog
beep 0

View 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"

View 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"

View 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

View File

@@ -0,0 +1,7 @@
beep 1
goto l2
.label l1
beep 0
.label l2
beep 1
goto l1

View 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

View 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

View File

@@ -0,0 +1,3 @@
mem_write 0x20002000 0xdeadbeef
mem_write 0xE000EDF0 0xA05F0001
mem_write 0xE000EDF0 0xA05F0007

View File

@@ -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");