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

Hard fault problem - Cortex M3

Posted by masio on September 29, 2014

Hi. I'm writing a code for LPC1769 (Cortex M3) with FreeRTOS and LPCOpen library. The hard fault occurs when a FreeRTOS API function is called from an ISR.The interrupt has the same priority as the kernel (configKERNELINTERRUPTPRIORITY).

The RTC interrupts make this error.

This function configs the RTC: void rtcinit(){ ChipRTCInit(LPCRTC); ChipRTCCntIncrIntConfig(LPCRTC, RTCAMRCIIRIMSEC, ENABLE); ChipRTCClearIntPending(LPCRTC, RTCINTCOUNTERINCREASE | RTCINTALARM); NVICEnableIRQ((IRQnType) RTCIRQn); ChipRTCEnable(LPCRTC, ENABLE); NVICSetPriority((IRQnType)RTCIRQn,configKERNELINTERRUPT_PRIORITY); }

IRQ Handler: ~~~~~~ void RTCIRQHandler(void) { uint32t sec;

if (Chip_RTC_GetIntPending(LPC_RTC, RTC_INT_COUNTER_INCREASE)) {
	Chip_RTC_ClearIntPending(LPC_RTC, RTC_INT_COUNTER_INCREASE);
}

	xSemaphoreGiveFromISR(sem_temp,NULL);    // THIS CAUSES THE ERROR.
}

} ~~~~~~

FreeRTOSConfig.h file: http://paste.ofcode.org/DEERe56y3X8Eg7tXZgBRHd

Sorry for my bad english.

Thanks!


Hard fault problem - Cortex M3

Posted by davedoors on September 30, 2014

NVICSetPriority((IRQnType)RTCIRQn,configKERNELINTERRUPT_PRIORITY);

That line will not be right if configKERNELINTERRUPTPRIORITY is defined using all 8 bits, as it normally is. NVIC_SetPriority wants the priority specified using just the number of bits implemented by your LPC part. See http://www.freertos.org/RTOS-Cortex-M3-M4.html and make sure you are using a recent FreeRTOS version to take advantage of the extra self checking with configASSERT() defined.


Hard fault problem - Cortex M3

Posted by masio on October 6, 2014

Ok I'll try that. Thanks!


[ 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