aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/atmel_softpack_libraries
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-03-02 19:22:50 +0100
committerHarald Welte <laforge@gnumonks.org>2017-03-02 19:22:50 +0100
commitcab66419d6059a3f6b0f8aa8fdf106ebcd66695b (patch)
tree66a07a5903a9fe45dc089cf7e307d25048e84f27 /firmware/atmel_softpack_libraries
parent479e97e3382f72da1959276d8ec3a9defc5b75f5 (diff)
flashd: Set 6 Wait states as per Errata requiremens for Revision A
It is utterly unacceptable that Atmel is shipping example code in 2011, which doesn't support parts that are shipped still in 2016. They would have had five years to fix their code to implement the chip errata :(
Diffstat (limited to 'firmware/atmel_softpack_libraries')
-rw-r--r--firmware/atmel_softpack_libraries/libchip_sam3s/source/flashd.c7
-rw-r--r--firmware/atmel_softpack_libraries/usb/device/dfu/dfu_driver.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/firmware/atmel_softpack_libraries/libchip_sam3s/source/flashd.c b/firmware/atmel_softpack_libraries/libchip_sam3s/source/flashd.c
index 6247139..e11c2ab 100644
--- a/firmware/atmel_softpack_libraries/libchip_sam3s/source/flashd.c
+++ b/firmware/atmel_softpack_libraries/libchip_sam3s/source/flashd.c
@@ -151,7 +151,10 @@ static void ComputeLockRange( uint32_t dwStart, uint32_t dwEnd, uint32_t *pdwAct
extern void FLASHD_Initialize( uint32_t dwMCk, uint32_t dwUseIAP )
{
EFC_DisableFrdyIt( EFC ) ;
-
+#if 1
+ /* See Revision A errata 46.1.1.3 */
+ EFC_SetWaitState(EFC, 6);
+#else
if ( (dwMCk/1000000) >= 64 )
{
EFC_SetWaitState( EFC, 2 ) ;
@@ -167,7 +170,7 @@ extern void FLASHD_Initialize( uint32_t dwMCk, uint32_t dwUseIAP )
EFC_SetWaitState( EFC, 0 ) ;
}
}
-
+#endif
_dwUseIAP=dwUseIAP ;
}
diff --git a/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_driver.c b/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_driver.c
index 71529de..f5e7c82 100644
--- a/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_driver.c
+++ b/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_driver.c
@@ -459,6 +459,8 @@ void USBDFU_SwitchToApp(void)
/* make sure the MAGIC is not set to enter DFU again */
*(unsigned int *)USB_DFU_MAGIC_ADDR = 0;
+ printf("switching to app\r\n");
+
/* disconnect from USB to ensure re-enumeration */
USBD_Disconnect();