Skip to content
This repository was archived by the owner on Mar 25, 2019. It is now read-only.

Commit 3526b10

Browse files
committed
Version 1.3.alpha1 - new CLion, new STM32 chips
1 parent 5bc2180 commit 3526b10

File tree

4 files changed

+173
-146
lines changed

4 files changed

+173
-146
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/META-INF/plugin.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin>
22
<id>xyz.elmot.clion.armsupport.prj</id>
33
<name>OpenOCD + STM32CubeMX support for ARM embedded development</name>
4-
<version>1.2.alpha3</version>
4+
<version>1.3.alpha1</version>
55
<vendor email="me@elmot.xyz" url="http://elmot.xyz">Elmot</vendor>
66

77
<description><![CDATA[
@@ -26,15 +26,14 @@ Disclaimer
2626

2727
<change-notes><![CDATA[
2828
<ul>
29-
<li>CLion 2018.3 support</li>
30-
<li>Non-loadable workspace fixed</li>
31-
<li>Minor fixes</li>
29+
<li>CLion 2019.1 EAP support</li>
30+
<li>STM32G0 and STM32L5 experimental support added</li>
3231
</ul>
3332
]]>
3433
</change-notes>
3534

3635
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
37-
<idea-version since-build="183.4284" until-build="183.*"/>
36+
<idea-version since-build="191.4212" until-build="191.*"/>
3837

3938
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
4039
on how to target different products -->
Lines changed: 166 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,174 @@
11
package xyz.elmot.clion.cubemx;
22

3+
import org.jetbrains.annotations.NotNull;
4+
import org.jetbrains.annotations.Nullable;
5+
36
import java.util.HashMap;
7+
import java.util.Locale;
48
import java.util.Map;
59

6-
/**
7-
* (c) elmot on 28.9.2017.
8-
*/
910
@SuppressWarnings({"WeakerAccess", "unused"})
1011
public class ProjectData {
11-
private String projectName;
12-
private String linkerScript;
13-
private String mcuFamily;
14-
private String genericConfigName;
15-
private String linkerFlags;
16-
private String defines;
17-
private String includes;
18-
private String sources;
19-
private String mcpu;
20-
private String board;
21-
22-
public void setProjectName(String projectName) {
23-
this.projectName = projectName;
24-
}
25-
26-
public void setLinkerFlags(String linkerFlags) {
27-
this.linkerFlags = linkerFlags;
28-
}
29-
30-
public void setLinkerScript(String linkerScript) {
31-
this.linkerScript = linkerScript;
32-
genericConfigName = linkerScript.replace(".ld", "");
33-
}
34-
35-
public void setMcuFamily(String mcuFamily) {
36-
this.mcuFamily = mcuFamily;
37-
switch (mcuFamily.substring(0, 7).toUpperCase()) {
38-
case "STM32F0":
39-
case "STM32L0":
40-
mcpu = "cortex-m0";
41-
break;
42-
case "STM32F1":
43-
case "STM32F2":
44-
case "STM32L1":
45-
mcpu = "cortex-m3";
46-
break;
47-
case "STM32F7":
48-
case "STM32H7":
49-
mcpu = "cortex-m7";
50-
break;
51-
default:
52-
mcpu = "cortex-m4";
53-
}
54-
}
55-
56-
public String getProjectName() {
57-
return projectName;
58-
}
59-
60-
public String getLinkerScript() {
61-
return linkerScript;
62-
}
63-
64-
public String getMcuFamily() {
65-
return mcuFamily;
66-
}
67-
68-
public String getGenericConfigName() {
69-
return genericConfigName;
70-
}
71-
72-
public String getLinkerFlags() {
73-
return linkerFlags;
74-
}
75-
76-
public String getDefines() {
77-
return defines;
78-
}
79-
80-
public String getIncludes() {
81-
return includes;
82-
}
83-
84-
public String getSources() {
85-
return sources;
86-
}
87-
88-
public String getMcpu() {
89-
return mcpu;
90-
}
91-
92-
public String getBoard() {
93-
return board;
94-
}
95-
96-
public void setDefines(String defines) {
97-
this.defines = defines;
98-
}
99-
100-
public void setIncludes(String includes) {
101-
this.includes = includes;
102-
}
103-
104-
public void setSources(String sources) {
105-
this.sources = sources;
106-
}
107-
108-
public void setBoard(String board) {
109-
this.board = board;
110-
}
111-
112-
@Override
113-
public String toString() {
114-
return "projectName='" + projectName + '\'' +
115-
"\n linkerScript='" + linkerScript + '\'' +
116-
"\n mcuFamily='" + mcuFamily + '\'' +
117-
"\n genericConfigName='" + genericConfigName + '\'' +
118-
"\n linkerFlags='" + linkerFlags + '\'' +
119-
"\n defines='" + defines + '\'' +
120-
"\n includes='" + includes + '\'' +
121-
"\n sources='" + sources + '\'' +
122-
"\n mcpu='" + mcpu + '\'';
123-
}
124-
125-
public Map<String, String> getAsMap() {
126-
Map<String, String> map = new HashMap<>();
127-
map.put("projectName", projectName);
128-
map.put("linkerScript", linkerScript);
129-
map.put("mcuFamily", mcuFamily);
130-
map.put("genericConfigName", genericConfigName);
131-
map.put("linkerFlags", linkerFlags);
132-
map.put("defines", defines);
133-
map.put("includes", includes);
134-
map.put("sources", sources);
135-
map.put("mcpu", mcpu);
136-
map.put("templateWarning", "THIS FILE IS AUTO GENERATED FROM THE TEMPLATE! DO NOT CHANGE!");
137-
return map;
138-
}
139-
140-
public String shortHtml() {
141-
return String.format("<table>" +
142-
"<tr><td>Chip</td><td><b>%s</b></td></tr>" +
143-
"<tr><td>Detected CPU</td><td><b>%s</b></td></tr>" +
144-
"</table>", mcuFamily, mcpu);
145-
}
12+
@Nullable
13+
private String projectName;
14+
@Nullable
15+
private String linkerScript;
16+
@Nullable
17+
private String mcuFamily;
18+
@Nullable
19+
private String genericConfigName;
20+
@Nullable
21+
private String linkerFlags;
22+
@Nullable
23+
private String defines;
24+
@Nullable
25+
private String includes;
26+
@Nullable
27+
private String sources;
28+
@Nullable
29+
private String mcpu;
30+
@Nullable
31+
private String board;
32+
33+
public void setProjectName(@NotNull String projectName) {
34+
this.projectName = projectName;
35+
}
36+
37+
public void setLinkerFlags(@NotNull String linkerFlags) {
38+
this.linkerFlags = linkerFlags;
39+
}
40+
41+
public void setLinkerScript(@NotNull String linkerScript) {
42+
this.linkerScript = linkerScript;
43+
genericConfigName = linkerScript.replace(".ld", "");
44+
}
45+
46+
public void setMcuFamily(@NotNull String mcuFamily) {
47+
this.mcuFamily = mcuFamily;
48+
switch (mcuFamily.substring(0, 7).toUpperCase(Locale.ENGLISH)) {
49+
case "STM32F0":
50+
case "STM32L0":
51+
case "STM32G0":
52+
mcpu = "cortex-m0";
53+
break;
54+
case "STM32F1":
55+
case "STM32F2":
56+
case "STM32L1":
57+
mcpu = "cortex-m3";
58+
break;
59+
case "STM32F7":
60+
case "STM32H7":
61+
mcpu = "cortex-m7";
62+
break;
63+
case "STM32L5":
64+
mcpu = "cortex-m33";
65+
break;
66+
default:
67+
mcpu = "cortex-m4";
68+
}
69+
}
70+
71+
@Nullable
72+
public String getProjectName() {
73+
return projectName;
74+
}
75+
76+
@Nullable
77+
public String getLinkerScript() {
78+
return linkerScript;
79+
}
80+
81+
@Nullable
82+
public String getMcuFamily() {
83+
return mcuFamily;
84+
}
85+
86+
@Nullable
87+
public String getGenericConfigName() {
88+
return genericConfigName;
89+
}
90+
91+
@Nullable
92+
public String getLinkerFlags() {
93+
return linkerFlags;
94+
}
95+
96+
@Nullable
97+
public String getDefines() {
98+
return defines;
99+
}
100+
101+
@Nullable
102+
public String getIncludes() {
103+
return includes;
104+
}
105+
106+
@Nullable
107+
public String getSources() {
108+
return sources;
109+
}
110+
111+
@Nullable
112+
public String getMcpu() {
113+
return mcpu;
114+
}
115+
116+
@Nullable
117+
public String getBoard() {
118+
return board;
119+
}
120+
121+
public void setDefines(@NotNull String defines) {
122+
this.defines = defines;
123+
}
124+
125+
public void setIncludes(@NotNull String includes) {
126+
this.includes = includes;
127+
}
128+
129+
public void setSources(@NotNull String sources) {
130+
this.sources = sources;
131+
}
132+
133+
public void setBoard(@NotNull String board) {
134+
this.board = board;
135+
}
136+
137+
@Override
138+
@NotNull
139+
public String toString() {
140+
return "projectName='" + projectName + '\'' +
141+
"\n linkerScript='" + linkerScript + '\'' +
142+
"\n mcuFamily='" + mcuFamily + '\'' +
143+
"\n genericConfigName='" + genericConfigName + '\'' +
144+
"\n linkerFlags='" + linkerFlags + '\'' +
145+
"\n defines='" + defines + '\'' +
146+
"\n includes='" + includes + '\'' +
147+
"\n sources='" + sources + '\'' +
148+
"\n mcpu='" + mcpu + '\'';
149+
}
150+
151+
@NotNull
152+
public Map<String, String> getAsMap() {
153+
Map<String, String> map = new HashMap<>();
154+
map.put("projectName", projectName);
155+
map.put("linkerScript", linkerScript);
156+
map.put("mcuFamily", mcuFamily);
157+
map.put("genericConfigName", genericConfigName);
158+
map.put("linkerFlags", linkerFlags);
159+
map.put("defines", defines);
160+
map.put("includes", includes);
161+
map.put("sources", sources);
162+
map.put("mcpu", mcpu);
163+
map.put("templateWarning", "THIS FILE IS AUTO GENERATED FROM THE TEMPLATE! DO NOT CHANGE!");
164+
return map;
165+
}
166+
167+
@NotNull
168+
public String shortHtml() {
169+
return String.format("<table>" +
170+
"<tr><td>Chip</td><td><b>%s</b></td></tr>" +
171+
"<tr><td>Detected CPU</td><td><b>%s</b></td></tr>" +
172+
"</table>", mcuFamily, mcpu);
173+
}
146174
}

src/xyz/elmot/clion/openocd/OpenOcdLauncher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.intellij.openapi.util.ThrowableComputable;
2020
import com.intellij.xdebugger.XDebugSession;
2121
import com.jetbrains.cidr.cpp.execution.CMakeAppRunConfiguration;
22-
import com.jetbrains.cidr.cpp.execution.debugger.backend.GDBDriverConfiguration;
22+
import com.jetbrains.cidr.cpp.execution.debugger.backend.CLionGDBDriverConfiguration;
2323
import com.jetbrains.cidr.cpp.toolchains.CPPDebugger;
2424
import com.jetbrains.cidr.cpp.toolchains.CPPToolchains;
2525
import com.jetbrains.cidr.execution.debugger.CidrDebugProcess;
@@ -102,7 +102,7 @@ protected CidrDebugProcess createDebugProcess(@NotNull CommandLineState commandL
102102
CPPDebugger cppDebugger = CPPDebugger.create(CPPDebugger.Kind.CUSTOM_GDB, gdbPath);
103103
toolchain.setDebugger(cppDebugger);
104104
}
105-
GDBDriverConfiguration gdbDriverConfiguration = new GDBDriverConfiguration(getProject(), toolchain);
105+
CLionGDBDriverConfiguration gdbDriverConfiguration = new CLionGDBDriverConfiguration(getProject(), toolchain);
106106
xDebugSession.stop();
107107
CidrRemoteGDBDebugProcess debugProcess =
108108
new CidrRemoteGDBDebugProcess(gdbDriverConfiguration,

0 commit comments

Comments
 (0)