mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
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:
@@ -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 ;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -133,6 +133,9 @@ static void BootIntoApp(void)
|
||||
pSrc = (unsigned int *) ((unsigned char *)IFLASH_ADDR + BOARD_DFU_BOOT_SIZE);
|
||||
SCB->VTOR = ((unsigned int)(pSrc)) | (0x0 << 7);
|
||||
appReset = pSrc[1];
|
||||
|
||||
printf("Booting into App from %p, PC=%p\r\n", pSrc, appReset);
|
||||
|
||||
appReset();
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user