Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/debug details #37

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ define VS_LAUNCH
"request": "launch",
"servertype": "stutil",
"cwd": "$${workspaceRoot}",
"gdbPath": "${ARM_GCC_PATH}/arm-none-eabi-gcc",
Copy link
Member

@LucasHaug LucasHaug Apr 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Não deveria ser gdb aqui @marcoabensur??

Suggested change
"gdbPath": "${ARM_GCC_PATH}/arm-none-eabi-gcc",
"gdbPath": "${ARM_GCC_PATH}/arm-none-eabi-gdb",

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdade, devia

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E tava vendo aqui, acho que não precisa do caminho completo

Suggested change
"gdbPath": "${ARM_GCC_PATH}/arm-none-eabi-gcc",
"gdbPath": "arm-none-eabi-gdb",

"executable": "./$(BUILD_DIR)/$(BUILD_TARGET_BASE_NAME).elf",
"name": "Cortex Debug (ST-Util)",
"device": "$(DEVICE)",
Expand All @@ -403,6 +404,7 @@ define VS_LAUNCH
"request": "launch",
"servertype": "jlink",
"cwd": "$${workspaceRoot}",
"gdbPath": "${ARM_GCC_PATH}/arm-none-eabi-gcc",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"gdbPath": "${ARM_GCC_PATH}/arm-none-eabi-gcc",
"gdbPath": "arm-none-eabi-gdb",

"executable": "./$(BUILD_DIR)/$(BUILD_TARGET_BASE_NAME).elf",
"name": "Cortex Debug (J-Link)",
"device": "$(DEVICE)",
Expand All @@ -425,10 +427,10 @@ define VS_CPP_PROPERTIES
$(subst -D,$(NULL),$(subst $(SPACE),$(COMMA),$(strip $(foreach def,$(C_DEFS),"$(def)"))))
],

"compilerPath": "$${env:ARM_GCC_PATH}/arm-none-eabi-gcc",
"compilerPath": "${ARM_GCC_PATH}/arm-none-eabi-gcc",
"cStandard": "c99",
"cppStandard": "c++14",
"intelliSenseMode": "clang-x64"
"intelliSenseMode": "linux-gcc-arm"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"intelliSenseMode": "linux-gcc-arm"
"intelliSenseMode": "gcc-arm"

}
],
"version": 4
Expand Down
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ alguns arquivos de configuração.

* [GNU Arm Embedded Toolchain](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads)
> É necessário que a pasta `bin` dessa instalação esteja no `PATH`
> e numa variável de ambiente `ARM_GCC_PATH`
> e numa variável de ambiente `ARM_GCC_PATH` (e.g: `export ARM_GCC_PATH="/home/user/gcc-arm-none-eabi-10-2020-q4-major/bin"`)

* uncrustify
> Linux: `sudo apt install uncrustify`
Expand Down Expand Up @@ -227,4 +227,23 @@ Note que o nome do teste não inclui a extensão do arquivo.

## Debug

> Em breve
É necessário o download da ferramenta [stlink-tools](https://github.com/stlink-org/stlink):
LucasHaug marked this conversation as resolved.
Show resolved Hide resolved

```bash
sudo apt install stlink-tools
```

Isso instalará no sistema a ferramenta "st-utils", que será usada pela extensão [Cortex-Debug](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug) para o debug no VScode.

O arquivo _.vscode/launch.json_ gerado quando rodamos o comando

```bash
make vs_files
```
Possui configurações que são utilizadas por essa extensão para debugar o código em questão na placa.

Para inicializar o _debugger_, vá na aba "Run and Debug" na lateral esquerda do VSCode, e clique no simbolo de "Play" no topo da tela.

O comando do Makefile cria duas configurações de Debug. Uma para ser utilizada com o ST-Utils e outra com o J-link. Fica a critério de qual gravador está utilizando na placa.

> Completar com mais detalhes