fixed issue with bootloader not correctly reading application version word from program flash memory
This commit is contained in:
@@ -102,7 +102,7 @@
|
|||||||
<property key="opt-xc8-compiler-strict_ansi" value="false"/>
|
<property key="opt-xc8-compiler-strict_ansi" value="false"/>
|
||||||
<property key="optimization-assembler" value="true"/>
|
<property key="optimization-assembler" value="true"/>
|
||||||
<property key="optimization-assembler-files" value="false"/>
|
<property key="optimization-assembler-files" value="false"/>
|
||||||
<property key="optimization-debug" value="false"/>
|
<property key="optimization-debug" value="true"/>
|
||||||
<property key="optimization-invariant-enable" value="false"/>
|
<property key="optimization-invariant-enable" value="false"/>
|
||||||
<property key="optimization-invariant-value" value="16"/>
|
<property key="optimization-invariant-value" value="16"/>
|
||||||
<property key="optimization-level" value="-O0"/>
|
<property key="optimization-level" value="-O0"/>
|
||||||
@@ -172,6 +172,7 @@
|
|||||||
value="Press to browse for a specific firmware version"/>
|
value="Press to browse for a specific firmware version"/>
|
||||||
<property key="ToolFirmwareOption.UseLatestFirmware" value="true"/>
|
<property key="ToolFirmwareOption.UseLatestFirmware" value="true"/>
|
||||||
<property key="debugoptions.useswbreakpoints" value="false"/>
|
<property key="debugoptions.useswbreakpoints" value="false"/>
|
||||||
|
<property key="firmware.download.all" value="false"/>
|
||||||
<property key="hwtoolclock.frcindebug" value="false"/>
|
<property key="hwtoolclock.frcindebug" value="false"/>
|
||||||
<property key="memories.aux" value="false"/>
|
<property key="memories.aux" value="false"/>
|
||||||
<property key="memories.bootflash" value="true"/>
|
<property key="memories.bootflash" value="true"/>
|
||||||
|
|||||||
@@ -69,8 +69,6 @@
|
|||||||
#define REQUEST_DATA_BLOCK_SIZE 0x3A //Number of data bytes in a standard request to the PC. Must be an even number from 2-58 (0x02-0x3A). Larger numbers make better use of USB bandwidth and
|
#define REQUEST_DATA_BLOCK_SIZE 0x3A //Number of data bytes in a standard request to the PC. Must be an even number from 2-58 (0x02-0x3A). Larger numbers make better use of USB bandwidth and
|
||||||
//yeild shorter program/verify times, but require more micrcontroller RAM for buffer space.
|
//yeild shorter program/verify times, but require more micrcontroller RAM for buffer space.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** USB Packet Request/Response Formatting Structure **********************************************************/
|
/** USB Packet Request/Response Formatting Structure **********************************************************/
|
||||||
typedef union
|
typedef union
|
||||||
{
|
{
|
||||||
@@ -397,7 +395,7 @@ void ProcessIO(void)
|
|||||||
//in this firmware and is available for requesting by the host software.
|
//in this firmware and is available for requesting by the host software.
|
||||||
PacketToPC.Command = QUERY_EXTENDED_INFO; //Echo the command byte
|
PacketToPC.Command = QUERY_EXTENDED_INFO; //Echo the command byte
|
||||||
PacketToPC.BootloaderVersion = ((unsigned int)BOOTLOADER_VERSION_MAJOR << 8)| BOOTLOADER_VERSION_MINOR;
|
PacketToPC.BootloaderVersion = ((unsigned int)BOOTLOADER_VERSION_MAJOR << 8)| BOOTLOADER_VERSION_MINOR;
|
||||||
PacketToPC.ApplicationVersion = *(const unsigned int*)APP_FW_VERSION_ADDRESS;
|
memcpy(&PacketToPC.ApplicationVersion, (void*)APP_FW_VERSION_ADDRESS, 2);
|
||||||
PacketToPC.SignatureAddress = APP_SIGNATURE_ADDRESS;
|
PacketToPC.SignatureAddress = APP_SIGNATURE_ADDRESS;
|
||||||
PacketToPC.SignatureValue = APP_SIGNATURE_VALUE;
|
PacketToPC.SignatureValue = APP_SIGNATURE_VALUE;
|
||||||
PacketToPC.ErasePageSize = ERASE_PAGE_SIZE;
|
PacketToPC.ErasePageSize = ERASE_PAGE_SIZE;
|
||||||
|
|||||||
@@ -17,7 +17,10 @@
|
|||||||
* IF YOU FLASH BROKEN APPLICATION FIRMWARE YOU WILL HAVE A BRICK!!
|
* IF YOU FLASH BROKEN APPLICATION FIRMWARE YOU WILL HAVE A BRICK!!
|
||||||
* At that point the device can only be reprogrammed by a dedicated programmer such as the ICD or Pickit 3.
|
* At that point the device can only be reprogrammed by a dedicated programmer such as the ICD or Pickit 3.
|
||||||
*/
|
*/
|
||||||
#define ENABLE_HARDWARE_MODE_OVERRIDE
|
// Yep, I'm disabling it anyway. the boards aren't designed to accomodate another pull-up resistor
|
||||||
|
// or pushbutton. a jump from application code is sufficient since you shouldn't be flashing modified or
|
||||||
|
// untested firmware without a pickit anyway.
|
||||||
|
//#define ENABLE_HARDWARE_MODE_OVERRIDE
|
||||||
|
|
||||||
/* Private prototypes */
|
/* Private prototypes */
|
||||||
void main(void);
|
void main(void);
|
||||||
|
|||||||
@@ -168,7 +168,7 @@
|
|||||||
<property key="use-iar" value="false"/>
|
<property key="use-iar" value="false"/>
|
||||||
<property key="verbose" value="false"/>
|
<property key="verbose" value="false"/>
|
||||||
<property key="warning-level" value="-3"/>
|
<property key="warning-level" value="-3"/>
|
||||||
<property key="what-to-do" value="ignore"/>
|
<property key="what-to-do" value="require"/>
|
||||||
</HI-TECH-COMP>
|
</HI-TECH-COMP>
|
||||||
<HI-TECH-LINK>
|
<HI-TECH-LINK>
|
||||||
<property key="additional-options-checksum" value=""/>
|
<property key="additional-options-checksum" value=""/>
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
|
||||||
#ifdef LINK_FOR_BOOTLOADER
|
#ifdef LINK_FOR_BOOTLOADER
|
||||||
// only define this if building fw to be used with the bootloader
|
// the version word of this application - will be read and displayed by the firmware flash utility
|
||||||
const uint16_t VersionWord __at(APP_FW_VERSION_ADDRESS) = 0x0100;
|
const unsigned int VersionWord __at(APP_FW_VERSION_ADDRESS) = 0x0100;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
|
|||||||
Reference in New Issue
Block a user