From 0f9301ca2bd89234d3a5d5003a8de4f74aec2390 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Sun, 24 Sep 2017 23:10:51 -0500 Subject: [PATCH 1/2] bootloader: Cleanup code, reduce duplication * Take latest pirate-loader since it should work for BPv3 and BPv4. (to test) * Old BPv3 stuff saved for now in old directory --- .../pirate-loader/pirate-loader.c | 754 ------------------ .../{BPv3-bootloader => BPv3}/COPYING.txt | 0 .../firmware-v4.1/src => BPv3}/devices.inc | 0 .../ds30loader.X/Makefile | 0 .../ds30loader.X/nbproject/configurations.xml | 0 .../ds30loader.X/nbproject/project.xml | 0 .../firmware-v4.5 => BPv3}/ds30loader.s | 0 .../old}/ds30_Loader_GUI/GHelper.dll | Bin .../old}/ds30_Loader_GUI/ds30 Loader GUI.exe | Bin .../old}/ds30_Loader_GUI/ds30 Loader.dll | Bin .../old}/ds30_Loader_GUI/settings.xml | 0 .../old}/firmware-v4.1/ds30loader.mcp | 0 .../old}/firmware-v4.1/ds30loader.mcs | 0 .../old}/firmware-v4.1/ds30loader.mcw | Bin .../old/firmware-v4.1}/src/devices.inc | 0 .../old}/firmware-v4.1/src/ds30loader.s | 0 .../old}/firmware-v4.1/src/settings.inc | 0 .../old}/firmware-v4.3/ds30loader.mcp | 0 .../old}/firmware-v4.3/ds30loader.mcs | 0 .../old}/firmware-v4.3/ds30loader.mcw | Bin .../old/firmware-v4.3/src}/devices.inc | 0 .../old}/firmware-v4.3/src/ds30loader.s | 0 .../old}/firmware-v4.3/src/settings.inc | 0 .../old}/hex2prog.html | 0 .../old}/upgrader-v2tov4/APP 24FJ64GA002.gld | 0 .../upgrader-v2tov4/BPv3-blv4updater-v0.2.hex | 0 .../old}/upgrader-v2tov4/clean.bat | 0 .../old}/upgrader-v2tov4/convert.html | 0 .../old}/upgrader-v2tov4/firmware.h | 0 .../old}/upgrader-v2tov4/flash.h | 0 .../old}/upgrader-v2tov4/flash.s | 0 .../old}/upgrader-v2tov4/hardware.h | 0 .../old}/upgrader-v2tov4/hardwarev0a.h | 0 .../old}/upgrader-v2tov4/hardwarev1a.h | 0 .../old}/upgrader-v2tov4/hardwarev25.h | 0 .../old}/upgrader-v2tov4/hardwarev2a.h | 0 .../old}/upgrader-v2tov4/hardwarev3.h | 0 .../old}/upgrader-v2tov4/hex2prog.html | 0 .../old}/upgrader-v2tov4/installer.mcp | 0 .../old}/upgrader-v2tov4/installer.mcs | 0 .../old}/upgrader-v2tov4/installer.mcw | Bin .../old}/upgrader-v2tov4/main.c | 0 .../old}/upgrader-v4tov4/clean.bat | 0 .../old}/upgrader-v4tov4/convert.html | 0 .../old}/upgrader-v4tov4/firmware.h | 0 .../old}/upgrader-v4tov4/flash.h | 0 .../old}/upgrader-v4tov4/flash.s | 0 .../old}/upgrader-v4tov4/hardware.h | 0 .../old}/upgrader-v4tov4/hardwarev0a.h | 0 .../old}/upgrader-v4tov4/hardwarev1a.h | 0 .../old}/upgrader-v4tov4/hardwarev25.h | 0 .../old}/upgrader-v4tov4/hardwarev2a.h | 0 .../old}/upgrader-v4tov4/hardwarev3.h | 0 .../old}/upgrader-v4tov4/hex2prog.html | 0 .../old}/upgrader-v4tov4/installer.mcp | 0 .../old}/upgrader-v4tov4/installer.mcs | 0 .../old}/upgrader-v4tov4/installer.mcw | Bin .../old}/upgrader-v4tov4/main.c | 0 .../old}/upgrader-v4tov4/p24FJ64GA002.gld | 0 .../upgrader/BPv3-v2blupdaterVa3-v4.1.hex | 0 .../upgrader/P24QP.exe | Bin .../upgrader/P24qp.ini | 0 .../upgrader/P24qp.py | 0 .../upgrader/PICBOOT.dll | Bin .../v4firmware/BPv3-Firmware-v4.1.hex | 0 .../v4firmware/GHelper.dll | Bin .../v4firmware/ds30 Loader GUI.exe | Bin .../v4firmware/ds30 Loader.dll | Bin .../v4firmware/settings.xml | 0 .../!v4UPGRADES!!!.txt | 0 .../!v4UPGRADES!!.txt | 0 .../!v4UPGRADES!.txt | 0 .../BPv3-Firmware-v4.5.hex | 0 .../BPv3-bootloader-upgrade-v4xtov4.3.hex | 0 .../utilities/!v4UPGRADES!!!.txt | 0 .../utilities/!v4UPGRADES!!.txt | 0 .../utilities/!v4UPGRADES!.txt | 0 .../utilities/GHelper.dll | Bin .../utilities/ds30 Loader GUI.exe | Bin .../utilities/ds30 Loader.dll | Bin .../utilities/pirate-loader.exe | Bin .../utilities/pirate-loader_lnx | Bin .../utilities/pirate-loader_mac | Bin .../utilities/settings.xml | 0 .../firmware-v4.5 => BPv3}/p24FJ64GA002.gld | 0 .../firmware-v4.5 => BPv3}/settings.inc | 0 .../pirate-loader/CMakeLists.txt | 20 - .../BPv4-bootloader/pirate-loader/test.bat | 34 - .../BPv4-bootloader/pirate-loader/test.sh | 55 -- .../firmware-v1 => BPv4}/boot_config.h | 0 .../firmware-v1 => BPv4}/bootloader.c | 0 .../firmware-v1 => BPv4}/bootloader.h | 0 .../bpv4-bootloader.X/Makefile | 0 .../nbproject/configurations.xml | 0 .../bpv4-bootloader.X/nbproject/project.xml | 0 .../firmware-v1 => BPv4}/cdc.c | 0 .../firmware-v1 => BPv4}/cdc.h | 0 .../firmware-v1 => BPv4}/descriptors.h | 0 .../firmware-v1 => BPv4}/globals.h | 0 .../firmware-v1 => BPv4}/main.c | 0 .../firmware-v1 => BPv4}/p24FJ256GB106.gld | 0 .../firmware-v1 => BPv4}/picusb.h | 0 .../firmware-v1 => BPv4}/usb_lang.h | 0 .../firmware-v1 => BPv4}/usb_stack.c | 0 .../firmware-v1 => BPv4}/usb_stack.h | 0 .../pirate-loader/CMakeLists.txt | 0 .../pirate-loader/pirate-loader.c | 0 .../pirate-loader/test.bat | 0 .../pirate-loader/test.sh | 0 109 files changed, 863 deletions(-) delete mode 100644 Bootloaders/BPv3-bootloader/pirate-loader/pirate-loader.c rename Bootloaders/{BPv3-bootloader => BPv3}/COPYING.txt (100%) rename Bootloaders/{BPv3-bootloader/firmware-v4.1/src => BPv3}/devices.inc (100%) rename Bootloaders/{BPv3-bootloader/firmware-v4.5 => BPv3}/ds30loader.X/Makefile (100%) rename Bootloaders/{BPv3-bootloader/firmware-v4.5 => BPv3}/ds30loader.X/nbproject/configurations.xml (100%) rename Bootloaders/{BPv3-bootloader/firmware-v4.5 => BPv3}/ds30loader.X/nbproject/project.xml (100%) rename Bootloaders/{BPv3-bootloader/firmware-v4.5 => BPv3}/ds30loader.s (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/ds30_Loader_GUI/GHelper.dll (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/ds30_Loader_GUI/ds30 Loader GUI.exe (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/ds30_Loader_GUI/ds30 Loader.dll (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/ds30_Loader_GUI/settings.xml (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/firmware-v4.1/ds30loader.mcp (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/firmware-v4.1/ds30loader.mcs (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/firmware-v4.1/ds30loader.mcw (100%) rename Bootloaders/{BPv3-bootloader/firmware-v4.3 => BPv3/old/firmware-v4.1}/src/devices.inc (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/firmware-v4.1/src/ds30loader.s (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/firmware-v4.1/src/settings.inc (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/firmware-v4.3/ds30loader.mcp (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/firmware-v4.3/ds30loader.mcs (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/firmware-v4.3/ds30loader.mcw (100%) rename Bootloaders/{BPv3-bootloader/firmware-v4.5 => BPv3/old/firmware-v4.3/src}/devices.inc (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/firmware-v4.3/src/ds30loader.s (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/firmware-v4.3/src/settings.inc (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/hex2prog.html (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/APP 24FJ64GA002.gld (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/BPv3-blv4updater-v0.2.hex (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/clean.bat (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/convert.html (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/firmware.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/flash.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/flash.s (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/hardware.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/hardwarev0a.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/hardwarev1a.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/hardwarev25.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/hardwarev2a.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/hardwarev3.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/hex2prog.html (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/installer.mcp (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/installer.mcs (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/installer.mcw (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v2tov4/main.c (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/clean.bat (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/convert.html (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/firmware.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/flash.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/flash.s (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/hardware.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/hardwarev0a.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/hardwarev1a.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/hardwarev25.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/hardwarev2a.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/hardwarev3.h (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/hex2prog.html (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/installer.mcp (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/installer.mcs (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/installer.mcw (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/main.c (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/upgrader-v4tov4/p24FJ64GA002.gld (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v2tov4-bootloader-update/upgrader/BPv3-v2blupdaterVa3-v4.1.hex (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v2tov4-bootloader-update/upgrader/P24QP.exe (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v2tov4-bootloader-update/upgrader/P24qp.ini (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v2tov4-bootloader-update/upgrader/P24qp.py (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v2tov4-bootloader-update/upgrader/PICBOOT.dll (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v2tov4-bootloader-update/v4firmware/BPv3-Firmware-v4.1.hex (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v2tov4-bootloader-update/v4firmware/GHelper.dll (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v2tov4-bootloader-update/v4firmware/ds30 Loader GUI.exe (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v2tov4-bootloader-update/v4firmware/ds30 Loader.dll (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v2tov4-bootloader-update/v4firmware/settings.xml (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/!v4UPGRADES!!!.txt (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/!v4UPGRADES!!.txt (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/!v4UPGRADES!.txt (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/BPv3-Firmware-v4.5.hex (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/BPv3-bootloader-upgrade-v4xtov4.3.hex (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/utilities/!v4UPGRADES!!!.txt (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/utilities/!v4UPGRADES!!.txt (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/utilities/!v4UPGRADES!.txt (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/utilities/GHelper.dll (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/utilities/ds30 Loader GUI.exe (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/utilities/ds30 Loader.dll (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/utilities/pirate-loader.exe (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/utilities/pirate-loader_lnx (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/utilities/pirate-loader_mac (100%) rename Bootloaders/{BPv3-bootloader => BPv3/old}/v4xtov43-bootloader-update/utilities/settings.xml (100%) rename Bootloaders/{BPv3-bootloader/firmware-v4.5 => BPv3}/p24FJ64GA002.gld (100%) rename Bootloaders/{BPv3-bootloader/firmware-v4.5 => BPv3}/settings.inc (100%) delete mode 100644 Bootloaders/BPv4-bootloader/pirate-loader/CMakeLists.txt delete mode 100644 Bootloaders/BPv4-bootloader/pirate-loader/test.bat delete mode 100644 Bootloaders/BPv4-bootloader/pirate-loader/test.sh rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/boot_config.h (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/bootloader.c (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/bootloader.h (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/bpv4-bootloader.X/Makefile (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/bpv4-bootloader.X/nbproject/configurations.xml (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/bpv4-bootloader.X/nbproject/project.xml (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/cdc.c (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/cdc.h (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/descriptors.h (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/globals.h (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/main.c (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/p24FJ256GB106.gld (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/picusb.h (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/usb_lang.h (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/usb_stack.c (100%) rename Bootloaders/{BPv4-bootloader/firmware-v1 => BPv4}/usb_stack.h (100%) rename Bootloaders/{BPv3-bootloader => }/pirate-loader/CMakeLists.txt (100%) rename Bootloaders/{BPv4-bootloader => }/pirate-loader/pirate-loader.c (100%) rename Bootloaders/{BPv3-bootloader => }/pirate-loader/test.bat (100%) rename Bootloaders/{BPv3-bootloader => }/pirate-loader/test.sh (100%) diff --git a/Bootloaders/BPv3-bootloader/pirate-loader/pirate-loader.c b/Bootloaders/BPv3-bootloader/pirate-loader/pirate-loader.c deleted file mode 100644 index 4d791d65..00000000 --- a/Bootloaders/BPv3-bootloader/pirate-loader/pirate-loader.c +++ /dev/null @@ -1,754 +0,0 @@ -/* - - Pirate-Loader for Bootloader v4 - - Version : 1.0.2 - - Changelog: - +2010-06-28 - Made HEX parser case-insensative - - + 2010-02-04 - Changed polling interval to 10ms on Windows select wrapper, suggested by Michal (robots) - - + 2010-02-04 - Added sleep(0) between write instructions, patch submitted by kbulgrien - - + 2010-01-22 - Added loader version number to the console output and source code - - + 2010-01-19 - Fixed BigEndian incompatibility - - Added programming simulate switch ( --simulate ) for data verification - - + 2010-01-18 - Initial release - - - Building: - - UNIX family systems: - - gcc pirate-loader.c -o pirate-loader - - WINDOWS: - - cl pirate-loader.c /DWIN32=1 - - - Usage: - - Run ./pirate-loader --help for more information on usage and possible switches - - */ - -#include -#include -#include -#include -#include - -#define PIRATE_LOADER_VERSION "1.0.2" - -#define STR_EXPAND(tok) #tok -#define OS_NAME(tok) STR_EXPAND(tok) - - -#ifdef WIN32 - #include - #include - - #define O_NOCTTY 0 - #define O_NDELAY 0 - #define B115200 115200 - - #define OS WINDOWS - - int write(int fd, const void* buf, int len) - { - HANDLE hCom = (HANDLE)fd; - int res = 0; - unsigned long bwritten = 0; - - - res = WriteFile(hCom, buf, len, &bwritten, NULL); - - if( res == FALSE ) { - return -1; - } else { - return bwritten; - } - } - - int read(int fd, void* buf, int len) - { - HANDLE hCom = (HANDLE)fd; - int res = 0; - unsigned long bread = 0; - - res = ReadFile(hCom, buf, len, &bread, NULL); - - if( res == FALSE ) { - return -1; - } else { - return bread; - } - } - - int close(int fd) - { - HANDLE hCom = (HANDLE)fd; - - CloseHandle(hCom); - return 0; - } - - int open(const char* path, unsigned long flags) - { - static char full_path[32] = {0}; - - HANDLE hCom = NULL; - - if( path[0] != '\\' ) { - _snprintf(full_path, sizeof(full_path) - 1, "\\\\.\\%s", path); - path = full_path; - } - - hCom = CreateFileA(path, GENERIC_WRITE | GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - - if( !hCom || hCom == INVALID_HANDLE_VALUE ) { - return -1; - } else { - return (int)hCom; - } - } - - int __stdcall select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfs, const struct timeval* timeout) - { - time_t maxtc = time(0) + (timeout->tv_sec); - COMSTAT cs = {0}; - unsigned long dwErrors = 0; - - if( readfds->fd_count != 1 ) { - return -1; - } - - while( time(0) <= maxtc ) - { //only one file supported - if( ClearCommError( (HANDLE)readfds->fd_array[0], 0, &cs) != TRUE ){ - return -1; - } - - if( cs.cbInQue > 0 ) { - return 1; - } - - Sleep(10); - } - return 0; - } - - unsigned int sleep(unsigned int sec) - { - Sleep(sec * 1000); - - return 0; - } - -#else - #include - #include - #include - #include - #include -#endif - -/* macro definitions */ - -#if !defined OS -#define OS UNKNOWN -#endif - -#define BOOTLOADER_HELLO_STR "\xC1" -#define BOOTLOADER_OK 0x4B -#define BOOTLOADER_PLACEMENT 1 - -#define PIC_FLASHSIZE 0xAC00 - -#define PIC_NUM_PAGES 512 -#define PIC_NUM_ROWS_IN_PAGE 8 -#define PIC_NUM_WORDS_IN_ROW 64 - -#define PIC_WORD_SIZE (3) -#define PIC_ROW_SIZE (PIC_NUM_WORDS_IN_ROW * PIC_WORD_SIZE) -#define PIC_PAGE_SIZE (PIC_NUM_ROWS_IN_PAGE * PIC_ROW_SIZE) - - -#define PIC_ROW_ADDR(p,r) (((p) * PIC_PAGE_SIZE) + ((r) * PIC_ROW_SIZE)) -#define PIC_WORD_ADDR(p,r,w) (PIC_ROW_ADDR(p,r) + ((w) * PIC_WORD_SIZE)) -#define PIC_PAGE_ADDR(p) (PIC_PAGE_SIZE * (p)) - -#define PAYLOAD_OFFSET 5 -#define HEADER_LENGTH PAYLOAD_OFFSET -#define LENGTH_OFFSET 4 -#define COMMAND_OFFSET 3 - -/* type definitions */ - -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned long uint32; - -/* global settings, command line arguments */ - -uint8 g_verbose = 0; -uint8 g_hello_only = 0; -uint8 g_simulate = 0; -const char* g_device_path = NULL; -const char* g_hexfile_path = NULL; - -/* functions */ - -int readWithTimeout(int fd, uint8* out, int length, int timeout) -{ - fd_set fds; - struct timeval tv = {timeout, 0}; - int res = -1; - int got = 0; - - do { - - FD_ZERO(&fds); - FD_SET(fd, &fds); - - res = select(fd + 1, &fds, NULL, NULL, &tv); - - if( res > 0 ) { - res = read(fd, out, length); - if( res > 0 ) { - length -= res; - got += res; - out += res; - } else { - break; - } - } else { - return res; - } - } while( length > 0); - - return got; -} - -unsigned char hexdec(const char* pc) -{ unsigned char temp; - - if(pc[0]>='a'){ - temp=pc[0]-'a'+10; - }else if(pc[0] >= 'A'){ - temp=pc[0]-'A'+10; - }else{ - temp=pc[0] - '0'; - } - temp=temp<<4; - - if(pc[1]>='a'){ - temp|=pc[1]-'a'+10; - }else if(pc[1] >= 'A'){ - temp|=pc[1]-'A'+10; - }else{ - temp|=pc[1] - '0'; - } - - return(temp & 0x0FF); - - - //return (((pc[0] >= 'A') ? ( pc[0] - 'A' + 10 ) : ( pc[0] - '0' ) ) << 4 | - // ((pc[1] >= 'A') ? ( pc[1] - 'A' + 10 ) : ( pc[1] - '0' ) )) & 0x0FF; - -} - -void dumpHex(uint8* buf, uint32 len) -{ - uint32 i=0; - - for(i=0; i pline && *pc <= ' ' ) { - *pc-- = 0; - res--; - } - - if( res & 0x01 || res > 512 || res < 10) { - fprintf(stderr, "Incorrect number of characters on line %d:%d\n", line_no, res); - return -1; - } - - hex_crc = 0; - - for( pc = pline, i = 0; i> 1] = hexdec(pc); - hex_crc += linebin[i >> 1]; - } - - binlen = res / 2; - - if( hex_crc != 0 ) { - fprintf(stderr, "Checksum does not match, line %d\n", line_no); - return -1; - } - - hex_addr = (linebin[1] << 8) | linebin[2]; - hex_len = linebin[0]; - hex_type = linebin[3]; - - if( binlen - (1 + 2 + 1 + hex_len + 1) != 0 ) { - fprintf(stderr, "Incorrect number of bytes, line %d\n", line_no); - return -1; - } - - if( hex_type == 0x00 ) - { - f_addr = (hex_base_addr | (hex_addr)) / 2; //PCU - - if( hex_len % 4 ) { - fprintf(stderr, "Misaligned data, line %d\n", line_no); - return -1; - } else if( f_addr >= PIC_FLASHSIZE ) { - fprintf(stderr, "Current record address is higher than maximum allowed, line %d\n", line_no); - return -1; - } - - hex_words = hex_len / 4; - o_addr = (f_addr / 2) * PIC_WORD_SIZE; //BYTES - - for( i=0; i= PIC_FLASHSIZE ) { - fprintf(stderr, "Address out of flash\n"); - return -1; - } - - //erase page - command[0] = (u_addr & 0x00FF0000) >> 16; - command[1] = (u_addr & 0x0000FF00) >> 8; - command[2] = (u_addr & 0x000000FF) >> 0; - command[COMMAND_OFFSET] = 0x01; //erase command - command[LENGTH_OFFSET ] = 0x01; //1 byte, CRC - command[PAYLOAD_OFFSET] = makeCrc(command, 5); - - if( g_verbose ) { - dumpHex(command, HEADER_LENGTH + command[LENGTH_OFFSET]); - } - - printf("Erasing page %ld, %04lx...", page, u_addr); - - if( g_simulate == 0 && sendCommandAndWaitForResponse(fd, command) < 0 ) { - return -1; - } - - puts("OK"); - - //write 8 rows - for( row = 0; row < PIC_NUM_ROWS_IN_PAGE; row ++, u_addr += (PIC_NUM_WORDS_IN_ROW * 2)) - { - command[0] = (u_addr & 0x00FF0000) >> 16; - command[1] = (u_addr & 0x0000FF00) >> 8; - command[2] = (u_addr & 0x000000FF) >> 0; - command[COMMAND_OFFSET] = 0x02; //write command - command[LENGTH_OFFSET ] = PIC_ROW_SIZE + 0x01; //DATA_LENGTH + CRC - - memcpy(&command[PAYLOAD_OFFSET], &data[PIC_ROW_ADDR(page, row)], PIC_ROW_SIZE); - - command[PAYLOAD_OFFSET + PIC_ROW_SIZE] = makeCrc(command, HEADER_LENGTH + PIC_ROW_SIZE); - - printf("Writing page %ld row %ld, %04lx...", page, row + page*PIC_NUM_ROWS_IN_PAGE, u_addr); - - if( g_simulate == 0 && sendCommandAndWaitForResponse(fd, command) < 0 ) { - return -1; - } - - puts("OK"); - - sleep(0); - - if( g_verbose ) { - dumpHex(command, HEADER_LENGTH + command[LENGTH_OFFSET]); - } - done += PIC_ROW_SIZE; - } - } - - return done; -} - -void fixJumps(uint8* bin_buff, uint8* pages_used) -{ - uint32 iGotoUserAppAdress = 0; - uint32 iGotoUserAppAdressB3 = 0, iIter = 0; - uint32 iBLAddress = 0; - - iBLAddress = ( PIC_FLASHSIZE - (BOOTLOADER_PLACEMENT * PIC_NUM_ROWS_IN_PAGE * PIC_NUM_WORDS_IN_ROW * 2)); //PCU - iGotoUserAppAdress = iBLAddress - 4; - iGotoUserAppAdressB3 = (iGotoUserAppAdress / 2) * 3; - - for ( iIter = 0; iIter < 6; iIter++ ) { - bin_buff[ iGotoUserAppAdressB3 + iIter ] = bin_buff[ iIter ]; - } - - pages_used[ (iGotoUserAppAdressB3 / PIC_PAGE_SIZE) ] = 1; - - bin_buff[0] = 0x04; - bin_buff[1] = ( (iBLAddress & 0x0000FE) ); - bin_buff[2] = ( (iBLAddress & 0x00FF00) >> 8 ); - bin_buff[3] = 0x00; - bin_buff[4] = ( (iBLAddress & 0x7F0000) >> 16 ); - bin_buff[5] = 0x00; -} - -/* non-firmware functions */ - -int configurePort(int fd, unsigned long baudrate) -{ -#ifdef WIN32 - DCB dcb = {0}; - HANDLE hCom = (HANDLE)fd; - - dcb.DCBlength = sizeof(dcb); - - dcb.BaudRate = baudrate; - dcb.ByteSize = 8; - dcb.Parity = NOPARITY; - dcb.StopBits = ONESTOPBIT; - - if( !SetCommState(hCom, &dcb) ){ - return -1; - } - - return (int)hCom; -#else - struct termios g_new_tio; - - memset(&g_new_tio, 0x00 , sizeof(g_new_tio)); - cfmakeraw(&g_new_tio); - - g_new_tio.c_cflag |= (CS8 | CLOCAL | CREAD); - g_new_tio.c_cflag &= ~(PARENB | CSTOPB | CSIZE); - g_new_tio.c_oflag = 0; - g_new_tio.c_lflag = 0; - - - g_new_tio.c_cc[VTIME] = 0; - g_new_tio.c_cc[VMIN] = 1; - - cfsetispeed (&g_new_tio, baudrate); - cfsetospeed (&g_new_tio, baudrate); - - tcflush(fd, TCIOFLUSH); - - return tcsetattr(fd, TCSANOW, &g_new_tio); -#endif -} - -int openPort(const char* dev, unsigned long flags) -{ - return open(dev, O_RDWR | O_NOCTTY | O_NDELAY | flags); -} - -int parseCommandLine(int argc, const char** argv) -{ - int i = 0; - - for(i=1; i PIC_FLASHSIZE ) { - fprintf(stderr, "Could not load HEX file, result=%d\n", res); - goto Error; - } - - printf("Found %d words (%d bytes)\n", res, res * 3); - - printf("Fixing bootloader/userprogram jumps\n"); - fixJumps(bin_buff, pages_used); - } - - if( g_simulate ) { - sendFirmware(dev_fd, bin_buff, pages_used); - goto Finished; - } - - if( !g_device_path ) { - fprintf(stderr, "Please specify serial device path --dev=/dev/...\n"); - return -1; - } - - printf("Opening serial device %s...", g_device_path); - - dev_fd = openPort(g_device_path, 0); - - if( dev_fd < 0 ) { - puts("ERROR"); - fprintf(stderr, "Could not open %s\n", g_device_path); - goto Error; - } - puts("OK"); - - printf("Configuring serial port settings..."); - - if( configurePort(dev_fd, B115200) < 0 ) { - puts("ERROR"); - fprintf(stderr, "Could not configure device, errno=%d\n", errno); - goto Error; - } - puts("OK"); - - printf("Sending Hello to the Bootloader..."); - - //send HELLO - res = write(dev_fd, BOOTLOADER_HELLO_STR, 1); - - res = readWithTimeout(dev_fd, buffer, 4, 3); - - if( res != 4 || buffer[3] != BOOTLOADER_OK ) { - puts("ERROR"); - fprintf(stderr, "No reply from the bootloader, or invalid reply received: %d\n", res); - fprintf(stderr, "Please make sure that PGND and PGC are connected, replug the device and try again\n"); - goto Error; - } - puts("OK\n"); //extra LF for spacing - - printf("Device ID: %s [%02x]\n", (buffer[0] == 0xD4) ? "PIC24FJ64GA002" : "UNKNOWN", buffer[0]); - printf("Bootloader version: %d,%02d\n", buffer[1], buffer[2]); - - if( buffer[0] != 0xD4 ) { - fprintf(stderr, "Unsupported device (%02x:UNKNOWN), only 0xD4 PIC24FJ64GA002 is supported\n", buffer[0]); - goto Error; - } - - if( !g_hello_only ) { - - res = sendFirmware(dev_fd, bin_buff, pages_used); - - if( res > 0 ) { - puts("\nFirmware updated successfully :)!"); - printf("Use screen %s 115200 to verify\n", g_device_path); - } else { - puts("\nError updating firmware :("); - goto Error; - } - - } - -Finished: - if( bin_buff ) { - free( bin_buff ); - } - close(dev_fd); - return 0; - -Error: - if( bin_buff ) { - free( bin_buff ); - } - if( dev_fd >= 0 ) { - close(dev_fd); - } - return -1; -} diff --git a/Bootloaders/BPv3-bootloader/COPYING.txt b/Bootloaders/BPv3/COPYING.txt similarity index 100% rename from Bootloaders/BPv3-bootloader/COPYING.txt rename to Bootloaders/BPv3/COPYING.txt diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.1/src/devices.inc b/Bootloaders/BPv3/devices.inc similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.1/src/devices.inc rename to Bootloaders/BPv3/devices.inc diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.5/ds30loader.X/Makefile b/Bootloaders/BPv3/ds30loader.X/Makefile similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.5/ds30loader.X/Makefile rename to Bootloaders/BPv3/ds30loader.X/Makefile diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.5/ds30loader.X/nbproject/configurations.xml b/Bootloaders/BPv3/ds30loader.X/nbproject/configurations.xml similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.5/ds30loader.X/nbproject/configurations.xml rename to Bootloaders/BPv3/ds30loader.X/nbproject/configurations.xml diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.5/ds30loader.X/nbproject/project.xml b/Bootloaders/BPv3/ds30loader.X/nbproject/project.xml similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.5/ds30loader.X/nbproject/project.xml rename to Bootloaders/BPv3/ds30loader.X/nbproject/project.xml diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.5/ds30loader.s b/Bootloaders/BPv3/ds30loader.s similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.5/ds30loader.s rename to Bootloaders/BPv3/ds30loader.s diff --git a/Bootloaders/BPv3-bootloader/ds30_Loader_GUI/GHelper.dll b/Bootloaders/BPv3/old/ds30_Loader_GUI/GHelper.dll similarity index 100% rename from Bootloaders/BPv3-bootloader/ds30_Loader_GUI/GHelper.dll rename to Bootloaders/BPv3/old/ds30_Loader_GUI/GHelper.dll diff --git a/Bootloaders/BPv3-bootloader/ds30_Loader_GUI/ds30 Loader GUI.exe b/Bootloaders/BPv3/old/ds30_Loader_GUI/ds30 Loader GUI.exe similarity index 100% rename from Bootloaders/BPv3-bootloader/ds30_Loader_GUI/ds30 Loader GUI.exe rename to Bootloaders/BPv3/old/ds30_Loader_GUI/ds30 Loader GUI.exe diff --git a/Bootloaders/BPv3-bootloader/ds30_Loader_GUI/ds30 Loader.dll b/Bootloaders/BPv3/old/ds30_Loader_GUI/ds30 Loader.dll similarity index 100% rename from Bootloaders/BPv3-bootloader/ds30_Loader_GUI/ds30 Loader.dll rename to Bootloaders/BPv3/old/ds30_Loader_GUI/ds30 Loader.dll diff --git a/Bootloaders/BPv3-bootloader/ds30_Loader_GUI/settings.xml b/Bootloaders/BPv3/old/ds30_Loader_GUI/settings.xml similarity index 100% rename from Bootloaders/BPv3-bootloader/ds30_Loader_GUI/settings.xml rename to Bootloaders/BPv3/old/ds30_Loader_GUI/settings.xml diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.1/ds30loader.mcp b/Bootloaders/BPv3/old/firmware-v4.1/ds30loader.mcp similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.1/ds30loader.mcp rename to Bootloaders/BPv3/old/firmware-v4.1/ds30loader.mcp diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.1/ds30loader.mcs b/Bootloaders/BPv3/old/firmware-v4.1/ds30loader.mcs similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.1/ds30loader.mcs rename to Bootloaders/BPv3/old/firmware-v4.1/ds30loader.mcs diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.1/ds30loader.mcw b/Bootloaders/BPv3/old/firmware-v4.1/ds30loader.mcw similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.1/ds30loader.mcw rename to Bootloaders/BPv3/old/firmware-v4.1/ds30loader.mcw diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.3/src/devices.inc b/Bootloaders/BPv3/old/firmware-v4.1/src/devices.inc similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.3/src/devices.inc rename to Bootloaders/BPv3/old/firmware-v4.1/src/devices.inc diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.1/src/ds30loader.s b/Bootloaders/BPv3/old/firmware-v4.1/src/ds30loader.s similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.1/src/ds30loader.s rename to Bootloaders/BPv3/old/firmware-v4.1/src/ds30loader.s diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.1/src/settings.inc b/Bootloaders/BPv3/old/firmware-v4.1/src/settings.inc similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.1/src/settings.inc rename to Bootloaders/BPv3/old/firmware-v4.1/src/settings.inc diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.3/ds30loader.mcp b/Bootloaders/BPv3/old/firmware-v4.3/ds30loader.mcp similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.3/ds30loader.mcp rename to Bootloaders/BPv3/old/firmware-v4.3/ds30loader.mcp diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.3/ds30loader.mcs b/Bootloaders/BPv3/old/firmware-v4.3/ds30loader.mcs similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.3/ds30loader.mcs rename to Bootloaders/BPv3/old/firmware-v4.3/ds30loader.mcs diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.3/ds30loader.mcw b/Bootloaders/BPv3/old/firmware-v4.3/ds30loader.mcw similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.3/ds30loader.mcw rename to Bootloaders/BPv3/old/firmware-v4.3/ds30loader.mcw diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.5/devices.inc b/Bootloaders/BPv3/old/firmware-v4.3/src/devices.inc similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.5/devices.inc rename to Bootloaders/BPv3/old/firmware-v4.3/src/devices.inc diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.3/src/ds30loader.s b/Bootloaders/BPv3/old/firmware-v4.3/src/ds30loader.s similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.3/src/ds30loader.s rename to Bootloaders/BPv3/old/firmware-v4.3/src/ds30loader.s diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.3/src/settings.inc b/Bootloaders/BPv3/old/firmware-v4.3/src/settings.inc similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.3/src/settings.inc rename to Bootloaders/BPv3/old/firmware-v4.3/src/settings.inc diff --git a/Bootloaders/BPv3-bootloader/hex2prog.html b/Bootloaders/BPv3/old/hex2prog.html similarity index 100% rename from Bootloaders/BPv3-bootloader/hex2prog.html rename to Bootloaders/BPv3/old/hex2prog.html diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/APP 24FJ64GA002.gld b/Bootloaders/BPv3/old/upgrader-v2tov4/APP 24FJ64GA002.gld similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/APP 24FJ64GA002.gld rename to Bootloaders/BPv3/old/upgrader-v2tov4/APP 24FJ64GA002.gld diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/BPv3-blv4updater-v0.2.hex b/Bootloaders/BPv3/old/upgrader-v2tov4/BPv3-blv4updater-v0.2.hex similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/BPv3-blv4updater-v0.2.hex rename to Bootloaders/BPv3/old/upgrader-v2tov4/BPv3-blv4updater-v0.2.hex diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/clean.bat b/Bootloaders/BPv3/old/upgrader-v2tov4/clean.bat similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/clean.bat rename to Bootloaders/BPv3/old/upgrader-v2tov4/clean.bat diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/convert.html b/Bootloaders/BPv3/old/upgrader-v2tov4/convert.html similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/convert.html rename to Bootloaders/BPv3/old/upgrader-v2tov4/convert.html diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/firmware.h b/Bootloaders/BPv3/old/upgrader-v2tov4/firmware.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/firmware.h rename to Bootloaders/BPv3/old/upgrader-v2tov4/firmware.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/flash.h b/Bootloaders/BPv3/old/upgrader-v2tov4/flash.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/flash.h rename to Bootloaders/BPv3/old/upgrader-v2tov4/flash.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/flash.s b/Bootloaders/BPv3/old/upgrader-v2tov4/flash.s similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/flash.s rename to Bootloaders/BPv3/old/upgrader-v2tov4/flash.s diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/hardware.h b/Bootloaders/BPv3/old/upgrader-v2tov4/hardware.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/hardware.h rename to Bootloaders/BPv3/old/upgrader-v2tov4/hardware.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/hardwarev0a.h b/Bootloaders/BPv3/old/upgrader-v2tov4/hardwarev0a.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/hardwarev0a.h rename to Bootloaders/BPv3/old/upgrader-v2tov4/hardwarev0a.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/hardwarev1a.h b/Bootloaders/BPv3/old/upgrader-v2tov4/hardwarev1a.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/hardwarev1a.h rename to Bootloaders/BPv3/old/upgrader-v2tov4/hardwarev1a.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/hardwarev25.h b/Bootloaders/BPv3/old/upgrader-v2tov4/hardwarev25.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/hardwarev25.h rename to Bootloaders/BPv3/old/upgrader-v2tov4/hardwarev25.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/hardwarev2a.h b/Bootloaders/BPv3/old/upgrader-v2tov4/hardwarev2a.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/hardwarev2a.h rename to Bootloaders/BPv3/old/upgrader-v2tov4/hardwarev2a.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/hardwarev3.h b/Bootloaders/BPv3/old/upgrader-v2tov4/hardwarev3.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/hardwarev3.h rename to Bootloaders/BPv3/old/upgrader-v2tov4/hardwarev3.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/hex2prog.html b/Bootloaders/BPv3/old/upgrader-v2tov4/hex2prog.html similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/hex2prog.html rename to Bootloaders/BPv3/old/upgrader-v2tov4/hex2prog.html diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/installer.mcp b/Bootloaders/BPv3/old/upgrader-v2tov4/installer.mcp similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/installer.mcp rename to Bootloaders/BPv3/old/upgrader-v2tov4/installer.mcp diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/installer.mcs b/Bootloaders/BPv3/old/upgrader-v2tov4/installer.mcs similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/installer.mcs rename to Bootloaders/BPv3/old/upgrader-v2tov4/installer.mcs diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/installer.mcw b/Bootloaders/BPv3/old/upgrader-v2tov4/installer.mcw similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/installer.mcw rename to Bootloaders/BPv3/old/upgrader-v2tov4/installer.mcw diff --git a/Bootloaders/BPv3-bootloader/upgrader-v2tov4/main.c b/Bootloaders/BPv3/old/upgrader-v2tov4/main.c similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v2tov4/main.c rename to Bootloaders/BPv3/old/upgrader-v2tov4/main.c diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/clean.bat b/Bootloaders/BPv3/old/upgrader-v4tov4/clean.bat similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/clean.bat rename to Bootloaders/BPv3/old/upgrader-v4tov4/clean.bat diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/convert.html b/Bootloaders/BPv3/old/upgrader-v4tov4/convert.html similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/convert.html rename to Bootloaders/BPv3/old/upgrader-v4tov4/convert.html diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/firmware.h b/Bootloaders/BPv3/old/upgrader-v4tov4/firmware.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/firmware.h rename to Bootloaders/BPv3/old/upgrader-v4tov4/firmware.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/flash.h b/Bootloaders/BPv3/old/upgrader-v4tov4/flash.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/flash.h rename to Bootloaders/BPv3/old/upgrader-v4tov4/flash.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/flash.s b/Bootloaders/BPv3/old/upgrader-v4tov4/flash.s similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/flash.s rename to Bootloaders/BPv3/old/upgrader-v4tov4/flash.s diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/hardware.h b/Bootloaders/BPv3/old/upgrader-v4tov4/hardware.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/hardware.h rename to Bootloaders/BPv3/old/upgrader-v4tov4/hardware.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/hardwarev0a.h b/Bootloaders/BPv3/old/upgrader-v4tov4/hardwarev0a.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/hardwarev0a.h rename to Bootloaders/BPv3/old/upgrader-v4tov4/hardwarev0a.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/hardwarev1a.h b/Bootloaders/BPv3/old/upgrader-v4tov4/hardwarev1a.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/hardwarev1a.h rename to Bootloaders/BPv3/old/upgrader-v4tov4/hardwarev1a.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/hardwarev25.h b/Bootloaders/BPv3/old/upgrader-v4tov4/hardwarev25.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/hardwarev25.h rename to Bootloaders/BPv3/old/upgrader-v4tov4/hardwarev25.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/hardwarev2a.h b/Bootloaders/BPv3/old/upgrader-v4tov4/hardwarev2a.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/hardwarev2a.h rename to Bootloaders/BPv3/old/upgrader-v4tov4/hardwarev2a.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/hardwarev3.h b/Bootloaders/BPv3/old/upgrader-v4tov4/hardwarev3.h similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/hardwarev3.h rename to Bootloaders/BPv3/old/upgrader-v4tov4/hardwarev3.h diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/hex2prog.html b/Bootloaders/BPv3/old/upgrader-v4tov4/hex2prog.html similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/hex2prog.html rename to Bootloaders/BPv3/old/upgrader-v4tov4/hex2prog.html diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/installer.mcp b/Bootloaders/BPv3/old/upgrader-v4tov4/installer.mcp similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/installer.mcp rename to Bootloaders/BPv3/old/upgrader-v4tov4/installer.mcp diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/installer.mcs b/Bootloaders/BPv3/old/upgrader-v4tov4/installer.mcs similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/installer.mcs rename to Bootloaders/BPv3/old/upgrader-v4tov4/installer.mcs diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/installer.mcw b/Bootloaders/BPv3/old/upgrader-v4tov4/installer.mcw similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/installer.mcw rename to Bootloaders/BPv3/old/upgrader-v4tov4/installer.mcw diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/main.c b/Bootloaders/BPv3/old/upgrader-v4tov4/main.c similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/main.c rename to Bootloaders/BPv3/old/upgrader-v4tov4/main.c diff --git a/Bootloaders/BPv3-bootloader/upgrader-v4tov4/p24FJ64GA002.gld b/Bootloaders/BPv3/old/upgrader-v4tov4/p24FJ64GA002.gld similarity index 100% rename from Bootloaders/BPv3-bootloader/upgrader-v4tov4/p24FJ64GA002.gld rename to Bootloaders/BPv3/old/upgrader-v4tov4/p24FJ64GA002.gld diff --git a/Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/upgrader/BPv3-v2blupdaterVa3-v4.1.hex b/Bootloaders/BPv3/old/v2tov4-bootloader-update/upgrader/BPv3-v2blupdaterVa3-v4.1.hex similarity index 100% rename from Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/upgrader/BPv3-v2blupdaterVa3-v4.1.hex rename to Bootloaders/BPv3/old/v2tov4-bootloader-update/upgrader/BPv3-v2blupdaterVa3-v4.1.hex diff --git a/Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/upgrader/P24QP.exe b/Bootloaders/BPv3/old/v2tov4-bootloader-update/upgrader/P24QP.exe similarity index 100% rename from Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/upgrader/P24QP.exe rename to Bootloaders/BPv3/old/v2tov4-bootloader-update/upgrader/P24QP.exe diff --git a/Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/upgrader/P24qp.ini b/Bootloaders/BPv3/old/v2tov4-bootloader-update/upgrader/P24qp.ini similarity index 100% rename from Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/upgrader/P24qp.ini rename to Bootloaders/BPv3/old/v2tov4-bootloader-update/upgrader/P24qp.ini diff --git a/Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/upgrader/P24qp.py b/Bootloaders/BPv3/old/v2tov4-bootloader-update/upgrader/P24qp.py similarity index 100% rename from Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/upgrader/P24qp.py rename to Bootloaders/BPv3/old/v2tov4-bootloader-update/upgrader/P24qp.py diff --git a/Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/upgrader/PICBOOT.dll b/Bootloaders/BPv3/old/v2tov4-bootloader-update/upgrader/PICBOOT.dll similarity index 100% rename from Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/upgrader/PICBOOT.dll rename to Bootloaders/BPv3/old/v2tov4-bootloader-update/upgrader/PICBOOT.dll diff --git a/Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/v4firmware/BPv3-Firmware-v4.1.hex b/Bootloaders/BPv3/old/v2tov4-bootloader-update/v4firmware/BPv3-Firmware-v4.1.hex similarity index 100% rename from Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/v4firmware/BPv3-Firmware-v4.1.hex rename to Bootloaders/BPv3/old/v2tov4-bootloader-update/v4firmware/BPv3-Firmware-v4.1.hex diff --git a/Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/v4firmware/GHelper.dll b/Bootloaders/BPv3/old/v2tov4-bootloader-update/v4firmware/GHelper.dll similarity index 100% rename from Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/v4firmware/GHelper.dll rename to Bootloaders/BPv3/old/v2tov4-bootloader-update/v4firmware/GHelper.dll diff --git a/Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/v4firmware/ds30 Loader GUI.exe b/Bootloaders/BPv3/old/v2tov4-bootloader-update/v4firmware/ds30 Loader GUI.exe similarity index 100% rename from Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/v4firmware/ds30 Loader GUI.exe rename to Bootloaders/BPv3/old/v2tov4-bootloader-update/v4firmware/ds30 Loader GUI.exe diff --git a/Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/v4firmware/ds30 Loader.dll b/Bootloaders/BPv3/old/v2tov4-bootloader-update/v4firmware/ds30 Loader.dll similarity index 100% rename from Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/v4firmware/ds30 Loader.dll rename to Bootloaders/BPv3/old/v2tov4-bootloader-update/v4firmware/ds30 Loader.dll diff --git a/Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/v4firmware/settings.xml b/Bootloaders/BPv3/old/v2tov4-bootloader-update/v4firmware/settings.xml similarity index 100% rename from Bootloaders/BPv3-bootloader/v2tov4-bootloader-update/v4firmware/settings.xml rename to Bootloaders/BPv3/old/v2tov4-bootloader-update/v4firmware/settings.xml diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/!v4UPGRADES!!!.txt b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/!v4UPGRADES!!!.txt similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/!v4UPGRADES!!!.txt rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/!v4UPGRADES!!!.txt diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/!v4UPGRADES!!.txt b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/!v4UPGRADES!!.txt similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/!v4UPGRADES!!.txt rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/!v4UPGRADES!!.txt diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/!v4UPGRADES!.txt b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/!v4UPGRADES!.txt similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/!v4UPGRADES!.txt rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/!v4UPGRADES!.txt diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/BPv3-Firmware-v4.5.hex b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/BPv3-Firmware-v4.5.hex similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/BPv3-Firmware-v4.5.hex rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/BPv3-Firmware-v4.5.hex diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/BPv3-bootloader-upgrade-v4xtov4.3.hex b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/BPv3-bootloader-upgrade-v4xtov4.3.hex similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/BPv3-bootloader-upgrade-v4xtov4.3.hex rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/BPv3-bootloader-upgrade-v4xtov4.3.hex diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/!v4UPGRADES!!!.txt b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/!v4UPGRADES!!!.txt similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/!v4UPGRADES!!!.txt rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/!v4UPGRADES!!!.txt diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/!v4UPGRADES!!.txt b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/!v4UPGRADES!!.txt similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/!v4UPGRADES!!.txt rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/!v4UPGRADES!!.txt diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/!v4UPGRADES!.txt b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/!v4UPGRADES!.txt similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/!v4UPGRADES!.txt rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/!v4UPGRADES!.txt diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/GHelper.dll b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/GHelper.dll similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/GHelper.dll rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/GHelper.dll diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/ds30 Loader GUI.exe b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/ds30 Loader GUI.exe similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/ds30 Loader GUI.exe rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/ds30 Loader GUI.exe diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/ds30 Loader.dll b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/ds30 Loader.dll similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/ds30 Loader.dll rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/ds30 Loader.dll diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/pirate-loader.exe b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/pirate-loader.exe similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/pirate-loader.exe rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/pirate-loader.exe diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/pirate-loader_lnx b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/pirate-loader_lnx similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/pirate-loader_lnx rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/pirate-loader_lnx diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/pirate-loader_mac b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/pirate-loader_mac similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/pirate-loader_mac rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/pirate-loader_mac diff --git a/Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/settings.xml b/Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/settings.xml similarity index 100% rename from Bootloaders/BPv3-bootloader/v4xtov43-bootloader-update/utilities/settings.xml rename to Bootloaders/BPv3/old/v4xtov43-bootloader-update/utilities/settings.xml diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.5/p24FJ64GA002.gld b/Bootloaders/BPv3/p24FJ64GA002.gld similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.5/p24FJ64GA002.gld rename to Bootloaders/BPv3/p24FJ64GA002.gld diff --git a/Bootloaders/BPv3-bootloader/firmware-v4.5/settings.inc b/Bootloaders/BPv3/settings.inc similarity index 100% rename from Bootloaders/BPv3-bootloader/firmware-v4.5/settings.inc rename to Bootloaders/BPv3/settings.inc diff --git a/Bootloaders/BPv4-bootloader/pirate-loader/CMakeLists.txt b/Bootloaders/BPv4-bootloader/pirate-loader/CMakeLists.txt deleted file mode 100644 index 27015caa..00000000 --- a/Bootloaders/BPv4-bootloader/pirate-loader/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# This file is part of the Bus Pirate project -# (http://code.google.com/p/the-bus-pirate/). -# -# Written and maintained by the Bus Pirate project. -# -# To the extent possible under law, the project has -# waived all copyright and related or neighboring rights to Bus Pirate. This -# work is published from United States. -# -# For details see: http://creativecommons.org/publicdomain/zero/1.0/. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) -project(pirate-loader) -set (SOURCE_FILES pirate-loader.c) -set_property (SOURCE ${SOURCE_FILES} PROPERTY COMPILE_DEFINITIONS OS=${CMAKE_SYSTEM_NAME}) -add_executable (pirate-loader ${SOURCE_FILES}) diff --git a/Bootloaders/BPv4-bootloader/pirate-loader/test.bat b/Bootloaders/BPv4-bootloader/pirate-loader/test.bat deleted file mode 100644 index 3ec636d7..00000000 --- a/Bootloaders/BPv4-bootloader/pirate-loader/test.bat +++ /dev/null @@ -1,34 +0,0 @@ -@ECHO OFF - -REM This file is part of the Bus Pirate project -REM (http://code.google.com/p/the-bus-pirate/). -REM -REM Written and maintained by the Bus Pirate project. -REM -REM To the extent possible under law, the project has -REM waived all copyright and related or neighboring rights to Bus Pirate. This -REM work is published from United States. -REM -REM For details see: http://creativecommons.org/publicdomain/zero/1.0/. -REM -REM This program is distributed in the hope that it will be useful, -REM but WITHOUT ANY WARRANTY; without even the implied warranty of -REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -ECHO Running on Windows... - -SET UPLOADER="pirate-loader.exe" - -IF [%1]==[] SET PORT="COM3" -IF NOT [%1]==[] SET PORT=%1 - -IF EXIST %UPLOADER% ( - pirate-loader.exe --dev=%PORT% --hello -) ELSE ( - ECHO ERROR - ECHO Cannot find bootloader update program! -) - -ECHO DONE - -PAUSE diff --git a/Bootloaders/BPv4-bootloader/pirate-loader/test.sh b/Bootloaders/BPv4-bootloader/pirate-loader/test.sh deleted file mode 100644 index 946a6115..00000000 --- a/Bootloaders/BPv4-bootloader/pirate-loader/test.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -# This file is part of the Bus Pirate project -# (http://code.google.com/p/the-bus-pirate/). -# -# Written and maintained by the Bus Pirate project. -# -# To the extent possible under law, the project has -# waived all copyright and related or neighboring rights to Bus Pirate. This -# work is published from United States. -# -# For details see: http://creativecommons.org/publicdomain/zero/1.0/. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# TODO: Spin up Ubuntu on Windows and see what is the output of uname(1) - -OS=`uname` -UPLOADER="./pirate-loader" - -echo "Running on ${OS}..." - -case ${OS} in - - Darwin) - PORT=${1:-"/dev/tty.usbmodem00000001"} - ;; - - Linux|FreeBSD) - PORT=${1:-"/dev/ttyACM0"} - ;; - - *) - echo "ERROR" - echo "Unsupported operating system ${OS}" - exit -1 - ;; - -esac - -if [ ! -f ${UPLOADER} ] -then - echo "ERROR" - echo "Cannot find bootloader update program!" - exit -2 -fi - -${UPLOADER} --dev=${PORT} --hello - -echo "DONE" -exit 0 - -# vim:sts=2:sw=2:ts=2:et:syn=sh:fdm=marker:ff=unix:number:cc=80:fenc=utf8 diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/boot_config.h b/Bootloaders/BPv4/boot_config.h similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/boot_config.h rename to Bootloaders/BPv4/boot_config.h diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/bootloader.c b/Bootloaders/BPv4/bootloader.c similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/bootloader.c rename to Bootloaders/BPv4/bootloader.c diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/bootloader.h b/Bootloaders/BPv4/bootloader.h similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/bootloader.h rename to Bootloaders/BPv4/bootloader.h diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/bpv4-bootloader.X/Makefile b/Bootloaders/BPv4/bpv4-bootloader.X/Makefile similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/bpv4-bootloader.X/Makefile rename to Bootloaders/BPv4/bpv4-bootloader.X/Makefile diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/bpv4-bootloader.X/nbproject/configurations.xml b/Bootloaders/BPv4/bpv4-bootloader.X/nbproject/configurations.xml similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/bpv4-bootloader.X/nbproject/configurations.xml rename to Bootloaders/BPv4/bpv4-bootloader.X/nbproject/configurations.xml diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/bpv4-bootloader.X/nbproject/project.xml b/Bootloaders/BPv4/bpv4-bootloader.X/nbproject/project.xml similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/bpv4-bootloader.X/nbproject/project.xml rename to Bootloaders/BPv4/bpv4-bootloader.X/nbproject/project.xml diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/cdc.c b/Bootloaders/BPv4/cdc.c similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/cdc.c rename to Bootloaders/BPv4/cdc.c diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/cdc.h b/Bootloaders/BPv4/cdc.h similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/cdc.h rename to Bootloaders/BPv4/cdc.h diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/descriptors.h b/Bootloaders/BPv4/descriptors.h similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/descriptors.h rename to Bootloaders/BPv4/descriptors.h diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/globals.h b/Bootloaders/BPv4/globals.h similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/globals.h rename to Bootloaders/BPv4/globals.h diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/main.c b/Bootloaders/BPv4/main.c similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/main.c rename to Bootloaders/BPv4/main.c diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/p24FJ256GB106.gld b/Bootloaders/BPv4/p24FJ256GB106.gld similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/p24FJ256GB106.gld rename to Bootloaders/BPv4/p24FJ256GB106.gld diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/picusb.h b/Bootloaders/BPv4/picusb.h similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/picusb.h rename to Bootloaders/BPv4/picusb.h diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/usb_lang.h b/Bootloaders/BPv4/usb_lang.h similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/usb_lang.h rename to Bootloaders/BPv4/usb_lang.h diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/usb_stack.c b/Bootloaders/BPv4/usb_stack.c similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/usb_stack.c rename to Bootloaders/BPv4/usb_stack.c diff --git a/Bootloaders/BPv4-bootloader/firmware-v1/usb_stack.h b/Bootloaders/BPv4/usb_stack.h similarity index 100% rename from Bootloaders/BPv4-bootloader/firmware-v1/usb_stack.h rename to Bootloaders/BPv4/usb_stack.h diff --git a/Bootloaders/BPv3-bootloader/pirate-loader/CMakeLists.txt b/Bootloaders/pirate-loader/CMakeLists.txt similarity index 100% rename from Bootloaders/BPv3-bootloader/pirate-loader/CMakeLists.txt rename to Bootloaders/pirate-loader/CMakeLists.txt diff --git a/Bootloaders/BPv4-bootloader/pirate-loader/pirate-loader.c b/Bootloaders/pirate-loader/pirate-loader.c similarity index 100% rename from Bootloaders/BPv4-bootloader/pirate-loader/pirate-loader.c rename to Bootloaders/pirate-loader/pirate-loader.c diff --git a/Bootloaders/BPv3-bootloader/pirate-loader/test.bat b/Bootloaders/pirate-loader/test.bat similarity index 100% rename from Bootloaders/BPv3-bootloader/pirate-loader/test.bat rename to Bootloaders/pirate-loader/test.bat diff --git a/Bootloaders/BPv3-bootloader/pirate-loader/test.sh b/Bootloaders/pirate-loader/test.sh similarity index 100% rename from Bootloaders/BPv3-bootloader/pirate-loader/test.sh rename to Bootloaders/pirate-loader/test.sh From d832974fc5efb7b3f5eade0990498a500a7760a0 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Sun, 24 Sep 2017 23:22:04 -0500 Subject: [PATCH 2/2] bootloader: Bump versions after the major v6.2+ bugfix --- Bootloaders/BPv3/ds30loader.s | 2 +- Bootloaders/BPv4/bootloader.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Bootloaders/BPv3/ds30loader.s b/Bootloaders/BPv3/ds30loader.s index f48e721c..67b0d8e3 100644 --- a/Bootloaders/BPv3/ds30loader.s +++ b/Bootloaders/BPv3/ds30loader.s @@ -147,7 +147,7 @@ ; .equ STARTADDR, ( FLASHSIZE - 2*(PAGESIZE * 2) ) /*place bootloader in 2nd last program page*/ .equ STARTADDR, ( FLASHSIZE - (2* (PAGESIZE)) ) /*place bootloader in last program page*/ .equ BLCHECKST, ( STARTADDR - (ROWSIZE) ) /*precalculate the first row write position that would overwrite the bootloader*/ - .equ BLVERSION, 0x0405 ;bootloader version for Bus Pirate firmware (located at last instruction before flash config words) + .equ BLVERSION, 0x0406 ;bootloader version for Bus Pirate firmware (located at last instruction before flash config words) ;------------------------------------------------------------------------------ ; Validate user settings ;------------------------------------------------------------------------------ diff --git a/Bootloaders/BPv4/bootloader.c b/Bootloaders/BPv4/bootloader.c index 58cf856f..9bfd93a1 100644 --- a/Bootloaders/BPv4/bootloader.c +++ b/Bootloaders/BPv4/bootloader.c @@ -22,7 +22,7 @@ BYTE bldone = 0; extern BYTE cdc_In_buffer[64]; extern BYTE cdc_Out_buffer[64]; #define VER_H 0x04 -#define VER_L 0x0a +#define VER_L 0x0b unsigned int userversion __attribute__((space(prog),address(BLENDADDR-9))) = ((VER_H<<8)|VER_L);