projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
824ce10
)
Fixed broken lock byte programming in the AVRISP-MKII clone project for some XMEGA...
author
Dean Camera
<dean@fourwalledcubicle.com>
Sat, 2 Oct 2010 10:02:24 +0000
(10:02 +0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Sat, 2 Oct 2010 10:02:24 +0000
(10:02 +0000)
LUFA/ManPages/ChangeLog.txt
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
patch
|
blob
|
blame
|
history
diff --git
a/LUFA/ManPages/ChangeLog.txt
b/LUFA/ManPages/ChangeLog.txt
index
805b3e1
..
23ef75c
100644
(file)
--- a/
LUFA/ManPages/ChangeLog.txt
+++ b/
LUFA/ManPages/ChangeLog.txt
@@
-68,6
+68,7
@@
* - Fixed incorrect LEDs_ChangeLEDs() function in the Benito board LED driver
* - Fixed incorrect USB_DeviceState value when unconfiguring the device without an address set
* - Fixed broken FLASH/EEPROM programming in the AVRISP-MKII clone project when writing in non-paged mode and the polling byte cannot be used
* - Fixed incorrect LEDs_ChangeLEDs() function in the Benito board LED driver
* - Fixed incorrect USB_DeviceState value when unconfiguring the device without an address set
* - Fixed broken FLASH/EEPROM programming in the AVRISP-MKII clone project when writing in non-paged mode and the polling byte cannot be used
+ * - Fixed broken lock byte programming in the AVRISP-MKII clone project for some XMEGA targets
*
* \section Sec_ChangeLog100807 Version 100807
* <b>New:</b>
*
* \section Sec_ChangeLog100807 Version 100807
* <b>New:</b>
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
index
93419d0
..
537441f
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
+++ b/
Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
@@
-216,10
+216,19
@@
bool XMEGANVM_WriteByteMemory(const uint8_t WriteCommand, const uint32_t WriteAd
XMEGANVM_SendNVMRegAddress(XMEGA_NVM_REG_CMD);
XPROGTarget_SendByte(WriteCommand);
XMEGANVM_SendNVMRegAddress(XMEGA_NVM_REG_CMD);
XPROGTarget_SendByte(WriteCommand);
- /* Send new memory byte to the memory
to
the target */
+ /* Send new memory byte to the memory
of
the target */
XPROGTarget_SendByte(PDI_CMD_STS | (PDI_DATSIZE_4BYTES << 2));
XMEGANVM_SendAddress(WriteAddress);
XPROGTarget_SendByte(Byte);
XPROGTarget_SendByte(PDI_CMD_STS | (PDI_DATSIZE_4BYTES << 2));
XMEGANVM_SendAddress(WriteAddress);
XPROGTarget_SendByte(Byte);
+
+ /* Lock bytes need a special confirmation sequence for the write to complete */
+ if (WriteCommand == XMEGA_NVM_CMD_WRITELOCK)
+ {
+ /* Set CMDEX bit in NVM CTRLA register to start the Lock Byte write sequence */
+ XPROGTarget_SendByte(PDI_CMD_STS | (PDI_DATSIZE_4BYTES << 2));
+ XMEGANVM_SendNVMRegAddress(XMEGA_NVM_REG_CTRLA);
+ XPROGTarget_SendByte(1 << 0);
+ }
return true;
}
return true;
}
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
index
0f5269d
..
85820fd
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
+++ b/
Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
@@
-324,8
+324,6
@@
static void XPROGProtocol_WriteMemory(void)
EraseBuffCommand = XMEGA_NVM_CMD_ERASEEEPROMPAGEBUFF;
break;
case XPRG_MEM_TYPE_USERSIG:
EraseBuffCommand = XMEGA_NVM_CMD_ERASEEEPROMPAGEBUFF;
break;
case XPRG_MEM_TYPE_USERSIG:
- /* User signature is paged, but needs us to manually indicate the mode bits since the host doesn't set them */
- WriteMemory_XPROG_Params.PageMode = (XPRG_PAGEMODE_ERASE | XPRG_PAGEMODE_WRITE);
WriteCommand = XMEGA_NVM_CMD_WRITEUSERSIG;
break;
case XPRG_MEM_TYPE_FUSE:
WriteCommand = XMEGA_NVM_CMD_WRITEUSERSIG;
break;
case XPRG_MEM_TYPE_FUSE: