Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/test-configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ jobs:
arch: arm
config-file: ./config/examples/mcxw-tz.config

nxp_s32k142_test:
uses: ./.github/workflows/test-build.yml
with:
arch: arm
config-file: ./config/examples/nxp-s32k142.config

microchip_mpfs250_test:
uses: ./.github/workflows/test-build-riscv.yml
with:
Expand Down
6 changes: 6 additions & 0 deletions .vscode/arm-gdb-wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
# Wrapper script for arm-none-eabi-gdb that skips .gdbinit
# This is needed because cortex-debug doesn't support passing --nx to GDB

exec /opt/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gdb --nx "$@"

148 changes: 148 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Flash and Debug wolfBoot",
"type": "cortex-debug",
"request": "launch",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/wolfboot.elf",
"servertype": "external",
"gdbTarget": "127.0.0.1:7224",
"device": "S32K142",
"runToEntryPoint": "main",
"showDevDebugOutput": "raw",
"svdFile": "",
"gdbPath": "${workspaceFolder}/.vscode/arm-gdb-wrapper.sh",
"toolchainPath": "/opt/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin",
"toolchainPrefix": "arm-none-eabi",
"preLaunchTask": "Start PEMicro GDB Server",
"preLaunchCommands": [
"set mem inaccessible-by-default off"
],
"postLaunchCommands": [
"monitor reset halt",
"load factory.elf",
"add-symbol-file test-app/image.elf",
"monitor reset halt"
]
},
{
"name": "Flash and Debug wolfBoot (with UART)",
"type": "cortex-debug",
"request": "launch",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/wolfboot.elf",
"servertype": "external",
"gdbTarget": "127.0.0.1:7224",
"device": "S32K142",
"runToEntryPoint": "main",
"showDevDebugOutput": "raw",
"svdFile": "",
"gdbPath": "${workspaceFolder}/.vscode/arm-gdb-wrapper.sh",
"toolchainPath": "/opt/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin",
"toolchainPrefix": "arm-none-eabi",
"preLaunchTask": "Start GDB Server and UART",
"preLaunchCommands": [
"set mem inaccessible-by-default off"
],
"postLaunchCommands": [
"monitor reset halt",
"load factory.elf",
"add-symbol-file test-app/image.elf",
"monitor reset halt"
]
},
{
"name": "Recovery: Flash and Debug wolfBoot",
"type": "cortex-debug",
"request": "launch",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/wolfboot.elf",
"servertype": "external",
"gdbTarget": "127.0.0.1:7224",
"device": "S32K142",
"runToEntryPoint": "main",
"showDevDebugOutput": "raw",
"svdFile": "",
"gdbPath": "${workspaceFolder}/.vscode/arm-gdb-wrapper.sh",
"toolchainPath": "/opt/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin",
"toolchainPrefix": "arm-none-eabi",
"preLaunchTask": "Start GDB Server Recovery",
"preLaunchCommands": [
"set mem inaccessible-by-default off"
],
"postLaunchCommands": [
"load factory.elf",
"add-symbol-file test-app/image.elf",
"monitor reset halt"
]
},
{
"name": "Recovery: Flash and Debug wolfBoot (with UART)",
"type": "cortex-debug",
"request": "launch",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/wolfboot.elf",
"servertype": "external",
"gdbTarget": "127.0.0.1:7224",
"device": "S32K142",
"runToEntryPoint": "main",
"showDevDebugOutput": "raw",
"svdFile": "",
"gdbPath": "${workspaceFolder}/.vscode/arm-gdb-wrapper.sh",
"toolchainPath": "/opt/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin",
"toolchainPrefix": "arm-none-eabi",
"preLaunchTask": "Start GDB Server Recovery and UART",
"preLaunchCommands": [
"set mem inaccessible-by-default off"
],
"postLaunchCommands": [
"load factory.elf",
"add-symbol-file test-app/image.elf",
"monitor reset halt"
]
},
{
"name": "Flash Only wolfBoot",
"type": "cortex-debug",
"request": "launch",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/wolfboot.elf",
"servertype": "external",
"gdbTarget": "127.0.0.1:7224",
"device": "S32K142",
"showDevDebugOutput": "raw",
"svdFile": "",
"gdbPath": "${workspaceFolder}/.vscode/arm-gdb-wrapper.sh",
"toolchainPath": "/opt/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin",
"toolchainPrefix": "arm-none-eabi",
"preLaunchTask": "Start PEMicro GDB Server",
"preLaunchCommands": [
"set mem inaccessible-by-default off"
],
"postLaunchCommands": [
"monitor reset halt",
"load factory.elf",
"monitor reset run",
"quit"
]
},
{
"name": "Attach Only wolfBoot",
"type": "cortex-debug",
"request": "attach",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/wolfboot.elf",
"servertype": "external",
"gdbTarget": "127.0.0.1:7224",
"device": "S32K142",
"showDevDebugOutput": "raw",
"svdFile": "",
"gdbPath": "${workspaceFolder}/.vscode/arm-gdb-wrapper.sh",
"toolchainPath": "/opt/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin",
"toolchainPrefix": "arm-none-eabi",
"preLaunchTask": "Start PEMicro GDB Server"
}
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cortex-debug.gdbPath": "${workspaceFolder}/.vscode/arm-gdb-wrapper.sh",
"cortex-debug.armToolchainPath": "/opt/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin",
"cortex-debug.showDevDebugOutput": "raw"
}
42 changes: 42 additions & 0 deletions .vscode/start-pemicro-gdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
# Start PEMicro GDB Server for S32K142 debugging
#
# Usage: ./start-pemicro-gdb.sh [options]
#
# Options are passed directly to pegdbserver_console

PEMICRO_DIR="$HOME/.local/pemicro"
DEVICE="NXP_S32K1xx_S32K142F256M15"
INTERFACE="OPENSDA"
PORT="USB1"
SERVER_PORT="7224"
SPEED="5000"

# Set library path
export LD_LIBRARY_PATH="$PEMICRO_DIR/gdi:$PEMICRO_DIR/gdi/P&E:$LD_LIBRARY_PATH"

cd "$PEMICRO_DIR"

# Check if server is already running
if pgrep -f pegdbserver_console > /dev/null; then
echo "PEMicro GDB Server is already running. Stopping it first..."
pkill -f pegdbserver_console
sleep 1
fi

echo "Starting PEMicro GDB Server..."
echo " Device: $DEVICE"
echo " Interface: $INTERFACE"
echo " Port: $PORT"
echo " Server Port: $SERVER_PORT"
echo ""

./pegdbserver_console \
-startserver \
-device=$DEVICE \
-interface=$INTERFACE \
-port=$PORT \
-serverport=$SERVER_PORT \
-speed=$SPEED \
"$@"

Loading