moving between PCs - THIS IS HORRIBLY BROKEN AS OF THIS COMMIT

This commit is contained in:
2019-08-13 18:18:51 -04:00
parent 5c2d710bc2
commit 1ced4e1b78
11 changed files with 135 additions and 41 deletions

View File

@@ -20,14 +20,14 @@
;//High priority interrupt vector remapping
PSECT HiVector,class=CODE,delta=1,abs
org 0x08
goto 0x1C08 ;Resides at 0x0008 (hardware high priority interrupt vector), and causes PC to jump to 0x1C08 upon a high priority interrupt event
goto 0x2088 ;Resides at 0x0008 (hardware high priority interrupt vector), and causes PC to jump to 0x2008 upon a high priority interrupt event
;//Low priority interrupt vector remapping, as well as bootloader mode absolute
;//entry point (located at 0x001C).
PSECT LoVector,class=CODE,delta=1,abs
org 0x18
goto 0x1C18 ;Resides at 0x0018 (hardware low priority interrupt vector), and causes PC to jump to 0x1C18 upon a low priority interrupt event
goto 0x2098 ;Resides at 0x0018 (hardware low priority interrupt vector), and causes PC to jump to 0x2018 upon a low priority interrupt event
goto 0x30 ;Resides at 0x001C //Serves as absolute entry point from application program into the bootloader mode

View File

@@ -3,6 +3,8 @@
#include "usb.h"
#include "usb_device_hid.h"
#undef uint24_t
#define uint24_t uint32_t
//The bootloader version, which the bootloader PC application can do extended query to get.
//Value provided is expected to be in the format of BOOTLOADER_VERSION_MAJOR.BOOTLOADER_VERSION_MINOR
@@ -143,8 +145,8 @@ typedef union
};
} PacketToFromPC;
PacketToFromPC PacketFromPC __at(0x500);
PacketToFromPC PacketToPC __at(0x550);
PacketToFromPC PacketFromPC __at(0x42C);
PacketToFromPC PacketToPC __at(0x46C);
unsigned char ProgrammingBuffer[ERASE_PAGE_SIZE];
unsigned char BootState;
unsigned int ErasePageTracker;

View File

@@ -27,18 +27,20 @@
#ifndef BOOTLOADER_
#define BOOTLOADER_
#include "memory.h"
void UserInit(void);
void ProcessIO(void);
//Vector remapping/absolute address constants
#define REMAPPED_APPLICATION_RESET_VECTOR 0x1C00
//#define REMAPPED_APPLICATION_HIGH_ISR_VECTOR 0x1C08 //See VectorRemap.asm
//#define REMAPPED_APPLICATION_LOW_ISR_VECTOR 0x1C18 //See VectorRemap.asm
#define BOOTLOADER_ABSOLUTE_ENTRY_ADDRESS 0x001C //Execute a "goto 0x001C" inline assembly instruction, if you want to enter the bootloader mode from the application via software
#define REMAPPED_APPLICATION_RESET_VECTOR APP_FW_MEMORY_OFFSET
//#define REMAPPED_APPLICATION_HIGH_ISR_VECTOR APP_FW_MEMORY_OFFSET + 0x08 //See VectorRemap.asm
//#define REMAPPED_APPLICATION_LOW_ISR_VECTOR APP_FW_MEMORY_OFFSET + 0x18 //See VectorRemap.asm
#define BOOTLOADER_ABSOLUTE_ENTRY_ADDRESS BOOTLOADER_ENTRYPOINT //Execute a "goto 0x001C" inline assembly instruction, if you want to enter the bootloader mode from the application via software
#define APP_SIGNATURE_ADDRESS 0x1C06 //0x1C06 and 0x1C07 contains the "signature" WORD, indicating successful erase/program/verify operation
#define APP_SIGNATURE_ADDRESS APP_FW_MEMORY_OFFSET + 0x06 //0x1C06 and 0x1C07 contains the "signature" WORD, indicating successful erase/program/verify operation
#define APP_SIGNATURE_VALUE 0x600D //leet "GOOD", implying that the erase/program was a success and the bootloader intentionally programmed the APP_SIGNATURE_ADDRESS with this value
#define APP_VERSION_ADDRESS 0x1C16 //0x1C16 and 0x1C17 should contain the application image firmware version number
#define APP_VERSION_ADDRESS APP_FW_MEMORY_OFFSET + 0x16 //0x1C16 and 0x1C17 should contain the application image firmware version number
#endif /* BOOTLOADER_ */

View File

@@ -64,8 +64,8 @@
//firmware, can offer better sustained bandwidth, especially for OUT endpoints.
//------------------------------------------------------
//#define USB_PING_PONG_MODE USB_PING_PONG__NO_PING_PONG //Not recommended
#define USB_PING_PONG_MODE USB_PING_PONG__FULL_PING_PONG //A good all around setting
//#define USB_PING_PONG_MODE USB_PING_PONG__EP0_OUT_ONLY //Another good setting
//#define USB_PING_PONG_MODE USB_PING_PONG__FULL_PING_PONG //A good all around setting
#define USB_PING_PONG_MODE USB_PING_PONG__EP0_OUT_ONLY //Another good setting
//#define USB_PING_PONG_MODE USB_PING_PONG__ALL_BUT_EP0 //Not recommended
//------------------------------------------------------------------------------