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

Stm34F4: Infinite_Loop after memset

Posted by Christoph on August 31, 2012
Hey. I am really not an expert, I am an hobbyist trying to work with FreeRTOS + STM32F4 (discovery board)
I managed to set up the toolchain (summon arm) and Eclipse IDE. "Plain" LED Blinking works fine.
I tried to add the FreeRTOS code to my project. I managed to compile the Source but when it comes to creating a task, I get stuck while debugging.

I fgured that eventually after 'memset' I end up in the "Infinite_Loop" trap in startup_stm32f3xx.S which is the processors handler for "unexpected interrupts".

Ehm ... I am lost. Totally.

These are the steps of my debugging session which lead to the trap.
main.c: xTaskCreate( testtask, ( signed char * ) "test", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL );
-> task.c(406): pxNewTCB = prvAllocateTCBAndStack( usStackDepth, puxStackBuffer );
-> -> task.c(2154): memset( pxNewTCB->pxStack, ( int ) tskSTACK_FILL_BYTE, ( size_t ) usStackDepth * sizeof( portSTACK_TYPE ) );
-> -> -> startup_stm32f3xx.S(121): b Infinite_Loop


regards
Christoph

RE: Stm34F4: Infinite_Loop after memset

Posted by MEdwards on August 31, 2012
Have you installed the interrupt handlers?

http://www.freertos.org/FreeRTOS_Support_Forum_Archive/September_2011/freertos_FreeRTOS_on_Atmel_SAM3U_in_CrossStudio_4694403.html

http://www.freertos.org/FreeRTOS_Support_Forum_Archive/June_2012/freertos_FreeRTOS_on_energymicro_GiantGeko_sourcery_5364965.html

http://www.freertos.org/FreeRTOS_Support_Forum_Archive/January_2012/freertos_LPC1768_FreeRTOS_4964917.html

etc.

RE: Stm34F4: Infinite_Loop after memset

Posted by Christoph on September 1, 2012
Hi

no I did not install the interrupt handlers correctly. Adding the #defines as mentioned in your linked threads did not solve the problem, however lead to some confusion (see below).

xTaskCreate() leads to a call of memset and strncpy in task.c (line 2154 and 1957) which then ends up in the handler for unexpected interrupts.
Reclessy removing those two calls from task.c worked, and two tasks are running as expected (as far as I can tell right now).
Of course thats not the way to go, so what is to blame for this problem?

There's one thing I don't get:
With and without the #defines for the interrupt handlers the code is working. Without it's slower, but a breakpoint in xPortSysTickHandler() is reached in both cases. Why is xPortSysTickHandler() called in both cases?

Regards
Christoph


[ 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