Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Commit

Permalink
Some build automation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jngo102 committed Jan 10, 2023
1 parent 8a6bb4e commit 92cdcc2
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "gdb-multiarch -q -x openocd.gdb"
runner = "probe-run --chip RP2040"
rustflags = [
"-C", "linker=flip-link",
"-C", "link-arg=--nmagic",
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Cargo.lock
target/

*.log
*.svd

# editor files
.vscode/*
Expand Down
58 changes: 58 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"version": "0.2.0",
"inputs": [
{
"type": "pickString",
"id": "exampleName",
"description": "Which example would you like to run?",
"options": [
"graphics",
"music"
],
"default": "music"
},
{
"type": "pickString",
"id": "configuration",
"description": "Choose a configuration",
"default": "debug",
"options": [
"debug",
"release",
]
}
],
"configurations": [
{
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/${input:exampleName}",
"name": "Pico Debug",
"request": "launch",
"type": "cortex-debug",
"gdbPath": "gdb-multiarch",
"gdbTarget": "localhost:3333",
"servertype": "openocd",
"configFiles": [
"interface/picoprobe.cfg",
"interface/cmsis-dap.cfg",
"target/rp2040.cfg"
],
"searchDir": [],
"runToEntryPoint": "main",
"showDevDebugOutput": "none",
"svdFile": "rp2040.svd",
"svdPath": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd",
"preLaunchTask": "Build Debug",
"preLaunchCommands": [
"monitor init",
"monitor reset init",
"monitor halt"
],
"postRestartCommands": [
"break main",
"continue"
]
}

]
}
44 changes: 38 additions & 6 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"type": "promptString",
"id": "thumbyLocation",
"description": "What drive is your Thumby mounted to (e.g. D:/)?",
"default": "E:/"
}
"default": "D:/"
},
],
"tasks": [
{
"label": "Build Debug",
"label": "1Debug",
"type": "shell",
"command": "cargo",
"args": [
Expand All @@ -39,6 +39,26 @@
},
"problemMatcher": "$rustc"
},
{
"label": "Run Debug",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--example",
"${input:exampleName}",
"--target",
"thumbv6m-none-eabi"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always"
},
"problemMatcher": "$rustc"
},
{
"label": "Build Release",
"type": "shell",
Expand All @@ -61,7 +81,19 @@
"problemMatcher": "$rustc"
},
{
"label": "elf2uf2 Example",
"label": "elf2uf2 Example (Debug)",
"type": "shell",
"command": "elf2uf2-rs",
"args": [
"${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/${input:exampleName}"
],
"problemMatcher": [
"$rustc"
],
"dependsOn": "Build Debug"
},
{
"label": "elf2uf2 Example (Release)",
"type": "shell",
"command": "elf2uf2-rs",
"args": [
Expand All @@ -83,7 +115,7 @@
"problemMatcher": [
"$rustc"
],
"dependsOn": "elf2uf2 Example"
}
"dependsOn": "elf2uf2 Example (Release)"
},
]
}
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords = ["thumby", "tiny-circuits", "rp2040", "embedded"]
license = "Apache-2.0"
name = "thumby"
repository = "https://github.com/jngo102/thumby-rs"
version = "0.0.1"
version = "0.0.2"

[badges]
circle-ci = { repository = "jngo102/thumby-rs", branch = "main" }
Expand Down
23 changes: 23 additions & 0 deletions openocd.gdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# connect to OpenOCD on TCP port 3333
target extended-remote :3333

# print demangled function/variable symbols
set print asm-demangle on

# set backtrace limit to not have infinite backtrace loops
set backtrace limit 32

# detect unhandled exceptions, hard faults and panics
break DefaultHandler
break HardFault

# *try* stopping at the user entry point (it might be gone due to inlining)
break main

monitor arm semihosting enable

# load the application binary onto the Pico's flash
load

# start the process but immediately halt the processor
stepi

0 comments on commit 92cdcc2

Please # to comment.