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

Proper way to reset?

Posted by PBXNewbie on August 31, 2007
I am using FreeRTOS on an Atmel SAM7S-256 with the IAR toolchain. While I have a proprietary board design, we can assume for the moment that I am using the Atmel development kit, as they are very similar.

I am writing a boot loader that is supposed to allow updating the code in the SAM flash. I am writing the new code to an external SPI flash when it is downloaded over USB, doing the appropriate checks to ensure that code is intact. Once it is entirely downloaded and verified, it is then written to the SAM flash. Once done, I am trying to reset the processor. However, I must not understand how to reset correctly, because when I merely make the reset function in Cstartup.s79 public and call it, the RTOS does not appear to start up again. I tried just simply resetting the processor without writing new code to it, to make sure I took any erroneous code update out of the equation. Same result - RTOS locks up.

Can someone help me by describing the correct way to have my code reset the processor, as if it were being first powered up?

Thanks

RE: Proper way to reset?

Posted by Dave on August 31, 2007
Simply starting the software again from the start is definitely not enough as the processor and its peripherals do not get a reset. This means that the interrupts for the RTOS tick remain enabled, and will continue to trigger while your software is reinitialising all the variables back to their default values, probably also clearing the vector table.

There was a thread about 3 weeks ago where somebody was doing exactly what you are attempting now and I think it had a positive conclusion. From memory it was somebody calling themselves racemouce, you might find it from searching the forum.

RE: Proper way to reset?

Posted by PBXNewbie on August 31, 2007
Thanks. I did not find the post you mentioned. However, I was able to get it to reset the processor properly. For anyone else in my situation, here is the command I found effective in resetting the SAM processor from a function running in RAM.

AT91C_BASE_RSTC->RSTC_RCR = (0xA5000000 | AT91C_RSTC_PROCRST | AT91C_RSTC_PERRST);


[ 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