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


simple led blinker task crashing with msp430f5529

Posted by smithbone on October 28, 2013

I'm attempting to get a simple led blinker up and running on a msp430f5529 thats on the the TI AFE4490 Eval board.

When I try to create a task the system hangs.

I'm pretty sure I have clocks and such configured correctly. If I blink leds without creating a task it works and I used blinking leds to narrow down where in the FreeRTOS code things were dying.

I tracked the hang down to this line 113 in heap_1.c

~~~~~~ /* Ensure the heap starts on a correctly aligned boundary. */ pucAlignedHeap = ( unsigned char * ) ( ( ( portPOINTERSIZETYPE ) &ucHeap[ portBYTEALIGNMENT ] ) & ( ( portPOINTERSIZETYPE ) ~portBYTEALIGNMENT_MASK ) ); ~~~~~~

If I specify a configTOTALHEAPSIZE that's > 560 bytes then this line crashes.

Using a heap size of 512 bytes allows it to get further on but then I hit an ASSERT in tasks.c at line 518.

~~~~~~ /* Check the alignment of the calculated top of stack is correct. */ configASSERT( ( ( ( unsigned long ) pxTopOfStack & ( unsigned long ) portBYTEALIGNMENTMASK ) == 0UL ) ); ~~~~~~~

So I don't seem to have something set right in my memory setup. The FAQ says that if creating tasks hangs then it most likely related to the tick interrupt. I can't absolutely say that the tick timer is working but the interrupt vectors in the ti-txt file look correct.

I'm using Code Composer Studio

Any info or suggestions to try are welcome


simple led blinker task crashing with msp430f5529

Posted by richardbarry on October 28, 2013

If you are using LEDs to debug, can I assume you don't have a debugger that allows you to step through the code and inspect variables, etc.? If so, you are making your life very hard, and much less productive than it might otherwise be. It also limits the assistance we can provide as you will not be able to answer questions we might pose.

From your description so far, if what you think is happening is really happening, then it is not the tick interrupt. More likely a linker script problem, or a memory model setting (in CCS) issue.


simple led blinker task crashing with msp430f5529

Posted by smithbone on October 28, 2013

Its an eval board from TI and there's no JTAG header loaded. I don't have a UART either. I agree very sub-optimal but it's what I have.

I'm pretty sure what I describe above is where things go wrong as I can place while(1); hangs and LEDs to narrow it down to those lines.

I totally agree is probably some sort of CCS setting but so far nothing seems to help. If I change the code model to anything other than blank (not sure what default that is) I get unresolved symbols (_TIintXX) and changing the data model to large from blank also results in link errors. A data model of small compiles but does not make any difference.

Has a working MSP430 project using CCS 5.5 been created by anyone? It might help me to look at that and look for differences.

simple led blinker task crashing with msp430f5529

Posted by smithbone on October 28, 2013

I believe I have found the problem.

I didn't notice that the CCS demo code is for the MSP430X which is a different arch than MSP430. (20-bit addressing vs 16-bit). If I switch the arch to MSP rather than MSPX then I get illegal instructions.

Looks like I need to start with the code from portable/GCC/MSP430F449 and use that for my project rather than the 430X stuff.

simple led blinker task crashing with msp430f5529

Posted by smithbone on October 29, 2013

After further investigation it seems I'm wrong. The msp430f5529 is an MSPX type arch since it has > 64k of flash.

So I'm back at square 1.

[ 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