Hi all,
Currently, I am working on one project based on freertos and stm32 hal, but now i decided to switch that project to chibios RT/hal.
I have used Chibi Studio for a basic understanding of how to compile and create board files,s, etc.
now I want to use chibios in the VS code environment.
can anyone help me to set up a toolchain for this?
thanks in advance
Chibios projecct compilation in VScode
Moderators: tfAteba, barthess, RoccoMarco, lbednarz, utzig
- Giovanni
- Site Admin
- Posts: 14563
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1111 times
- Been thanked: 937 times
- Contact:
Re: Chibios projecct compilation in VScode
Hi,
It has been done but I don't know details,you could join the discord server and ask there to Vitaly.
https://discord.gg/s8b8v7VtrM
Anyway, ChibiOS is based on makefiles, I assume VSCode can import makefile projects like Eclipse does.
Giovanni
It has been done but I don't know details,you could join the discord server and ask there to Vitaly.
https://discord.gg/s8b8v7VtrM
Anyway, ChibiOS is based on makefiles, I assume VSCode can import makefile projects like Eclipse does.
Giovanni
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: Chibios projecct compilation in VScode
Hi all,
Mainly if your project if base on makefile, there will be no problem to compile it, just by running the make command in a terminal.
You will need to install some pluging (C, C++, cortext debug) this will help you to view some ARM registers.
But to debug you will need to create a vscode configuration file (launch.json), in this file you will have to specify all mandatories information for debug (openocd/stlink, svd file for STM23 registers, configuration file, target file etc...)
Here is an example of a file that i used last year.
I hope it will help you!
Mainly if your project if base on makefile, there will be no problem to compile it, just by running the make command in a terminal.
You will need to install some pluging (C, C++, cortext debug) this will help you to view some ARM registers.
But to debug you will need to create a vscode configuration file (launch.json), in this file you will have to specify all mandatories information for debug (openocd/stlink, svd file for STM23 registers, configuration file, target file etc...)
Here is an example of a file that i used last year.
Code: Select all
{
"version": "0.2.0",
"configurations": [
{
"name": "Cortex debug",
"cwd": "${workspaceRoot}",
"executable": "./build/x237.elf",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"device": "STM32L452RE",
"svdFile": "/opt/st/stm32cubeide_1.9.0/plugins/com.st.stm32cube.ide.mcu.productdb.debug_2.0.200.202201061234/resources/cmsis/STMicroelectronics_CMSIS_SVD/STM32L4x2.svd",
"configFiles": [
"interface/stlink.cfg",
"target/stm32l4x.cfg"
]
},
{
"name": "C/C++: arm-none-eabi-gcc build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true,
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: arm-none-eabi-gcc build active file",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
I hope it will help you!
regards,
Theo.
Theo.
Re: Chibios projecct compilation in VScode
Thank you for your prompt reply.
I understand that the project is based on Makefile, and I can compile the code in VS Code as well.
However, my challenge lies in not knowing how to set the environment variables in VS Code. In Chibistudio, we typically run a BAT file to set all the necessary variables before opening Eclipse.
I understand that the project is based on Makefile, and I can compile the code in VS Code as well.
However, my challenge lies in not knowing how to set the environment variables in VS Code. In Chibistudio, we typically run a BAT file to set all the necessary variables before opening Eclipse.
-
- Posts: 6
- Joined: Tue Apr 09, 2024 7:11 am
- Location: India
Re: Chibios projecct compilation in VScode
Hey hi, install the ARM toolchain then ChibiOS repository in your project directory. Configure ChibiOS files and VS Code settings for ARM development.
Who is online
Users browsing this forum: No registered users and 7 guests