simple led blinker task crashing with msp430f5529

smithbone wrote on Monday, 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 * ) ( ( ( portPOINTER_SIZE_TYPE ) &ucHeap[ portBYTE_ALIGNMENT ] ) & ( ( portPOINTER_SIZE_TYPE ) ~portBYTE_ALIGNMENT_MASK ) );

If I specify a configTOTAL_HEAP_SIZE 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 ) portBYTE_ALIGNMENT_MASK ) == 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


rtel wrote on Monday, 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.


smithbone wrote on Monday, 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 (__TI_intXX) 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.

smithbone wrote on Monday, 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.

smithbone wrote on Tuesday, 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.