Skip to content

Commit

Permalink
Improve Intellisense configuration by using cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
nedseb committed Sep 13, 2024
1 parent 8373962 commit 9b6d2fe
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 112 deletions.
23 changes: 5 additions & 18 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
"privileged": true,
"mounts": ["type=bind,source=/dev/bus/usb,target=/dev/bus/usb"],

"runArgs": [
"--device=/dev/bus/usb",
"--device=/dev/ttyACM0",
"--device=/dev/hidraw1"
],
"runArgs": ["--device=/dev/bus/usb"],
// Set *default* container specific settings.json values on container create.
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
Expand Down Expand Up @@ -120,39 +116,30 @@
},

"C_Cpp.default.compilerPath": "/arm_toolchain/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc",
"C_Cpp.default.browse.limitSymbolsToIncludedHeaders": true,

"C_Cpp.default.cStandard": "c23",
"C_Cpp.default.cppStandard": "c++23",
"C_Cpp.default.intelliSenseMode": "gcc-arm",
"C_Cpp.loggingLevel": "Debug",
"C_Cpp.intelliSenseEngineFallback": "enabled",
"C_Cpp.loggingLevel": "Information",
"C_Cpp.intelliSenseEngineFallback": "disabled",
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",

"cmake.generator": "Unix Makefiles",
"cmake.sourceDirectory": "${workspaceFolder:codal}",
"cmake.configureOnOpen": false
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-vscode.cpptools-extension-pack",
"xaver.clang-format",
"amiralizadeh9480.cpp-helper",

"marus25.cortex-debug",
"dan-c-underwood.arm",
"keroc.hex-fmt",
"trond-snekvik.gnu-mapfiles",
"ZixuanWang.linkerscript",

"esbenp.prettier-vscode",

"github.vscode-pull-request-github",

"ms-python.python",

"augustocdias.tasks-shell-input",
"rioj7.command-variable"
"rioj7.command-variable",
"ms-vscode.vscode-serial-monitor"
]
}
},
Expand Down
121 changes: 27 additions & 94 deletions codal-letssteam.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -34,87 +34,11 @@
"/arm_toolchain/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/arm-none-eabi/include/**"
],

"C_Cpp.default.includePath": [
"${workspaceFolder:codal}/utils/cmake/toolchains/ARM_GCC/**",
"${workspaceFolder:codal-core}/inc/core/**",
"${workspaceFolder:codal-core}/inc/driver-models/**",
"${workspaceFolder:codal-core}/inc/drivers/**",
"${workspaceFolder:codal-core}/inc/streams/**",
"${workspaceFolder:codal-core}/inc/types/**",
"${workspaceFolder:codal-core}/inc/**",
"${workspaceFolder:codal-stm32}/asm/**",
"${workspaceFolder:codal-stm32}/inc/drivers/**",
"${workspaceFolder:codal-stm32}/inc/**",
"${workspaceFolder:codal-stm32}/source/**",
"${workspaceFolder:codal-stm32}/source/stm32/**",
"${workspaceFolder:codal-stm32}/source/stm32/LL/**",
"${workspaceFolder:codal-stm32}/source/stm32/HAL/**",
"${workspaceFolder:codal-stm32}/source/stm32/OpenAMP/**",
"${workspaceFolder:codal-stm32}/source/stm32/usb/**",
"${workspaceFolder:codal-stm32}/source/stm32/usb/cdc/**",
"${workspaceFolder:codal-stm32}/source/stm32/usb/hid/**",
"${workspaceFolder:codal-stm32}/source/stm32/usb/webusb/**",
"${workspaceFolder:codal-stm32}/system/CMSIS_5/CMSIS/Core/Include/**",
"${workspaceFolder:codal-stm32}/variants/STM32L4xx/L475V(C-E-G)T_L476V(C-E-G)T_L486VGT/*",
"${workspaceFolder:codal-stm32}/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/**",
"${workspaceFolder:codal-stm32}/system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/**",
"${workspaceFolder:codal-stm32}/system/STM32L4xx/**",
"${workspaceFolder:codal-stm32}/system/Drivers/STM32L4xx_HAL_Driver/Inc/**",
"${workspaceFolder:codal-stm32}/system/Drivers/STM32L4xx_HAL_Driver/Src/**",
"${workspaceFolder:codal-stm32}/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc/**",
"${workspaceFolder:codal-stm32}/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src/**",
"${workspaceFolder:codal-stm32}/system/Middlewares/ST/STM32_USB_Device_Library/Class/WebUSB/Inc/**",
"${workspaceFolder:codal-stm32}/system/Middlewares/ST/STM32_USB_Device_Library/Class/WebUSB/Src/**",
"${workspaceFolder:codal-stm32-DISCO_L475VG_IOT}/inc/**",
"${workspaceFolder:codal-stm32-DISCO_L475VG_IOT}/model/**",
"${workspaceFolder:codal-stm32-DISCO_L475VG_IOT}/samples/**",
"${workspaceFolder:codal-stm32-STEAM32_WB55RG}/inc/**",
"${workspaceFolder:codal-stm32-STEAM32_WB55RG}/model/**",
"${workspaceFolder:codal-stm32-STEAM32_WB55RG}/samples/**",
"${workspaceFolder:codal-stm32-PNUCLEO_WB55RG}/inc/**",
"${workspaceFolder:codal-stm32-PNUCLEO_WB55RG}/model/**",
"${workspaceFolder:codal-stm32-PNUCLEO_WB55RG}/samples/**"
],
"C_Cpp.default.defines": [
"STM32L4",
"STM32L4xx",
"STM32L475xx",
"DMESG_SERIAL_DEBUG",
"USE_HAL_DRIVER",
"DEVICE_SRAM_BASE=0x20000000",
"DEVICE_SRAM_END=0x20018000",
"DEVICE_STACK_BASE=DEVICE_SRAM_END",
"DEVICE_STACK_SIZE=2048",
"DEVICE_HEAP_ALLOCATOR=1",
"DEVICE_TAG=0",
"SCHEDULER_TICK_PERIOD_US=1000",
"EVENT_LISTENER_DEFAULT_FLAGS=MESSAGE_BUS_LISTENER_DROP_IF_BUSY",
"MESSAGE_BUS_LISTENER_MAX_QUEUE_DEPTH=10",
"USE_ACCEL_LSB=0",
"DEVICE_DEFAULT_SERIAL_MODE=SerialMode::SYNC_SLEEP",
"DEVICE_COMPONENT_COUNT=60",
"DEVICE_DEFAULT_PULLMODE=PullMode::Down",
"DEVICE_PANIC_HEAP_FULL=1",
"DEVICE_DMESG_BUFFER_SIZE=2048",
"CODAL_DEBUG=CODAL_DEBUG_DISABLED",
"DEVICE_USB=0",
"CODAL_TIMESTAMP=uint64_t",
"PROCESSOR_WORD_TYPE=uintptr_t",
"DEVICE_I2C_IRQ_SHARED=1",
"CODAL_PROVIDE_PRINTF=1",
"BOARD_NAME=\"DISCO_L475VG_IOT\"",
"PERIPHERAL_PINS=PeripheralPins_B_L475E_IOT01A",
"VARIANT=variant_B_L475E_IOT01A",
"VARIANT_H=\"variant_B_L475E_IOT01A.h\"",
"ARDUINO_B_L475E_IOT01A=1",
"HAL_UART_MODULE_ENABLED=1",
"USBCON=1",
"USBD_USE_CDC=1",
"HAL_PCD_MODULE_ENABLED=1",
"USBD_CLASS_BOS_ENABLED=1",
"I2C_IRQ_PRIO=0",
"DEXTI_IRQ_PRIO=0"
],
"cmake.generator": "Unix Makefiles",
"cmake.sourceDirectory": "${workspaceFolder:codal}",
"cmake.buildDirectory": "${workspaceFolder:codal}/build",

"C_Cpp.default.compileCommands": "${workspaceFolder:codal}/build/compile_commands.json ",

"files.associations": {
"digital_io.h": "c",
Expand Down Expand Up @@ -247,9 +171,20 @@
"label": "flash",
"args": [],
"type": "shell",
"command": "openocd -s /usr/share/openocd/scripts/ -s ${workspaceFolder:codal}/scripts/ -f openocd.cfg -c 'program build/STM32 verify reset exit'; sleep 6",
"options": { "cwd": "${workspaceFolder:codal}" },
"dependsOn": ["build current target"],
"command": "make flash",
"presentation": {
"reveal": "silent"
},
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "flash_openocd",
"args": [],
"type": "shell",
"command": "make flash_openocd",
"presentation": {
"reveal": "silent"
},
Expand All @@ -262,9 +197,8 @@
"label": "flash_pyocd",
"args": [],
"type": "shell",
"command": "pyocd flash STM32.hex",
"options": { "cwd": "${workspaceFolder:codal}" },
"dependsOn": ["build current target"],
"command": "make flash_pyocd",

"presentation": {
"reveal": "silent"
},
Expand All @@ -290,7 +224,11 @@
"${workspaceFolder:codal}/scripts/"
],
"configFiles": ["openocd.cfg"],
"preLaunchTask": "flash",
"liveWatch": {
"enabled": true,
"samplesPerSecond": 4
},
"preLaunchTask": "flash_openocd",
"runToEntryPoint": "main",
"showDevDebugOutput": "parsed",
"preLaunchCommands": [
Expand All @@ -307,12 +245,7 @@
"executable": "${workspaceFolder:codal}/build/STM32",
"name": "Debug (PyOCD)",
"svdFile": "${workspaceFolder:codal}/scripts/STM32.svd",
"searchDir": [
"/usr/share/openocd/scripts/",
"${workspaceFolder:codal}/scripts/"
],
"configFiles": ["openocd.cfg"],
"preLaunchTask": "flash_pyocd",
"preLaunchTask": "build current target",
"runToEntryPoint": "main",
"showDevDebugOutput": "parsed"
}
Expand Down

0 comments on commit 9b6d2fe

Please sign in to comment.