Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,993 changes: 994 additions & 999 deletions package-lock.json

Large diffs are not rendered by default.

183 changes: 166 additions & 17 deletions resources/bi.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,191 @@
[
{
"manufacturer": "QEMU",
"boards": [
{
"name": "qemu-vexpress-a9",
"description": "VExpress A9 evaluation board, QEMU ARM emulation for ARM Cortex-A 32-bit series machines. VExpress A9评估板卡,可以使用QEMU ARM来模拟ARM Cortex-A 32位系列机器。",
"board": "qemu-vexpress-a9",
"path": "bsp/qemu-vexpress-a9"
},
{
"name": "qemu-virt64-aarch64",
"description": "QEMU emulated virt aarch64 machine. QEMU模拟的virt aarch64机器。",
"board": "qemu-virt64-aarch64",
"path": "bsp/qemu-virt64-aarch64"
},
{
"name": "qemu-virt64-riscv",
"description": "QEMU emulated virt RISC-V 64-bit machine. QEMU模拟的virt RISC-V 64位机器。",
"board": "qemu-virt64-riscv",
"path": "bsp/qemu-virt64-riscv"
}
]
},
{
"manufacturer": "ST",
"boards": [
{
"name": "stm32f407-rt-spark",
"description" : "RT-Thread官方的星火一号开发板,基于STM32F407",
"description": "RT-Thread official Spark board No.1, based on STM32F407. RT-Thread官方的星火一号开发板,基于STM32F407",
"board": "stm32f407-rt-spark",
"path": "bsp/stm32/stm32f407-rt-spark"

},
{
"name": "stm32f412-st-nucleo",
"description": "ST官方的STM32F412 Nucleo开发板",
"description": "ST official STM32F412 Nucleo development board. ST官方的STM32F412 Nucleo开发板",
"board": "stm32f412-st-nucleo",
"path":"bsp/stm32/stm32f412-st-nucleo"
"path": "bsp/stm32/stm32f412-st-nucleo"
},
{
"name": "stm32f401-st-nucleo",
"description": "ST official STM32F401 Nucleo development board with ARM Cortex-M4. ST官方的STM32F401 Nucleo开发板,搭载ARM Cortex-M4内核。",
"board": "stm32f401-st-nucleo",
"path": "bsp/stm32/stm32f401-st-nucleo"
},
{
"name": "stm32f103-atk-nano",
"description": "Alientek STM32F103 Nano development board, based on STM32F103RB. 正点原子STM32F103 Nano开发板,基于STM32F103RB。",
"board": "stm32f103-atk-nano",
"path": "bsp/stm32/stm32f103-atk-nano"
},
{
"name": "stm32f103-blue-pill",
"description": "Popular low-cost STM32F103 Blue Pill board, widely used for learning and prototyping. 流行的低成本STM32F103蓝色药丸板,广泛用于学习和原型开发。",
"board": "stm32f103-blue-pill",
"path": "bsp/stm32/stm32f103-blue-pill"
},
{
"name": "stm32f407-atk-explorer",
"description": "Alientek STM32F407 Explorer development board with rich peripherals. 正点原子STM32F407探索者开发板,外设丰富。",
"board": "stm32f407-atk-explorer",
"path": "bsp/stm32/stm32f407-atk-explorer"
},
{
"name": "stm32f429-atk-apollo",
"description": "Alientek STM32F429 Apollo development board with LCD and camera support. 正点原子STM32F429阿波罗开发板,支持LCD和摄像头。",
"board": "stm32f429-atk-apollo",
"path": "bsp/stm32/stm32f429-atk-apollo"
},
{
"name": "stm32h750-artpi",
"description": "RT-Thread official ART-Pi development board, based on STM32H750 with high performance. RT-Thread官方ART-Pi开发板,基于高性能STM32H750。",
"board": "stm32h750-artpi",
"path": "bsp/stm32/stm32h750-artpi"
}
]
},
{
"manufacturer": "QEMU",
"manufacturer": "Raspberry Pi",
"boards": [
{
"name": "qemu-vexpress-a9",
"description": "VExpress A9评估板卡,可以使用QEMU ARM来模拟ARM Cortex-A 32位系列机器",
"board": "qemu-vexpress-a9",
"path": "bsp/qemu-vexpress-a9"
"name": "raspberry-pico",
"description": "Raspberry Pi Pico board based on RP2040 microcontroller. 树莓派Pico开发板,基于RP2040微控制器。",
"board": "raspberry-pico",
"path": "bsp/raspberry-pico"
},
{
"name": "qemu-virt64-aarch64",
"description": "QEMU模拟的virt aarch64机器",
"board": "qemu-virt64-aarch64",
"path": "bsp/qemu-virt64-aarch64"
"name": "raspberry-pi-4b",
"description": "Raspberry Pi 4 Model B single-board computer with quad-core Cortex-A72. 树莓派4B单板计算机,搭载四核Cortex-A72。",
"board": "raspberry-pi-4b",
"path": "bsp/raspberry-pi/raspi4-64"
}
]
},
{
"manufacturer": "Renesas",
"boards": [
{
"name": "ra6m3-hmi-board",
"description": "Renesas RA6M3 HMI development board with Cortex-M4 core and rich graphics features. 瑞萨RA6M3 HMI开发板,搭载Cortex-M4内核和丰富的图形功能。",
"board": "ra6m3-hmi-board",
"path": "bsp/renesas/ra6m3-hmi-board"
},
{
"name": "ra8d1-vision-board",
"description": "Renesas RA8D1 Vision Board with high-performance graphics and vision processing. 瑞萨RA8D1视觉开发板,具有高性能图形和视觉处理能力。",
"board": "ra8d1-vision-board",
"path": "bsp/renesas/ra8d1-vision-board"
},
{
"name": "rzn2l-etherkit",
"description": "Renesas RZ/N2L EtherKit for industrial Ethernet applications. 瑞萨RZ/N2L以太网套件,用于工业以太网应用。",
"board": "rzn2l-etherkit",
"path": "bsp/renesas/rzn2l_etherkit"
}
]
},
{
"manufacturer": "Infineon",
"boards": [
Copy link
Member

Choose a reason for hiding this comment

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

英飞凌的bsp放这份 Infineon/psoc6-evaluationkit-062S2 ,不是这里提及的两份

Copy link
Member

Choose a reason for hiding this comment

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

@copilot 英飞凌的bsp放这份 Infineon/psoc6-evaluationkit-062S2 ,不是这里提及的两份

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in b2b68a5. Replaced both Infineon BSPs with psoc6-evaluationkit-062S2 from bsp/Infineon/psoc6-evaluationkit-062S2.

{
"name": "psoc6-evaluationkit-062S2",
"description": "Infineon PSoC 6 Evaluation Kit with dual-core ARM Cortex-M4/M0+ processor. 英飞凌PSoC 6评估套件,搭载双核ARM Cortex-M4/M0+处理器。",
"board": "psoc6-evaluationkit-062S2",
"path": "bsp/Infineon/psoc6-evaluationkit-062S2"
}
]
},
{
"manufacturer": "NXP",
"boards": [
{
"name": "imxrt1052-evk",
"description": "NXP i.MX RT1052 EVK board with ARM Cortex-M7 crossover MCU. 恩智浦i.MX RT1052评估板,搭载ARM Cortex-M7跨界MCU。",
"board": "imxrt1052-evk",
"path": "bsp/imxrt/imxrt1052-evk"
},
{
"name": "imxrt1064-evk",
"description": "NXP i.MX RT1064 EVK board with ARM Cortex-M7 and advanced peripherals. 恩智浦i.MX RT1064评估板,搭载ARM Cortex-M7和先进外设。",
"board": "imxrt1064-evk",
"path": "bsp/imxrt/imxrt1064-evk"
},
{
"name": "frdm-mcxa156",
"description": "NXP FRDM-MCXA156 Freedom development board with ARM Cortex-M33. 恩智浦FRDM-MCXA156自由开发板,搭载ARM Cortex-M33内核。",
"board": "frdm-mcxa156",
"path": "bsp/nxp/mcx/mcxa/frdm-mcxa156"
},
{
"name": "frdm-mcxa346",
"description": "NXP FRDM-MCXA346 Freedom development board with ARM Cortex-M33. 恩智浦FRDM-MCXA346自由开发板,搭载ARM Cortex-M33内核。",
"board": "frdm-mcxa346",
"path": "bsp/nxp/mcx/mcxa/frdm-mcxa346"
},
{
"name": "frdm-mcxn947",
"description": "NXP FRDM-MCXN947 Freedom development board with dual ARM Cortex-M33 cores. 恩智浦FRDM-MCXN947自由开发板,搭载双核ARM Cortex-M33内核。",
"board": "frdm-mcxn947",
"path": "bsp/nxp/mcx/mcxn/frdm-mcxn947"
}
]
Copy link
Member

Choose a reason for hiding this comment

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

@copilot 继续添加 nxp/mcx/mcxa/frdm-mcxa156nxp/mcx/mcxa/frdm-mcxa346nxp/mcx/mcxn/frdm-mcxn947 这些bsp。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 5bbd67a. Added three NXP MCX boards: frdm-mcxa156, frdm-mcxa346, and frdm-mcxn947.

},
{
"manufacturer": "Allwinner",
"boards": [
{
"name": "allwinner-d1",
"description": "Allwinner D1 RISC-V based application processor. 全志D1基于RISC-V的应用处理器。",
"board": "allwinner-d1",
"path": "bsp/allwinner/d1"
}
]
},
{
"manufacturer": "GigaDevice",
"boards": [
{
"name": "gd32450z-eval",
"description": "GigaDevice GD32450Z evaluation board with ARM Cortex-M4 and rich peripherals. 兆易创新GD32450Z评估板,搭载ARM Cortex-M4内核和丰富外设。",
"board": "gd32450z-eval",
"path": "bsp/gd32/arm/gd32450z-eval"
},
{
"name": "qemu-virt64-riscv64",
"description": "QEMU模拟的virt riscv64机器",
"board": "qemu-virt64-riscv64",
"path": "bsp/qemu-virt64-riscv64"
"name": "gd32407v-start",
"description": "GigaDevice GD32407V starter board with ARM Cortex-M4 core. 兆易创新GD32407V起始板,搭载ARM Cortex-M4内核。",
"board": "gd32407v-start",
"path": "bsp/gd32/arm/gd32407v-start"
}
]
}
Expand Down
20 changes: 20 additions & 0 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ export function initAPI(context:vscode.ExtensionContext) {
export function getBoardInfo(): any {
let bi = [];

for (const item of _bi) {
let vendor = { manufacturer : item.manufacturer, boards : [] as any[]};

for (const board of item.boards) {
vendor.boards.push({
name: board.name,
board: board.board,
description: board.description,
path: board.path
});
}
bi.push(vendor);
}

return bi;
}

export function getBoardInfoSimple(): any {
let bi = [];

for (const item of _bi) {
let vendor = { manufacturer : item.manufacturer, boards : [] as string[]};

Expand Down
40 changes: 36 additions & 4 deletions src/vue/create-project/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
<el-select class="create-project-select" v-model="projectInfo.board" :placeholder="'请选择'" @change="boardChanged">
<el-option
v-for="item in projectInfo.projectList[vendorIndex].boards"
:key="item"
:label="item"
:value="item"
:key="typeof item === 'string' ? item : item.board"
:label="typeof item === 'string' ? item : item.name"
:value="typeof item === 'string' ? item : item.board"
/>
</el-select>
<el-button type="primary" plain @click="createProject">创建</el-button>
Expand All @@ -48,6 +48,10 @@
<h3 class="rt-section-title">创建工程说明</h3>
<p>请在工程名称中填写名称,它会在工程空间路径中创建这样名称的目录放置新创建的工程。</p>
<p class="create-project-warning">⚠️ 请确保空间路径 + 工程名称的路径不存在;否则创建检查失败。</p>
<div v-if="selectedBoardDescription" class="create-project-board-info">
<h4 class="rt-subsection-title">选中的板卡信息</h4>
<p>{{ selectedBoardDescription }}</p>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -95,6 +99,31 @@ const vendorIndex = computed(() => {
return current;
});

const selectedBoardDescription = computed(() => {
if (!projectInfo.value.board || !projectInfo.value.projectList || projectInfo.value.projectList.length === 0) {
return '';
}

const currentVendor = projectInfo.value.projectList[vendorIndex.value];
if (!currentVendor || !currentVendor.boards) {
return '';
}

const board = currentVendor.boards.find((b: any) => {
if (typeof b === 'string') {
return b === projectInfo.value.board;
} else {
return b.board === projectInfo.value.board;
}
});

if (board && typeof board === 'object' && board.description) {
return board.description;
}

return '';
});

const vendorChanged = () => {
let current = -1;
projectInfo.value.projectList.filter((item: any, index: number) => {
Expand All @@ -105,7 +134,10 @@ const vendorChanged = () => {
if (current === -1) {
projectInfo.value.board = '';
} else {
projectInfo.value.board = projectInfo.value.projectList[current].boards[0];
const boards = projectInfo.value.projectList[current].boards;
if (boards && boards.length > 0) {
projectInfo.value.board = typeof boards[0] === 'string' ? boards[0] : boards[0].board;
}
}
};

Expand Down
19 changes: 19 additions & 0 deletions src/vue/create-project/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,25 @@
}
}

.create-project-board-info {
margin-top: @spacing-lg;
padding-top: @spacing-lg;
border-top: 1px solid @el-border-color-lighter;

.rt-subsection-title {
margin: 0 0 @spacing-sm;
font-size: @font-size-base;
font-weight: 600;
color: @color-text-primary;
}

p {
margin: 0;
line-height: 1.6;
color: @el-text-color-regular;
}
}

.create-project-warning {
margin: 0;
color: @color-warning;
Expand Down
12 changes: 2 additions & 10 deletions src/webviews/create-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,9 @@ export function openCreateProjectWebview(context: vscode.ExtensionContext) {

let workspace = vscode.workspace.workspaceFolders?.[0];
// 获取BSP工程信息
if (workspace) {
const rtthreadFn = path.join(workspace.uri.fsPath, '.vscode', 'rtthread.json');
if (fs.existsSync(rtthreadFn)) {
let rtthreadObj = readJsonObject(rtthreadFn);
if (rtthreadObj && rtthreadObj.board_info) {
extensionInfo.projectList = getBoardInfo();
}
}
}
extensionInfo.projectList = getBoardInfo();

// 如果没有从workspace获取到projectList,则使用默认值
// 如果没有从bi.json获取到projectList,则使用默认值
if (!extensionInfo.projectList || extensionInfo.projectList.length === 0) {
extensionInfo.projectList = [
{
Expand Down