F7 bundles rusEfi console should erase and program using F7 configs #893
This commit is contained in:
parent
b7f871c9bc
commit
5486705f8e
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<java version="1.8.0_202" class="java.beans.XMLDecoder">
|
||||||
|
<object class="java.util.HashMap">
|
||||||
|
<void method="put">
|
||||||
|
<string>root</string>
|
||||||
|
<object class="com.rusefi.ui.storage.Node" id="Node0">
|
||||||
|
<void property="config">
|
||||||
|
<void method="put">
|
||||||
|
<string>hardware</string>
|
||||||
|
<string>F7</string>
|
||||||
|
</void>
|
||||||
|
</void>
|
||||||
|
</object>
|
||||||
|
</void>
|
||||||
|
</object>
|
||||||
|
</java>
|
|
@ -11,6 +11,7 @@ import com.rusefi.core.SensorCentral;
|
||||||
import com.rusefi.io.*;
|
import com.rusefi.io.*;
|
||||||
import com.rusefi.io.serial.PortHolder;
|
import com.rusefi.io.serial.PortHolder;
|
||||||
import com.rusefi.io.tcp.BinaryProtocolServer;
|
import com.rusefi.io.tcp.BinaryProtocolServer;
|
||||||
|
import com.rusefi.maintenance.FirmwareFlasher;
|
||||||
import com.rusefi.maintenance.VersionChecker;
|
import com.rusefi.maintenance.VersionChecker;
|
||||||
import com.rusefi.ui.*;
|
import com.rusefi.ui.*;
|
||||||
import com.rusefi.ui.engine.EngineSnifferPanel;
|
import com.rusefi.ui.engine.EngineSnifferPanel;
|
||||||
|
@ -128,6 +129,8 @@ public class Launcher {
|
||||||
staticFrame = mainFrame.getFrame();
|
staticFrame = mainFrame.getFrame();
|
||||||
FileLog.MAIN.logLine("Console " + CONSOLE_VERSION);
|
FileLog.MAIN.logLine("Console " + CONSOLE_VERSION);
|
||||||
|
|
||||||
|
FileLog.MAIN.logLine("Hardware: " + FirmwareFlasher.getHardwareKind());
|
||||||
|
|
||||||
getConfig().getRoot().setProperty(PORT_KEY, port);
|
getConfig().getRoot().setProperty(PORT_KEY, port);
|
||||||
getConfig().getRoot().setProperty(SPEED_KEY, PortHolder.BAUD_RATE);
|
getConfig().getRoot().setProperty(SPEED_KEY, PortHolder.BAUD_RATE);
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class EraseChip extends ProcessStatusWindow {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private String getEraseCommand() {
|
private String getEraseCommand() {
|
||||||
return FirmwareFlasher.getOpenocdCommad() + ERASE_COMMAND_SUFFIX;
|
return FirmwareFlasher.getOpenocdCommand() + ERASE_COMMAND_SUFFIX;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JButton getButton() {
|
public JButton getButton() {
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
package com.rusefi.maintenance;
|
package com.rusefi.maintenance;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import static com.rusefi.Launcher.INPUT_FILES_PATH;
|
import static com.rusefi.Launcher.INPUT_FILES_PATH;
|
||||||
|
import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (c) Andrey Belomutskiy 2013-2018
|
* (c) Andrey Belomutskiy 2013-2018
|
||||||
|
@ -46,8 +49,8 @@ public class FirmwareFlasher extends ProcessStatusWindow {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getOpenocdCommad() {
|
public static String getOpenocdCommand() {
|
||||||
String cfg = "stm32f4discovery.cfg";
|
String cfg = getHardwareKind().getOpenOcdName();
|
||||||
return OPENOCD_EXE + " -f openocd/" + cfg;
|
return OPENOCD_EXE + " -f openocd/" + cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +61,7 @@ public class FirmwareFlasher extends ProcessStatusWindow {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
StatusAnimation sa = new StatusAnimation(wnd);
|
StatusAnimation sa = new StatusAnimation(wnd);
|
||||||
StringBuffer error = executeCommand(getOpenocdCommad() + " -c \"program " +
|
StringBuffer error = executeCommand(getOpenocdCommand() + " -c \"program " +
|
||||||
fileName +
|
fileName +
|
||||||
" verify reset exit 0x08000000\"");
|
" verify reset exit 0x08000000\"");
|
||||||
if (error.toString().contains(NO_DRIVER_MESSAGE_TAG)) {
|
if (error.toString().contains(NO_DRIVER_MESSAGE_TAG)) {
|
||||||
|
@ -76,4 +79,10 @@ public class FirmwareFlasher extends ProcessStatusWindow {
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HwPlatform getHardwareKind() {
|
||||||
|
String value = getConfig().getRoot().getProperty("hardware", HwPlatform.F4.name());
|
||||||
|
return HwPlatform.resolve(value);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.rusefi.maintenance;
|
||||||
|
|
||||||
|
public enum HwPlatform {
|
||||||
|
F4("stm32f4discovery.cfg"),
|
||||||
|
F7("st_nucleo_f7.cfg");
|
||||||
|
|
||||||
|
private final String openOcdName;
|
||||||
|
|
||||||
|
HwPlatform(String openOcdName) {
|
||||||
|
this.openOcdName = openOcdName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpenOcdName() {
|
||||||
|
return openOcdName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HwPlatform resolve(String value) {
|
||||||
|
if (F7.name().equalsIgnoreCase(value))
|
||||||
|
return F7;
|
||||||
|
return F4;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue