Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




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 ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists