summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2018-08-15 09:40:56 +0800
committerGitHub <[email protected]>2018-08-15 09:40:56 +0800
commit033e5f4fd45ccbc5d11deeec813f9a5d7e221e43 (patch)
treeb511b2e22efb2a459b35f011f1566ac8d51add4f
parent8215a8352305704afaf54b389343e9f41365b40e (diff)
parent382c3307255ac196ccfd766d738346f1661871be (diff)
Merge pull request #1719 from RT-Thread/feature_qemu_vsc
[BSP] Add vscode settings for qemu-vexpress-a9 bsp
-rw-r--r--bsp/qemu-vexpress-a9/.config20
-rw-r--r--bsp/qemu-vexpress-a9/.vscode/launch.json96
-rw-r--r--bsp/qemu-vexpress-a9/.vscode/settings.json10
-rw-r--r--bsp/qemu-vexpress-a9/.vscode/tasks.json45
-rw-r--r--bsp/qemu-vexpress-a9/README.md38
-rw-r--r--bsp/qemu-vexpress-a9/qemu-dbg.bat2
-rw-r--r--bsp/qemu-vexpress-a9/rtconfig.h7
7 files changed, 214 insertions, 4 deletions
diff --git a/bsp/qemu-vexpress-a9/.config b/bsp/qemu-vexpress-a9/.config
index 8c75a16116..15d4f1cebd 100644
--- a/bsp/qemu-vexpress-a9/.config
+++ b/bsp/qemu-vexpress-a9/.config
@@ -74,6 +74,7 @@ CONFIG_ARCH_ARM_CORTEX_A9=y
CONFIG_RT_USING_COMPONENTS_INIT=y
CONFIG_RT_USING_USER_MAIN=y
CONFIG_RT_MAIN_THREAD_STACK_SIZE=2048
+CONFIG_RT_MAIN_THREAD_PRIORITY=10
#
# C++ features
@@ -107,6 +108,7 @@ CONFIG_DFS_USING_WORKDIR=y
CONFIG_DFS_FILESYSTEMS_MAX=2
CONFIG_DFS_FILESYSTEM_TYPES_MAX=2
CONFIG_DFS_FD_MAX=16
+# CONFIG_RT_USING_DFS_MNTTABLE is not set
CONFIG_RT_USING_DFS_ELMFAT=y
#
@@ -251,11 +253,18 @@ CONFIG_LWIP_SO_SNDTIMEO=1
CONFIG_LWIP_SO_RCVBUF=1
# CONFIG_RT_LWIP_NETIF_LOOPBACK is not set
CONFIG_LWIP_NETIF_LOOPBACK=0
+# CONFIG_RT_LWIP_STATS is not set
+# CONFIG_RT_LWIP_DEBUG is not set
#
# Modbus master and slave stack
#
# CONFIG_RT_USING_MODBUS is not set
+
+#
+# AT commands
+#
+# CONFIG_RT_USING_AT is not set
# CONFIG_LWIP_USING_DHCPD is not set
#
@@ -293,7 +302,6 @@ CONFIG_LOG_TRACE_USING_LEVEL_INFO=y
# CONFIG_PKG_USING_LJSON is not set
# CONFIG_PKG_USING_EZXML is not set
# CONFIG_PKG_USING_NANOPB is not set
-# CONFIG_PKG_USING_GAGENT_CLOUD is not set
#
# Wi-Fi
@@ -311,10 +319,16 @@ CONFIG_LOG_TRACE_USING_LEVEL_INFO=y
# CONFIG_PKG_USING_COAP is not set
# CONFIG_PKG_USING_NOPOLL is not set
# CONFIG_PKG_USING_NETUTILS is not set
-# CONFIG_PKG_USING_ONENET is not set
# CONFIG_PKG_USING_AT_DEVICE is not set
#
+# IoT Cloud
+#
+# CONFIG_PKG_USING_ONENET is not set
+# CONFIG_PKG_USING_GAGENT_CLOUD is not set
+# CONFIG_PKG_USING_ALI_IOTKIT is not set
+
+#
# security packages
#
# CONFIG_PKG_USING_MBEDTLS is not set
@@ -362,10 +376,12 @@ CONFIG_LOG_TRACE_USING_LEVEL_INFO=y
# CONFIG_PKG_USING_STM32F4_HAL is not set
# CONFIG_PKG_USING_STM32F4_DRIVERS is not set
# CONFIG_PKG_USING_REALTEK_AMEBA is not set
+# CONFIG_PKG_USING_SHT2X is not set
#
# miscellaneous packages
#
+# CONFIG_PKG_USING_LIBCSV is not set
# CONFIG_PKG_USING_OPTPARSE is not set
# CONFIG_PKG_USING_FASTLZ is not set
# CONFIG_PKG_USING_MINILZO is not set
diff --git a/bsp/qemu-vexpress-a9/.vscode/launch.json b/bsp/qemu-vexpress-a9/.vscode/launch.json
new file mode 100644
index 0000000000..b0ba84b176
--- /dev/null
+++ b/bsp/qemu-vexpress-a9/.vscode/launch.json
@@ -0,0 +1,96 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "Debug @ Mac/Linux",
+ "type": "cppdbg",
+ "request": "launch",
+ "program": "${workspaceRoot}/rtthread.elf",
+ "args": [],
+ "stopAtEntry": true,
+ "cwd": "${workspaceRoot}",
+ "environment": [],
+ "externalConsole": true,
+ "miDebuggerServerAddress": "localhost:1234",
+ "serverLaunchTimeout": 2000,
+ "targetArchitecture": "ARM",
+ "setupCommands": [
+ {
+ "text": "cd ${workspaceRoot}"
+ },
+ {
+ "text": "shell qemu-dbg.sh"
+ },
+ {
+ "text": "target remote localhost:1234"
+ },
+ {
+ "text": "file rtthread.elf"
+ },
+ {
+ "text": "break application_start"
+ }
+ ],
+ "customLaunchSetupCommands": [],
+ "launchCompleteCommand": "exec-run",
+ "preLaunchTask": "qemu debug",
+ "osx": {
+ "MIMode": "gdb",
+ "miDebuggerPath": "arm-none-eabi-gdb"
+ },
+ "linux": {
+ "MIMode": "gdb",
+ "miDebuggerPath": "arm-none-eabi-gdb"
+ },
+ "windows": {
+ "MIMode": "gdb",
+ "miDebuggerPath": "arm-none-eabi-gdb.exe"
+ }
+ },
+ {
+ "name": "Debug @ Windows",
+ "type": "cppdbg",
+ "request": "launch",
+ "program": "${workspaceRoot}\\rtthread.elf",
+ "args": [],
+ "stopAtEntry": true,
+ "cwd": "${workspaceRoot}",
+ "environment": [],
+ "externalConsole": true,
+ "miDebuggerServerAddress": "localhost:1234",
+ "serverLaunchTimeout": 2000,
+ "targetArchitecture": "ARM",
+ "setupCommands": [
+ {
+ "text": "cd ${workspaceRoot}"
+ },
+ {
+ "text": "shell qemu-dbg.bat"
+ },
+ {
+ "text": "target remote localhost:1234"
+ },
+ {
+ "text": "file rtthread.elf"
+ },
+ {
+ "text": "break main"
+ }
+ ],
+ "customLaunchSetupCommands": [],
+ "launchCompleteCommand": "exec-run",
+ "osx": {
+ "MIMode": "gdb",
+ "miDebuggerPath": "arm-none-eabi-gdb"
+ },
+ "linux": {
+ "MIMode": "gdb",
+ "miDebuggerPath": "arm-none-eabi-gdb"
+ },
+ "windows": {
+ "MIMode": "gdb",
+ "miDebuggerPath": "arm-none-eabi-gdb.exe"
+ }
+ },
+ ]
+}
diff --git a/bsp/qemu-vexpress-a9/.vscode/settings.json b/bsp/qemu-vexpress-a9/.vscode/settings.json
new file mode 100644
index 0000000000..78ffca6469
--- /dev/null
+++ b/bsp/qemu-vexpress-a9/.vscode/settings.json
@@ -0,0 +1,10 @@
+{
+ "C_Cpp.dimInactiveRegions": false,
+ "files.exclude": {
+ "**/.git": true,
+ "**/GPUCache" : true,
+ "**/build" : true,
+ "**/*.pyc" : true
+ },
+ "editor.renderWhitespace": "all"
+}
diff --git a/bsp/qemu-vexpress-a9/.vscode/tasks.json b/bsp/qemu-vexpress-a9/.vscode/tasks.json
new file mode 100644
index 0000000000..19bcae8313
--- /dev/null
+++ b/bsp/qemu-vexpress-a9/.vscode/tasks.json
@@ -0,0 +1,45 @@
+{
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
+ // for the documentation about the tasks.json format
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "build",
+ "type": "shell",
+ "command": "scons",
+ "problemMatcher": [
+ "$gcc"
+ ],
+ "presentation": {
+ "echo": true,
+ "reveal": "always",
+ "focus": true,
+ "panel": "shared",
+ "showReuseMessage": true
+ },
+ "group": {
+ "kind": "build",
+ "isDefault": true
+ }
+ },
+ {
+ "label": "clean",
+ "type": "shell",
+ "command": "scons -c",
+ "problemMatcher": [],
+ "presentation": {
+ "echo": true,
+ "reveal": "always",
+ "focus": true,
+ "panel": "shared",
+ "showReuseMessage": true
+ }
+ },
+ {
+ "label": "qemu simulator",
+ "type": "shell",
+ "command": "qemu.bat",
+ "problemMatcher" : []
+ }
+ ]
+} \ No newline at end of file
diff --git a/bsp/qemu-vexpress-a9/README.md b/bsp/qemu-vexpress-a9/README.md
index 56f907d71f..7ad3f30aa8 100644
--- a/bsp/qemu-vexpress-a9/README.md
+++ b/bsp/qemu-vexpress-a9/README.md
@@ -60,10 +60,46 @@ msh />
| Mouse | 支持 | |
| EMAC | 支持 | |
+### 4.1 使用VSCode编辑、编译、调试
+
+在qemu-vexpress-a9中已经携带了部分vscode的配置,需要配合着env一起来使用。步骤包括:
+
+先使用env打开console,然后在console中切换都qemu-vexpress-a9 bsp的目录下,
+
+```bash
+scons --target=vsc -s
+```
+
+更新vscode需要用到的C/C++头文件搜索路径信息(不是每次都需要更新,只有在使用了menuconfig重新配置了RT-Thread或更改了rtconfig.h头文件时才需要)
+
+然后在console下输入
+
+```bash
+code .
+```
+
+启动vscode。使用vscode,目前包含如下的一些功能:
+
+* 编译 `Ctrl+Shift+B` - 开启vscode内置终端,调用scons进行编译;如果有编译错误也会侦测问题,双击问题跳到指定代码文件、代码行;
+* 包含执行`qemu`模拟器,`scons -c`进行目标文件清理的任务
+* `F5` 一键开启QEMU调试模式,并断点停留在`main`函数上;(需要更改下qemu-dbg.bat文件,在qemu-system-arm前加入`start`),即
+
+```batch
+@echo off
+if exist sd.bin goto run
+qemu-img create -f raw sd.bin 64M
+
+:run
+start qemu-system-arm -M vexpress-a9 -kernel rtthread.elf -serial stdio -sd sd.bin -S -s
+```
+
+**已知问题** 如果在vscode的目录中额外添加了文件夹,会导致调试不能够启动。
+
## 5. 联系人信息
-维护人:bernard
+维护人:[bernard][4]
[1]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.subset.boards.express/index.html
[2]: https://www.rt-thread.org/page/download.html
[3]: https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2
+ [4]: https://github.com/BernardXiong
diff --git a/bsp/qemu-vexpress-a9/qemu-dbg.bat b/bsp/qemu-vexpress-a9/qemu-dbg.bat
index 402bb460fe..b4a04cf2a9 100644
--- a/bsp/qemu-vexpress-a9/qemu-dbg.bat
+++ b/bsp/qemu-vexpress-a9/qemu-dbg.bat
@@ -3,4 +3,4 @@ if exist sd.bin goto run
qemu-img create -f raw sd.bin 64M
:run
-qemu-system-arm -M vexpress-a9 -kernel rtthread.elf -serial vc -serial vc -sd sd.bin -S -s
+qemu-system-arm -M vexpress-a9 -kernel rtthread.elf -serial stdio -sd sd.bin -S -s
diff --git a/bsp/qemu-vexpress-a9/rtconfig.h b/bsp/qemu-vexpress-a9/rtconfig.h
index 40dbde6fa9..9dd617da97 100644
--- a/bsp/qemu-vexpress-a9/rtconfig.h
+++ b/bsp/qemu-vexpress-a9/rtconfig.h
@@ -53,6 +53,7 @@
#define RT_USING_COMPONENTS_INIT
#define RT_USING_USER_MAIN
#define RT_MAIN_THREAD_STACK_SIZE 2048
+#define RT_MAIN_THREAD_PRIORITY 10
/* C++ features */
@@ -188,6 +189,9 @@
/* Modbus master and slave stack */
+/* AT commands */
+
+
/* VBUS(Virtual Software BUS) */
@@ -210,6 +214,9 @@
/* Wiced WiFi */
+/* IoT Cloud */
+
+
/* security packages */