Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [solved] at91sam7x512: external reset
PostPosted: Wed Jan 04, 2012 10:56 am 
Offline

Joined: Wed Jan 04, 2012 10:16 am
Posts: 4
I adapted the SAM7 web server example (FreeRTOS V1.7.0) to my at91sam7x512/DP83848i based board (deRFgateway by Dresden Electronic). (Basically, I only had to adjust the memory size defines) The example runs so far, but there's a problem during the initialization of the PHY (DP83843i): the while loop which waits for end of hw reset
Code:
while( !( AT91C_BASE_RSTC->RSTC_RSR & AT91C_RSTC_NRSTL ) ) { __asm volatile ( "NOP" ); }

will loop endlessly. The problem does NOT occur when the SAM-ICE JTAG interface is connected! In fact, even when starting without SAM-ICE and connecting it after a while will end the loop. Afterwards, everything works fine (i.e. the EMAC).

I double checked low lever initialization etc. but couldn't find any problem there.

Any idea how to fix this?

Thanks!


Last edited by gwynpen on Fri Jan 06, 2012 10:38 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: at91sam7x512: external reset
PostPosted: Wed Jan 04, 2012 4:57 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Make sure that the NRST pin isn't being driven high by some push-pull driver externally.


Code:
   /* Need to reset PHY -> 500ms reset */
   AT91C_BASE_RSTC->RSTC_RMR = (AT91C_RSTC_KEY & ((unsigned int)0xA5<<24)) |
                (AT91C_RSTC_ERSTL & (0x0D << 8)) | AT91C_RSTC_URSTEN;
   AT91C_BASE_RSTC->RSTC_RCR = (AT91C_RSTC_KEY & ((unsigned int)0xA5<<24)) |
                 AT91C_RSTC_EXTRST;

   /* Wait for end hardware reset */
   while (!(AT91C_BASE_RSTC->RSTC_RSR & AT91C_RSTC_NRSTL));


Top
 Profile  
 
 Post subject: Re: [solved] at91sam7x512: external reset
PostPosted: Fri Jan 06, 2012 10:44 am 
Offline

Joined: Wed Jan 04, 2012 10:16 am
Posts: 4
I'm such a fool: I always switched off the SAM-ICE (removed USB cable) only but left the JTAG port connected to the board when testing "without" JTAG...

Everything works fine now, thanks for your hints!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: