Skip to content

Commit 0358cf7

Browse files
committed
feat(core): use Cargo as the build system for C code
[no changelog]
1 parent 54912a6 commit 0358cf7

155 files changed

Lines changed: 416006 additions & 97 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/embed/.cargo/config.toml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[build]
2+
target-dir = "../build-xtask"
3+
#rustc-wrapper = "sccache"
4+
5+
[alias]
6+
xtask = "run -p xtask --"
7+
8+
[target.x86_64-unknown-linux-gnu]
9+
10+
[target.aarch64-apple-darwin]
11+
12+
[target.thumbv7em-none-eabihf]
13+
linker = "arm-none-eabi-gcc"
14+
rustflags = [
15+
"-C",
16+
"target-cpu=cortex-m4",
17+
"-C",
18+
"link-arg=-mthumb",
19+
"-C",
20+
"link-arg=-mcpu=cortex-m4",
21+
"-C",
22+
"link-arg=-mfloat-abi=hard",
23+
"-C",
24+
"link-arg=-mfpu=fpv4-sp-d16",
25+
]
26+
27+
[target.thumbv8m.main-none-eabihf]
28+
linker = "arm-none-eabi-gcc"
29+
rustflags = [
30+
"-C",
31+
"target-cpu=cortex-m33",
32+
"-C",
33+
"link-arg=-mthumb",
34+
"-C",
35+
"link-arg=-mcpu=cortex-m33",
36+
"-C",
37+
"link-arg=-mfloat-abi=hard",
38+
"-C",
39+
"link-arg=-mfpu=fpv5-sp-d16",
40+
]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"type": "cppdbg",
3+
"request": "launch",
4+
"program": "${tfTools.executablePath}",
5+
"args": [
6+
"-m",
7+
"main"
8+
],
9+
"cwd": "${workspaceFolder}/core/src",
10+
"linux": {
11+
"MIMode": "gdb",
12+
"miDebuggerPath": "gdb"
13+
},
14+
"MIMode": "lldb",
15+
"stopAtEntry": true
16+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"type": "cppdbg",
3+
"request": "launch",
4+
"program": "${tfTools.executablePath}",
5+
"cwd": "${workspaceFolder}/core/build/unix",
6+
"linux": {
7+
"MIMode": "gdb",
8+
"miDebuggerPath": "gdb"
9+
},
10+
"MIMode": "lldb",
11+
"stopAtEntry": true
12+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"cwd": "${workspaceFolder}",
3+
"executable": "${tfTools.executablePath}",
4+
"request": "attach",
5+
"type": "cortex-debug",
6+
"runToEntryPoint": "main",
7+
"servertype": "openocd",
8+
"configFiles": [
9+
"interface/stlink.cfg",
10+
"target/stm32f4x.cfg"
11+
],
12+
"svdFile": "core/embed/.tf-tools/svd/STM32F427.svd",
13+
"swoConfig": {
14+
"enabled": true,
15+
"cpuFrequency": 180000000,
16+
"swoFrequency": 2000000,
17+
"source": "probe",
18+
"decoders": [
19+
{
20+
"type": "console",
21+
"label": "ITM",
22+
"port": 0,
23+
"encoding": "ascii"
24+
}
25+
]
26+
}
27+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"executable": "${tfTools.artifactPath}/kernel.elf",
3+
"request": "attach",
4+
"type": "cortex-debug",
5+
"runToEntryPoint": "main",
6+
"servertype": "openocd",
7+
"configFiles": [
8+
"interface/stlink.cfg",
9+
"target/stm32f4x.cfg"
10+
],
11+
"svdFile": "core/embed/.tf-tools/svd/STM32F427.svd",
12+
"postAttachCommands": [
13+
"monitor adapter speed 8000",
14+
"add-symbol-file ${tfTools.executablePath}"
15+
],
16+
"swoConfig": {
17+
"enabled": true,
18+
"cpuFrequency": 180000000,
19+
"swoFrequency": 2000000,
20+
"source": "probe",
21+
"decoders": [
22+
{
23+
"type": "console",
24+
"label": "ITM",
25+
"port": 0,
26+
"encoding": "ascii"
27+
}
28+
]
29+
}
30+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"executable": "${tfTools.executablePath}",
3+
"request": "attach",
4+
"type": "cortex-debug",
5+
"runToEntryPoint": "main",
6+
"servertype": "openocd",
7+
"configFiles": [
8+
"interface/stlink.cfg",
9+
"target/stm32u5x.cfg"
10+
],
11+
"svdFile": "core/embed/.tf-tools/svd/STM32U5Gx.svd",
12+
"postAttachCommands": [
13+
"monitor adapter speed 8000"
14+
],
15+
"swoConfig": {
16+
"enabled": true,
17+
"cpuFrequency": 160000000,
18+
"swoFrequency": 2000000,
19+
"source": "probe",
20+
"decoders": [
21+
{
22+
"type": "console",
23+
"label": "ITM",
24+
"port": 0,
25+
"encoding": "ascii"
26+
}
27+
]
28+
}
29+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"executable": "${tfTools.artifactPath}/kernel.elf",
3+
"request": "attach",
4+
"type": "cortex-debug",
5+
"runToEntryPoint": "main",
6+
"servertype": "openocd",
7+
"configFiles": [
8+
"interface/stlink.cfg",
9+
"target/stm32u5x.cfg"
10+
],
11+
"svdFile": "core/embed/.tf-tools/svd/STM32U5Gx.svd",
12+
"postAttachCommands": [
13+
"monitor adapter speed 8000",
14+
"add-symbol-file ${tfTools.executablePath}"
15+
],
16+
"swoConfig": {
17+
"enabled": true,
18+
"cpuFrequency": 160000000,
19+
"swoFrequency": 2000000,
20+
"source": "probe",
21+
"decoders": [
22+
{
23+
"type": "console",
24+
"label": "ITM",
25+
"port": 0,
26+
"encoding": "ascii"
27+
}
28+
]
29+
}
30+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"executable": "${tfTools.artifactPath}/secmon.elf",
3+
"request": "attach",
4+
"type": "cortex-debug",
5+
"runToEntryPoint": "main",
6+
"servertype": "openocd",
7+
"configFiles": [
8+
"interface/stlink.cfg",
9+
"target/stm32u5x.cfg"
10+
],
11+
"svdFile": "core/embed/.tf-tools/svd/STM32U5Gx.svd",
12+
"postAttachCommands": [
13+
"monitor adapter speed 2000",
14+
"add-symbol-file ${tfTools.artifactPath}/kernel.elf",
15+
"add-symbol-file ${tfTools.executablePath}"
16+
],
17+
"swoConfig": {
18+
"enabled": true,
19+
"cpuFrequency": 160000000,
20+
"swoFrequency": 2000000,
21+
"source": "probe",
22+
"decoders": [
23+
{
24+
"type": "console",
25+
"label": "ITM",
26+
"port": 0,
27+
"encoding": "ascii"
28+
}
29+
]
30+
}
31+
}

0 commit comments

Comments
 (0)