導航:首頁 > 電腦問題 > 電腦怎麼安裝vscode

電腦怎麼安裝vscode

發布時間:2022-09-07 11:36:43

1. esp32 vscode lauch 設置

第一步:安裝 VSCode C/C++ 擴展
1.在應用商店裡搜索 C++
2.安裝C/C++ IntelliSense, debugging, and code browsing
第二步:安裝 VSCode ESP-IDF 擴展
1.在應用商店裡搜索 Espressif
2.安裝 Develop and debug applications for Espressif ESP32, ESP32-S2 chips with ESP-IDF (帶樂鑫圖標)
第三步:配置ESP-IDF 擴展
1.按 F1 或Ctrl+Shift+P 打開命令面板
2.輸入 ESP-IDF: Configure ESP-IDF extension
載入初始設置時間較長,耐心等待
3.根據實際情況選擇不同的配置方式
Express: IDF 版本 配置Python環境,擴展將安裝IDF
Advanced: 手動配置已安裝的開發環境
Using Existing Setup : 使用擴展檢測出的環境
配置完成後顯示:All settings have been configured. You can close this window.
第四步:創建項目模板,檢測設置
1.按 F1 或Ctrl+Shift+P 打開命令面板 輸入ESP-IDF:Create project 或按Ctrl+E+C
2.選擇工程創建目錄
3.選擇模板類型
第五部:設置工作區的json文件
在settings.json文件中添加以下內容
"terminal.integrated.shell.windows": "cmd.exe",
"terminal.integrated.shellArgs.windows": ["/k", "c:\\esp\\esp-idf\\export.bat"],
"terminal.integrated.shell.linux": "/bin/bash",
"terminal.integrated.shellArgs.linux": ["--init-file", "~/esp/esp-idf/export.sh", "-i"],
"terminal.integrated.shell.osx": "/bin/bash",
"terminal.integrated.shellArgs.osx": ["--init-file", "~/esp/esp-idf/export.sh", "-i"],
"files.associations": {undefined
"*.md": "markdown",
"*.mdx": "tdx",
"stdio.h": "c"
},
可以在VSCode 終端中正常使用idf的各種命令。
第六步:編譯工程
可以使用ESP擴展下的各個按鈕完成項目的串口選擇、項目配置、Full Clearn、編譯、下載、監視
也可以使用命令行方式:
1.按Ctrl+` (~按鍵的位置)打開終端(第一次運行時擴展會有提示,選擇允許 其實質就是運行~/esp/esp-idf/export.sh)
2.選擇終止終端
3.重新打開終端 會看到export.sh運行的結果
Go to the project directory and run:
idf.py build
4.運行各種idf命令
第七部:下載程序並監測程序運行
1. 按Select Device Port 按鈕 或運行 ESP-IDF:Device configuration命令
按提示選擇/dev/ttyUSB1作為下載口
2.編譯完成後,可使用下載按鈕進行程序下載。此時會出現提示:
PermissionError: [Errno 13] Permission denied: '/dev/ttyUSB1'
原因:
$ ls -l /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 2月 3 11:21 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 2月 3 11:21 /dev/ttyUSB1
發現ttyUSB* 設備屬於root用戶 dialout 用戶組,當前用戶不屬於dialout用戶組
解決方案:
(1).執行以下命令
$sudo chmod 666 /dev/ttyUSB*
修改ttyUSB設備許可權為其它用戶可讀可寫。
缺點:電腦重啟後,又會出現這種問題,還要重新設置
(2).為了能讓普通用戶也能使用串口,可以增加udev規則來實現
$sudo vim /etc/udev/rules.d/70-ttyusb.rules
增加如下內容:
KERNEL=="ttyUSB[0-9]*",MODE="0666"
保存,重新插入USB轉串口,普通用戶就能搞定了
缺點:該方法會讓所有的普通用戶都具有訪問這些串口設備的許可權,存在一定的安全隱患
(3).將目標用戶加入dialout用戶組,可以使用以下任意一個命令
$sudo usermod -aG dialout <目標用戶名>
或:
sudo gpasswd --add <目標用戶名> dialout
重啟系統即可

第八部:跟蹤調試程序
1.按 OpenOCD Server 按鈕 輸出提示:
❌ Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
❌ Error: no device foun
按照 https://sourceforge.net/p/openocd/code/ci/master/tree/README 文檔解釋做如下操作:
(1). 將~/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200709/openocd-esp32/share/openocd/contrib/
目錄下的 60-openocd.rules 拷貝至 /etc/udev/rules.d/ 目錄下
(2).確保當前用戶屬於 plugdev 用戶組。 提示:運行 groups 命令可以查看當前用戶所屬的用戶組
(3).重啟系統
2.配置Debug 環境
參考:https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/DEBUGGING.md
註:該文檔中的模板有坑。
問題:
使用 ESP-IDF Debug Adapter 配置時出現如下提示:
pygdbmi.gdbcontroller.NoGdbProcessError: gdb process has already finished with return code: 127
按照 esp_debug_adapter 說明文檔 在~/.vscode/extensions/espressif.esp-idf-extension-0.6.1/esp_debug_adapter/ 目錄下
$pip install -r requirements.txt
問題依然存在 暫無解決思路

使用 Microsoft C/C++ extension to debug 配置時出現如下提示:
error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
實質是系統中沒有python2.7的庫,解決:
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install libpython2.7

問題解決
同時也解決了使用 ESP-IDF Debug Adapter 配置時出現的問題 故是否需要pip install …… 不能確定

在使用 Microsoft C/C++ extension to debug 配置時 會提示出現異常,不用理會可正常跟蹤調試。

有時會提示
Error: couldn』t bind tcl to socket: Address already in use
則證明 剛剛啟動的 進程未被終止。
解決辦法:
a).查看當前活動進程
netstat為顯示網路相關信息 a(all:默認顯示所有,如果加了其他選項此項不生效) n(number:以數字形式顯示) t(僅僅顯示tcp連接),p(process:顯示該項是由哪個程序建立起來的)
$ sudo netstat -antp
b). 強制殺死它(假設進程號為3560,-9為強制殺死)
$ sudo kill -9 3560
Debug正常運行時,狀態欄由藍色變為棕色。

附:scode的各個json文件
c_cpp_properties.json
======================================
{undefined
"configurations": [
{undefined
"name": "ESP-IDF",
"compilerPath": "${default}",
"cStandard": "c11",
"cppStandard": "c++17",
"includePath": [
"${config:idf.espIdfPath}/components/**",
"${config:idf.espIdfPathWin}/components/**",
"${workspaceFolder}/**"
],
"browse": {undefined
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": false
}
}
],
"version": 4
}

settings.json
======================================
{undefined
"terminal.integrated.shell.windows": "cmd.exe",
"terminal.integrated.shellArgs.windows": ["/k", "c:\\esp\\esp-idf\\export.bat"],
"terminal.integrated.shell.linux": "/bin/bash",
"terminal.integrated.shellArgs.linux": ["--init-file", "~/esp/esp-idf/export.sh", "-i"],
"terminal.integrated.shell.osx": "/bin/bash",
"terminal.integrated.shellArgs.osx": ["--init-file", "~/esp/esp-idf/export.sh", "-i"],
"files.associations": {undefined
"*.md": "markdown",
"*.mdx": "tdx",
"stdio.h": "c"
},
"C_Cpp.clang_format_style": "Visual Studio",
"editor.formatOnSave": false,
"[cpp]": {undefined
"editor.quickSuggestions": true
},
"[c]": {undefined
"editor.quickSuggestions": true
},
"C_Cpp.intelliSenseEngine": "Tag Parser",
//配置下載介面
"idf.port": "/dev/ttyUSB1",
//配置下載方式
"idf.flashType": "UART",
//openOcd配置,根據開發板確定
"idf.openOcdConfigs": [
//新版建議用「board/XXX」 配置
"interface/ftdi/esp32_devkitj_v1.cfg",
"target/esp32.cfg"
]
}

launch.json
======================================
{undefined
// 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": [
{undefined
"type": "espidf",
"name": "ESP_Debug",
"request": "launch",
"debugPort": 43474,
"logLevel": 2,
//模板中有坑的地方,模板內容為 "mode": "manual",
//這樣不能自動啟動 Debug Adapter
"mode": "auto",
"initGdbCommands": [
"target remote :3333",
"symbol-file ${workspaceFolder}/build/${command:espIdf.getProjectName}.elf",
"set remote hardware-watchpoint-limit 2",
"mon reset halt",
"flushregs",
"thb app_main",
"c"
],
"env": {undefined
"PATH": "${env:PATH}:${config:idf.customExtraPaths}"
}
},
{undefined
"name": "GDB",
"type": "cppdbg",
"request": "launch",
"MIMode": "gdb",
"miDebuggerPath": "${command:espIdf.getXtensaGdb}",
"program": "${workspaceFolder}/build/${command:espIdf.getProjectName}.elf",
"windows": {undefined
"program": "${workspaceFolder}\\build\\${command:espIdf.getProjectName}.elf"
},
"cwd": "${workspaceFolder}",
"environment": [{ "name": "PATH", "value": "${config:idf.customExtraPaths}" }],
"setupCommands": [
{ "text": "-enable-pretty-printing",
"ignoreFailures": true },
{ "text": "file '${workspaceFolder}/build/${command:espIdf.getProjectName}.elf'"},
{ "text": "target remote :3333" },
{ "text": "set remote hardware-watchpoint-limit 2"},
{ "text": "mon reset halt" },
{ "text": "thb app_main" },
{ "text": "flushregs" }
//{ "text": "c"}
],
"externalConsole": false,
"logging": {undefined
"engineLogging": true
}
}
]
}

tasks.json 這個文用系統生成的即可 略
————————————————
版權聲明:本文為CSDN博主「FuShaofeng」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/FuShaofeng/article/details/113633337

2. VSCode如何進行插件遷移

前言:換了台電腦使用vsCode,發現又需要重新安裝插件,之前配置的主題又需要重新配置,好麻煩,就想著能否簡單點,把之前安裝過的插件復制到新的電腦上。網上搜索到了一種方法挺好的

1、打開之前電腦,找到原電腦VS Code的插件安裝目錄:

如:C:\Users\用戶名.vscode\extensions

復制文件目錄 extensions

2、在 新的電腦上同樣找到安裝目錄下的.vscode,替換掉extensions 或者復制之前extensions下的插件文件,粘貼到當前新目錄就好了

3、打開VSCode插件會自動載入。

這樣就OK了

3. vscode 用戶配置 是哪個文件

在用戶目錄的AppdataRoamingCodeUser文件夾中一個名為「settings」的json文件。解決方法如下:

1、首先在電腦桌面中找到並點擊vscode。

4. vscode如何設置中文

在Vscode中打開擴展插件,搜索「chinese」下載安裝中文簡體插件,這樣就可以把vscode設置中文。

操作設備:戴爾電腦

操作系統:win10

1、首先打開Vscode,點擊擴展圖標,打開側邊欄「EXTENSIONS」面板。

5. 華碩無畏15筆記本怎麼安裝c++軟體

筆記本先要看操作系統
以windows為例:
windows則需要安裝C++環境,安裝好後安裝Vscode/vs等編輯軟體
環境安裝可詳見CSDN

6. vscode界面拖動條失效

摘要 1、計算機系統出問題,導致各種軟體也出問題

閱讀全文

與電腦怎麼安裝vscode相關的資料

熱點內容
台式電腦系統怎麼連接無線網 瀏覽:194
蘋果電腦下載軟體有哪些 瀏覽:237
手機控制攝像頭的軟體 瀏覽:853
蘋果電腦qq游戲 瀏覽:84
怎麼練電腦打字 瀏覽:381
把電腦系統換成win10旗艦版 瀏覽:832
學打字的軟體手機軟體 瀏覽:25
手機ssr加速軟體 瀏覽:707
筆記本電腦停電屏幕黑屏 瀏覽:673
蘋果5s軟體更換 瀏覽:744
spss蘋果電腦 瀏覽:942
電腦itunes在哪個位置 瀏覽:167
windows電腦裝蘋果雙系統 瀏覽:793
愛淘電腦怎麼設置 瀏覽:7
電腦如何將電子表格轉成在線表格 瀏覽:687
怎麼看蘋果電腦序列號 瀏覽:520
怎麼設置電腦上列印機共享 瀏覽:488
筆記本電腦禁止wifi怎麼打開 瀏覽:900
電腦待機狀態怎麼開機 瀏覽:202
路由器怎麼設置共三台電腦 瀏覽:346