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 :(
This commit is contained in:
Harald Welte
2017-03-02 19:22:50 +01:00
parent 479e97e338
commit cab66419d6
3 changed files with 10 additions and 2 deletions

View File

@@ -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 ;
}

View File

@@ -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();