mirror of https://github.com/rusefi/rusefi.git
only: renaming StLink flasher
This commit is contained in:
parent
2ac6703b16
commit
6066870836
|
@ -7,7 +7,7 @@ import com.rusefi.core.MessagesCentral;
|
||||||
import com.rusefi.io.CommandQueue;
|
import com.rusefi.io.CommandQueue;
|
||||||
import com.rusefi.io.LinkManager;
|
import com.rusefi.io.LinkManager;
|
||||||
import com.rusefi.io.serial.BaudRateHolder;
|
import com.rusefi.io.serial.BaudRateHolder;
|
||||||
import com.rusefi.maintenance.FirmwareFlasher;
|
import com.rusefi.maintenance.StLinkFlasher;
|
||||||
import com.rusefi.maintenance.VersionChecker;
|
import com.rusefi.maintenance.VersionChecker;
|
||||||
import com.rusefi.ui.*;
|
import com.rusefi.ui.*;
|
||||||
import com.rusefi.ui.console.MainFrame;
|
import com.rusefi.ui.console.MainFrame;
|
||||||
|
@ -76,7 +76,7 @@ public class ConsoleUI {
|
||||||
setFrameIcon(ConsoleUI.staticFrame);
|
setFrameIcon(ConsoleUI.staticFrame);
|
||||||
log.info("Console " + CONSOLE_VERSION);
|
log.info("Console " + CONSOLE_VERSION);
|
||||||
|
|
||||||
log.info("Hardware: " + FirmwareFlasher.getHardwareKind());
|
log.info("Hardware: " + StLinkFlasher.getHardwareKind());
|
||||||
|
|
||||||
getConfig().getRoot().setProperty(PORT_KEY, port);
|
getConfig().getRoot().setProperty(PORT_KEY, port);
|
||||||
getConfig().getRoot().setProperty(SPEED_KEY, BaudRateHolder.INSTANCE.baudRate);
|
getConfig().getRoot().setProperty(SPEED_KEY, BaudRateHolder.INSTANCE.baudRate);
|
||||||
|
|
|
@ -9,7 +9,7 @@ import com.rusefi.core.ui.FrameHelper;
|
||||||
import com.rusefi.io.LinkManager;
|
import com.rusefi.io.LinkManager;
|
||||||
import com.rusefi.io.serial.BaudRateHolder;
|
import com.rusefi.io.serial.BaudRateHolder;
|
||||||
import com.rusefi.maintenance.DriverInstall;
|
import com.rusefi.maintenance.DriverInstall;
|
||||||
import com.rusefi.maintenance.FirmwareFlasher;
|
import com.rusefi.maintenance.StLinkFlasher;
|
||||||
import com.rusefi.maintenance.ProgramSelector;
|
import com.rusefi.maintenance.ProgramSelector;
|
||||||
import com.rusefi.ui.LogoHelper;
|
import com.rusefi.ui.LogoHelper;
|
||||||
import com.rusefi.ui.util.HorizontalLine;
|
import com.rusefi.ui.util.HorizontalLine;
|
||||||
|
@ -25,7 +25,6 @@ import javax.swing.*;
|
||||||
import javax.swing.border.TitledBorder;
|
import javax.swing.border.TitledBorder;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import java.io.File;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.devexperts.logging.Logging.getLogging;
|
import static com.devexperts.logging.Logging.getLogging;
|
||||||
|
@ -40,7 +39,7 @@ import static javax.swing.JOptionPane.YES_NO_OPTION;
|
||||||
* <p/>
|
* <p/>
|
||||||
* 2/14/14
|
* 2/14/14
|
||||||
* @see SimulatorHelper
|
* @see SimulatorHelper
|
||||||
* @see FirmwareFlasher
|
* @see StLinkFlasher
|
||||||
*/
|
*/
|
||||||
public class StartupFrame {
|
public class StartupFrame {
|
||||||
private static final Logging log = getLogging(Launcher.class);
|
private static final Logging log = getLogging(Launcher.class);
|
||||||
|
|
|
@ -26,10 +26,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import static com.rusefi.core.ui.FrameHelper.appendBundleName;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see FirmwareFlasher
|
* @see StLinkFlasher
|
||||||
*/
|
*/
|
||||||
public class DfuFlasher {
|
public class DfuFlasher {
|
||||||
private static final String DFU_BINARY_LOCATION = Launcher.TOOLS_PATH + File.separator + "STM32_Programmer_CLI/bin";
|
private static final String DFU_BINARY_LOCATION = Launcher.TOOLS_PATH + File.separator + "STM32_Programmer_CLI/bin";
|
||||||
|
|
|
@ -8,7 +8,7 @@ import javax.swing.*;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
|
||||||
import static com.rusefi.maintenance.FirmwareFlasher.TITLE;
|
import static com.rusefi.maintenance.StLinkFlasher.TITLE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Andrey Belomutskiy, (c) 2013-2020
|
* Andrey Belomutskiy, (c) 2013-2020
|
||||||
|
@ -32,13 +32,13 @@ public class EraseChip {
|
||||||
StatusAnimation sa = new StatusAnimation(wnd);
|
StatusAnimation sa = new StatusAnimation(wnd);
|
||||||
ExecHelper.submitAction(() -> {
|
ExecHelper.submitAction(() -> {
|
||||||
try {
|
try {
|
||||||
FirmwareFlasher.executeOpenOCDCommand(getEraseCommand(), wnd);
|
StLinkFlasher.executeOpenOCDCommand(getEraseCommand(), wnd);
|
||||||
} catch (FileNotFoundException ex) {
|
} catch (FileNotFoundException ex) {
|
||||||
wnd.append(ex.toString());
|
wnd.append(ex.toString());
|
||||||
wnd.error();
|
wnd.error();
|
||||||
}
|
}
|
||||||
sa.stop();
|
sa.stop();
|
||||||
wnd.setStatus(FirmwareFlasher.DONE);
|
wnd.setStatus(StLinkFlasher.DONE);
|
||||||
}, EraseChip.this.getClass() + " extProcessThread");
|
}, EraseChip.this.getClass() + " extProcessThread");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -46,7 +46,7 @@ public class EraseChip {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private String getEraseCommand() {
|
private String getEraseCommand() {
|
||||||
return FirmwareFlasher.getOpenocdCommand() + ERASE_COMMAND_SUFFIX;
|
return StLinkFlasher.getOpenocdCommand() + ERASE_COMMAND_SUFFIX;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JButton getButton() {
|
public JButton getButton() {
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class ProgramSelector {
|
||||||
case ST_LINK:
|
case ST_LINK:
|
||||||
job = updateOperationCallbacks -> {
|
job = updateOperationCallbacks -> {
|
||||||
// todo: add ST-LINK no-assert mode? or not?
|
// todo: add ST-LINK no-assert mode? or not?
|
||||||
FirmwareFlasher.doUpdateFirmware(FirmwareFlasher.IMAGE_FILE, updateFirmware);
|
StLinkFlasher.doUpdateFirmware(StLinkFlasher.IMAGE_FILE, updateFirmware);
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case DFU_SWITCH:
|
case DFU_SWITCH:
|
||||||
|
|
|
@ -19,7 +19,10 @@ import static com.rusefi.core.preferences.storage.PersistentConfiguration.getCon
|
||||||
* Andrey Belomutskiy, (c) 2013-2020
|
* Andrey Belomutskiy, (c) 2013-2020
|
||||||
* 2/4/15
|
* 2/4/15
|
||||||
*/
|
*/
|
||||||
public class FirmwareFlasher {
|
public class StLinkFlasher {
|
||||||
|
/**
|
||||||
|
* this file is used for ST-LINK flashing option, do we still need it at all?
|
||||||
|
*/
|
||||||
public static final String IMAGE_FILE = INPUT_FILES_PATH + "/" + "rusefi.bin";
|
public static final String IMAGE_FILE = INPUT_FILES_PATH + "/" + "rusefi.bin";
|
||||||
/**
|
/**
|
||||||
* SWD ST-LINK/V2 mode
|
* SWD ST-LINK/V2 mode
|
||||||
|
@ -34,7 +37,7 @@ public class FirmwareFlasher {
|
||||||
|
|
||||||
private final JButton button;
|
private final JButton button;
|
||||||
|
|
||||||
public FirmwareFlasher(String fileName, String buttonTest, String tooltip) {
|
public StLinkFlasher(String fileName, String buttonTest, String tooltip) {
|
||||||
button = new JButton(buttonTest);
|
button = new JButton(buttonTest);
|
||||||
button.setToolTipText(tooltip);
|
button.setToolTipText(tooltip);
|
||||||
button.addActionListener(event -> doUpdateFirmware(fileName, button));
|
button.addActionListener(event -> doUpdateFirmware(fileName, button));
|
||||||
|
@ -50,7 +53,7 @@ public class FirmwareFlasher {
|
||||||
wnd.getFrame().setLocationRelativeTo(parent);
|
wnd.getFrame().setLocationRelativeTo(parent);
|
||||||
wnd.showFrame(TITLE);
|
wnd.showFrame(TITLE);
|
||||||
|
|
||||||
ExecHelper.submitAction(() -> doFlashFirmware(wnd, fileName), FirmwareFlasher.class + " extProcessThread");
|
ExecHelper.submitAction(() -> doFlashFirmware(wnd, fileName), StLinkFlasher.class + " extProcessThread");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getOpenocdCommand() {
|
public static String getOpenocdCommand() {
|
|
@ -10,6 +10,9 @@ import cz.jaybee.intelhex.IntelHexException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* prototype of our own DFU frontend, not used in real life
|
||||||
|
*/
|
||||||
public class DfuTool {
|
public class DfuTool {
|
||||||
public static void run(String[] args) throws IOException, IntelHexException {
|
public static void run(String[] args) throws IOException, IntelHexException {
|
||||||
if (args.length < 2) {
|
if (args.length < 2) {
|
||||||
|
|
Loading…
Reference in New Issue