Skip to content

Commit ad3c767

Browse files
author
jantje
committed
#373 This changes the build chain
I now put all objcopy commands in 1 CDT toolchain step. I find the based on RECIPE.OBJCOPY.*.PATTERN There may arrise issues with other boards as the order is not guaranteed!!
1 parent 138ddc0 commit ad3c767

File tree

3 files changed

+23
-40
lines changed

3 files changed

+23
-40
lines changed

it.baeyens.arduino.core/OSGI-INF/l10n/bundle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ inputType.name.1 = OBJ Files to archive
5858
tool.name.2 = Arduino combiner
5959
outputType.name.4 = ELF Binary Files as output
6060
inputType.name.2 = OBJ link Files
61-
tool.announcement.3 = Create eeprom image
62-
tool.name.3 = Arduino tool Create eeprom
63-
inputType.name.3 = Hex dump to eep input
61+
tool.announcement.3 = Do all objcopy commands
62+
tool.name.3 = Arduino tool objcopy command
63+
inputType.name.3 = objcopy input
6464
outputType.name.5 = Hex dump for eep output
6565
tool.announcement.4 = Create Flash image (ihex format)
6666
tool.name.4 = Arduino tool Create hex

it.baeyens.arduino.core/plugin.xml

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,8 @@
784784
</tool>
785785
<tool
786786
announcement="%tool.announcement.3"
787-
command="${A.RECIPE.OBJCOPY.EEP.PATTERN} "
788-
commandLinePattern="${COMMAND}"
787+
command="all objcopy commands"
788+
commandLinePattern="${JANTJE.OBJCOPY}"
789789
id="it.baeyens.arduino.tool.objcopy.eep"
790790
isAbstract="false"
791791
name="%tool.name.3"
@@ -801,39 +801,12 @@
801801
sources="elf">
802802
</inputType>
803803
<outputType
804-
buildVariable="EEP"
805-
id="it.baeyens.arduino.tool.objcopy.eep.output"
804+
buildVariable="HEX"
805+
id="it.baeyens.arduino.tool.objcopy.output"
806806
multipleOfType="false"
807807
name="%outputType.name.5"
808-
outputNames="${ProjName}.eep"
809-
outputs="eep">
810-
</outputType>
811-
</tool>
812-
<tool
813-
announcement="%tool.announcement.4"
814-
command="${A.RECIPE.OBJCOPY.HEX.PATTERN} "
815-
commandLinePattern="${COMMAND}"
816-
id="it.baeyens.arduino.tool.objcopy.flash"
817-
isAbstract="false"
818-
name="%tool.name.4"
819-
natureFilter="both">
820-
<inputType
821-
buildVariable="EEP"
822-
dependencyExtensions="eep"
823-
id="it.baeyens.arduino.tool.objcopy.flash.input"
824-
multipleOfType="true"
825-
name="%inputType.name.4"
826-
primaryInput="true"
827-
sourceContentType="it.baeyens.arduino.tool.eep.output"
828-
sources="eep">
829-
</inputType>
830-
<outputType
831-
buildVariable="FLASH_IMAGE"
832-
id="it.baeyens.arduino.tool.objcopy.flash.output"
833-
multipleOfType="false"
834-
name="%outputType.name.6"
835-
nameProvider="it.baeyens.arduino.toolchain.hexNameProvider"
836-
outputs="hex,bin">
808+
outputNames="${ProjName}.hex"
809+
outputs="hex">
837810
</outputType>
838811
</tool>
839812
<tool
@@ -843,12 +816,12 @@
843816
id="it.baeyens.arduino.tool.size"
844817
name="%tool.name.5">
845818
<inputType
846-
buildVariable="FLASH_IMAGE"
819+
buildVariable="HEX"
847820
dependencyExtensions="hex"
848821
id="it.baeyens.arduino.tool.size.input"
849822
multipleOfType="true"
850823
primaryInput="true"
851-
sourceContentType="it.baeyens.arduino.tool.objcopy.flash.output">
824+
sourceContentType="it.baeyens.arduino.tool.objcopy.output">
852825
</inputType>
853826
<outputType
854827
buildVariable="SIZEDUMMY"

it.baeyens.arduino.core/src/it/baeyens/arduino/tools/Helpers.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,12 +1110,17 @@ private static void setTheEnvironmentVariablesPostProcessing(IContributedEnviron
11101110
setBuildEnvironmentVariable(contribEnv, confDesc, get_ENV_KEY_TOOL(ACTION_PROGRAM), uploadTool);
11111111
}
11121112

1113-
// Arduino uses the board approach for the tools.
1114-
// as I'm not, therefore I mod the tools in the command to be FQN
1113+
String objcopyCommand = "";
1114+
String objcopyCommandLinker = objcopyCommand;
1115+
1116+
// I'm looping through the set of variables to fix some things up
11151117
try {
11161118
IEnvironmentVariable[] curVariables = contribEnv.getVariables(confDesc);
11171119
for (IEnvironmentVariable curVariable : curVariables) {
11181120
String name = curVariable.getName();
1121+
// Arduino uses the board approach for the tools.
1122+
// as I'm not, therefore I mod the tools in the command to be
1123+
// FQN
11191124
if (name.startsWith("A.TOOLS.")) { //$NON-NLS-1$
11201125
String toolID = curVariable.getName().split("\\.")[2]; //$NON-NLS-1$
11211126
String recipe = curVariable.getValue();
@@ -1135,11 +1140,16 @@ private static void setTheEnvironmentVariablesPostProcessing(IContributedEnviron
11351140
}
11361141
setBuildEnvironmentVariable(contribEnv, confDesc, name, recipe);
11371142
}
1143+
if (name.startsWith("A.RECIPE.OBJCOPY.") && name.endsWith(".PATTERN")) {
1144+
objcopyCommand += objcopyCommandLinker + makeEnvironmentVar(name);
1145+
objcopyCommandLinker = "\n\t";
1146+
}
11381147
}
11391148

11401149
} catch (Exception e) {
11411150
Common.log(new Status(IStatus.WARNING, Const.CORE_PLUGIN_ID, "parsing of upload recipe failed", e)); //$NON-NLS-1$
11421151
}
1152+
setBuildEnvironmentVariable(contribEnv, confDesc, "JANTJE.OBJCOPY", objcopyCommand);
11431153

11441154
// link build.core to jantje.build.core
11451155
setBuildEnvironmentVariable(contribEnv, confDesc, ENV_KEY_BUILD_CORE,

0 commit comments

Comments
 (0)