Hallo, probably it is just a newby-ish question and the solution is probably very simple, since I do not find any hint by searching here and on google. But the issue kept me busy for a day, so asking this question brings me hopefully back into operating mode.
Given is a SAM7X_EK with SAM7X256, the IAR IDE, Segger JTAG. I want run with the 18.432MHz XTAL.
The issue: I hang in the startup code while waiting for the MOSCS bit. The code looks so:
Code:
resetHandler:
LDR pc, =label
LDR r0, =arm7_low_level_init
LDR r4, =SFE(CSTACK)
MOV sp, r4
MOV lr, pc
BX r0
after entering arm7_low_level_init(), I hang here:
Code:
void arm7_low_level_init(void)
{
uint8_t index;
AT91C_BASE_MC->MC_FMR = AT91C_MC_FWS_1FWS;
AT91C_BASE_PMC->PMC_MOR = BOARD_OSCOUNT | AT91C_CKGR_MOSCEN;
while (!(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MOSCS));
/* ===> MCU waits here forever <=== */
...
...
The strange thing is, that the same code runs two days ago (yes I know, the cat ate my source code). The only thing happened between the working and the current state is, that I erased the memory with SAM-BA and I explored the IDE ... .
I checked the XTAL frequency with the scope (OK) and also exchanged the EK board .... I have no idea, what to do next.