Quality RTOS & Embedded Software

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


"vPortSetInterruptMask" erro...

Posted by Francisco Moon on March 26, 2012
Hello, Somebody who help me...

Please help me... I don't know what's wrong.

- STM32F2x7_ETH_Lwip + 3 task (I made 3 tasks)

I sometimes got a HardFault_Handler.

Call stack + Locals (I can see below call stack when i got a hardfault_handler)
- HardFault_Handler 0x08019892
- vPortSetInterruptMask 0x0800020A
- xPortSysTickHandler 0x0804CA06

I don' know what's wrong.

added 3 tasks
xTaskCreate(uart_task, "UART_DEBUG", configMINIMAL_STACK_SIZE, NULL, LED_TASK_PRIO+1, NULL);
xTaskCreate(uart_timer_task, "UART_TIMER", configMINIMAL_STACK_SIZE, NULL, LED_TASK_PRIO, NULL);
xTaskCreate(CDS_ITF_task, "CDS_IFT", 7168, NULL, 10, NULL);

#define configUSE_PREEMPTION1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 120000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES( ( unsigned portBASE_TYPE ) 15 )//7->8
#define configMINIMAL_STACK_SIZE( ( unsigned short ) 128 )
#define configTOTAL_HEAP_SIZE( ( size_t ) ( 50*1024))//70 * 1024 ) )
#define configMAX_TASK_NAME_LEN( 16 )
#define configUSE_TRACE_FACILITY1
#define configUSE_16_BIT_TICKS0
#define configIDLE_SHOULD_YIELD1
#define configUSE_MUTEXES 1
#define configUSE_MALLOC_FAILED_HOOK 0

/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )

/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */

#define INCLUDE_vTaskPrioritySet1
#define INCLUDE_uxTaskPriorityGet1
#define INCLUDE_vTaskDelete1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend0
#define INCLUDE_vTaskDelayUntil0
#define INCLUDE_vTaskDelay 1

/* This is the raw value as per the Cortex-M3 NVIC. Values can be 255
(lowest) to 0 (1?) (highest). */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 191 /* equivalent to 0xb0, or priority 11. */

/* This is the value being used as per the ST library which permits 16
priority values, 0 to 15. This must correspond to the
configKERNEL_INTERRUPT_PRIORITY setting. Here 15 corresponds to the lowest
NVIC value of 255. */

RE: "vPortSetInterruptMask" erro...

Posted by Richard on March 26, 2012
I don't think the code you posted can help remote diagnostic without seeing the task code.

Did you start with a working project? Can you go back to that and add back in your code bit by bit until the problem replicates?

Do you have stack overflow checking turned on.

Have you ensured all the topics on this page are covered? Especially point 3: http://www.freertos.org/FAQHelp.html


RE: "vPortSetInterruptMask" erro...

Posted by Francisco Moon on March 27, 2012
Thanks for your advices.
I did go back to orginal working project. And then I added some code again step by step.
I think I found a problem where occur.
I modified a scatter file to use an external memory.
# scatter file.
LR_IROM1 0x08000000 0x00100000 { ; load region size_region
ER_IROM1 0x08000000 0x00100000 { ; load address = execution address
*.o (RESET, +First)
.ANY (+RO)
;RW_IRAM1 0x20000000 0x00020000 { ; RW data
; .ANY (+RW +ZI)
RW_RAM1 0x60000000 0x00100000 { ; RW data
.ANY (+RW +ZI)
heap_2.o (+RW +ZI)
tasks.o (+RW +ZI)
RW_IRAM1 0x20000000 0x00020000 {
startup_stm32f2xx.o (+RW +ZI)
stm32f2xx_rcc.o (+RW +ZI)
stm32f2x7_eth.o (+RW +ZI)

It was mainly cause. But I don't have any ideas to clear it.

If you have any ideas, please give me some ideas.


RE: "vPortSetInterruptMask" erro...

Posted by Francisco Moon on March 29, 2012
I added back in my code bit by bit. When I use an external ram, It always occurred.

In the beginning, it works well.
But after some minutes, I got a problem about systick handler.
Before crash the system, the system works slowly. And then the system crash...

What do I do anything else?

Please give me some ideas...

; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x08000000 0x00100000 { ; load region size_region
ER_IROM1 0x08000000 0x00100000 { ; load address = execution address
*.o (RESET, +First)
.ANY (+RO)
RW_RAM1 0x60000000 UNINIT 0x00100000 { ; RW data
heap_2.o(+RW +ZI)
RW_IRAM1 0x20000000 0x00020000 {
.ANY (+RW +ZI)

startup code
__initial_spTop EQU 0x20000400 ; stack used for SystemInit & SystemInit_ExtMemCtl
;__Vectors DCD __initial_sp ; Top of Stack
__Vectors DCD __initial_spTop ; Top of Stack

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

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

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

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

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


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





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