| Welcome to AT91SAM Community Forum http://www.at91.com/samphpbb/ |
|
| SAM7X EK hangs permanently http://www.at91.com/samphpbb/viewtopic.php?f=15&t=19429 |
Page 1 of 1 |
| Author: | uracolix [ Thu Jul 29, 2010 11:46 am ] |
| Post subject: | SAM7X EK hangs permanently |
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. |
|
| Author: | uracolix [ Thu Jul 29, 2010 4:14 pm ] |
| Post subject: | Re: SAM7X EK hangs permanently |
Meanwhile I compare applications. The main difference I see, is, that in the erroneous app all PMC registers are at value 0 and the working app shows meaningful values (e.g. PCSR = 0x1068). W.t.h. can held the PMC in reset ??.... |
|
| Author: | uracolix [ Fri Jul 30, 2010 10:14 am ] |
| Post subject: | Re: SAM7X EK hangs permanently [solved] |
Now I know even more, why I appreciate the transparency of the GNU tools. It is because you rule the tools instead of the tools ruling you. In short: The IAR IDE sprinkles around its configuration in the *ew[pdw] files. Finally the *ewd file, which holds the debugger configuration was not checked in and so far it was lost. Instead that there is a warning or the tool denies to work, because the debugger does not find its configuration, it starts with some default values debugging something, that ends up in the above described behavior. |
|
| Page 1 of 1 | All times are UTC + 1 hour [ DST ] |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|



Forum