Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

AT91SAM7X-EK + Reset button

Posted 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 button

Posted 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 button

Posted 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 button

Posted 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 button

Posted 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 button

Posted by Francois-Pascal Bello on March 24, 2009
It looks like my problem is related to the lwIP task...

RE: AT91SAM7X-EK + Reset button

Posted 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 button

Posted by Richard on March 25, 2009
Thanks for taking the time to post the solution.

Regards.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner