FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [March 2009 Threads] AT91SAM7X-EK + Reset buttonPosted by Francois-Pascal Bello on March 24, 2009 I am trying to activate the reset button on the SAM7X demo board within FreeRTOS. Here is the code I use, that is called in AT91F_LowLevelInit():
//configure system interrupts at highest priority level AT91F_AIC_ConfigureIt(AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST, AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE,( void (*)( void ) ) vNRST_pin_interrupt);
//clears NRST pin interrupt reader = AT91C_BASE_RSTC->RSTC_RSR; //enables NRST pin interrupt AT91C_BASE_RSTC->RSTC_RMR = (0xA5000000 | 91C_RSTC_URSTIEN); //enables system interrupt AT91C_BASE_AIC->AIC_IECR = (1 << AT91C_ID_SYS);
/////////////////////////////////////////////////////////////////////////////////////////
Then I connect the peripheral clock to the system : AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_SYS;
I added this line in static void prvSetupHardware( void ) in main.c. I also wrote my interrupt function that is supposed to reset the processor: void vNRST_pin_interrupt(void) { AT91C_BASE_MC->MC_RCR = AT91C_RSTC_PROCRST;
}
But it seems the interrupt function is never called. What am I forgetting or doing wrong?
RE: AT91SAM7X-EK + Reset buttonPosted by Dave on March 24, 2009 Not sure this is really a FreeRTOS question, best ask it on the at91.com forum.
RE: AT91SAM7X-EK + Reset buttonPosted by Francois-Pascal Bello on March 24, 2009 I have posted it on at91.com forum, but I still think it is FreeRTOS related since I am trying to add this functionality to FreeRTOS lwip demo.
RE: AT91SAM7X-EK + Reset buttonPosted by Francois-Pascal Bello on March 24, 2009 My code works fine when I don't start FreeRTOS scheduler... I will check to see that my interrupt is enabled when RTOS is running.
RE: AT91SAM7X-EK + Reset buttonPosted by Francois-Pascal Bello on March 24, 2009 Now I only enable user reset with: AT91C_BASE_RSTC->RSTC_RMR = (0xA5000000 | 91C_RSTC_URSTEN); at startup. When I compile without starting scheduler, it works. Any idea what could block the NRST pin functionality?
RE: AT91SAM7X-EK + Reset buttonPosted by Francois-Pascal Bello on March 24, 2009 It looks like my problem is related to the lwIP task...
RE: AT91SAM7X-EK + Reset buttonPosted by Francois-Pascal Bello on March 25, 2009 Finally, I found out it was the EMAC_Init function that posed problem. When changing the NRST output length, the function overwrites the other config bits (allowing user reset by NRST input). I have simply masked the register and insured that only the reset signal length was modified and it works. I am posting this in case someone else has the same problem...
RE: AT91SAM7X-EK + Reset buttonPosted by Richard on March 25, 2009 Thanks for taking the time to post the solution.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|