Skip to content
Snippets Groups Projects
Commit 120c0e24 authored by Jakob's avatar Jakob
Browse files

Fix directory structure, add config for debugging simple-uart-transmit on real HW

parent f5e4f952
No related branches found
No related tags found
1 merge request!1copied and adapted example from mdk, added init and config uart
Showing
with 61 additions and 0 deletions
File added
File moved
File moved
target extended-remote :3333
set remote hardware-watchpoint-limit 2
mon reset halt
flushregs
add-symbol-file ../esp32c3_rev3_rom.elf
file ./firmware.elf
\ No newline at end of file
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug on real board",
"type": "gdb",
"request": "attach",
"cwd": "${workspaceRoot}",
"valuesFormatting": "parseText",
"target": "extended-remote 127.0.0.1:3333",
"executable": "./firmware.elf",
"autorun": [
"add-symbol-file ./firmware.elf",
"add-symbol-file ../esp32c3_rev3_rom.elf",
"set remote hardware-watchpoint-limit 2",
"mon reset halt",
"maintenance flush register-cache",
],
"gdbpath": "riscv32-unknown-elf-gdb"
}
]
}
\ No newline at end of file
TOOLCHAIN=riscv32-unknown-elf
EXTRA_CFLAGS ?= -Og -g
SOURCES = main.c esp32-c3-uart-interface.c SOURCES = main.c esp32-c3-uart-interface.c
include $(MDK)/$(ARCH)/build.mk include $(MDK)/$(ARCH)/build.mk
#!/usr/bin/env bash
set -eo pipefail
# In case previous instance still lingers
killall openocd || true
make build
# Use espressif's openocd for now
source ../../esp-idf/export.sh
openocd -f board/esp32c3-builtin.cfg -c "program_esp firmware.bin 0x10000 verify"
OPENOCD_PID=$!
_term() {
echo "Caught signal!"
kill -TERM "$OPENOCD_PID"
killall openocd
}
trap _term SIGTERM
trap _term SIGINT
#dir=$(pwd)
#echo "LAUNCHING GDB!"
#riscv32-unknown-elf-gdb -x .gdbinit ./firmware.elf
\ No newline at end of file
...@@ -6,9 +6,13 @@ ...@@ -6,9 +6,13 @@
int main(void) { int main(void) {
wdt_disable(); wdt_disable();
while(1){
delay_ms(1000);
init_uart(); init_uart();
config_uart(); config_uart();
enable_uart_transmitter(); enable_uart_transmitter();
delay_ms(1000);
}
return 0; return 0;
} }
\ No newline at end of file
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment