FreeRTOS Support Archive

The FreeRTOS support forum can be used for active support both from Amazon Web Services
and the community. In return for using our software for
free, we request you play fair and do your bit to help others! Sign up
to receive notifications of new support topics then help where you can.

This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.

/*-----------------------------------------------------------* Application specific definitions.** These definitions should be adjusted for your particular hardware and* application requirements.** THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.** See http://www.freertos.org/a00110.html.*----------------------------------------------------------*/

/* The MSP430X port uses a callback function to configure its tick interrupt.This allows the application to choose the tick interrupt source.configTICK_VECTOR must also be set in FreeRTOSConfig.h to the correctinterrupt vector for the chosen tick interrupt source. This implementation ofvApplicationSetupTimerInterrupt() generates the tick from timer A0, so in thiscase configTICK__VECTOR is set to TIMER0_A0_VECTOR. */#define configTICK_VECTOR TIMER0_A0_VECTOR

/* Prevent the following definitions being included when FreeRTOSConfig.his included from an asm file. */#ifdef __ICC430__ extern void vConfigureTimerForRunTimeStats( void ); extern volatile unsigned long ulStatsOverflowCount;#endif /* __ICCARM__ */

/* Configure a 16 bit timer to generate the time base for the run time stats.The timer is configured to interrupt each time it overflows so a count ofoverflows can be kept - that way a 32 bit time value can be constructed fromthe timers current count value and the number of overflows. */#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats()

/* The MSP430X port uses this callback function to configure its tick interrupt.This allows the application to choose the tick interrupt source.configTICK_VECTOR must also be set in FreeRTOSConfig.h to the correctinterrupt vector for the chosen tick interrupt source. This implementation ofvApplicationSetupTimerInterrupt() generates the tick from timer A0, so in thiscase configTICK_VECTOR is set to TIMER0_A0_VECTOR. */void vApplicationSetupTimerInterrupt( void ){const unsigned short usACLK_Frequency_Hz = 32768;

/* Ensure the timer is stopped. */ TA0CTL = 0;

/* Run the timer from the ACLK. */ TA0CTL = TASSEL_1;

/* Clear everything to start with. */ TA0CTL |= TACLR;

/* Set the compare match value according to the tick rate we want. */ TA0CCR0 = usACLK_Frequency_Hz / configTICK_RATE_HZ;

RE: FreeRTOS 7.0.1 + MSP430F5438 does not work

Why don't you use the IAR project for the MSP430F5438 that is already in the FreeRTOS download?

You have not said what the "problem" is. You have said that you can compile the code and download it, which does not sound like a problem.

That said, you should not use printf() from more than one place without using mutual exclusion. I don't think that will work relliably even if printf() is directed somewhere. Where do you expect to see the text appear?

RE: FreeRTOS 7.0.1 + MSP430F5438 does not work

Posted by devfom on June 20, 2011

I don't use IAR project under Demo dir because it's created in newer version than my.

I used printf() just for test, and expect too see this text in "Terminal I/O", similiar with my previous test examples.

The problem is what when I create the task, the task code don't execute, in fact I don't see any code execution in Debug representation. For example, when I am trying to start simple "LED Blinking" software all work as expected.

RE: FreeRTOS 7.0.1 + MSP430F5438 does not work

I can only support the latest versions of tools - or at least - the version I have. However, the MSP430X port is quite complex in that it is one port with several different configurations. You have to set parameters to say whether you are using large/medium/small code/data models, so you can see there are lots of permutations. The assembly code generated is different depending on the memory models, and the assembly code used in the FreeRTOS port layer has to be correct for the selected memory model. Trying to configure it yourself will not be easy without inspecting the port layer files to see how they determine which instructions should be used (the instructions used depending on the memory model used).

Regards.

RE: FreeRTOS 7.0.1 + MSP430F5438 does not work

Posted by devfom on June 20, 2011

I setup the memory model in project settings options and in the FreeRTOSConfig.h

Can you make the similiar screenshots of your tools?

Regards.

RE: FreeRTOS 7.0.1 + MSP430F5438 does not work

Projects are provided for all the different models, so there is a project with each of the radio options selected. The important thing is how this effects the automatically generated environment variables/preprocessor options, as can be seen by inspecting the data_model.h header file (FreeRTOS/Source/portable/IAR/MSP430X).

Does your version create __DATA_MODEL_SMALL__, __DATA_MODEL_MEDIUM__ and __DATA_MODEL_LARGE__ constants automatically? If no then you will have to define them manually.

Regards.

RE: FreeRTOS 7.0.1 + MSP430F5438 does not work

Posted by devfom on June 20, 2011

Of course, I added this preprocessor directives into assembler options in the project settings, because without them I received compiler errors.

RE: FreeRTOS 7.0.1 + MSP430F5438 does not work

Posted by devfom on June 21, 2011

Can you write me the full name of your controller, include revision? I think the problem is here.

RE: FreeRTOS 7.0.1 + MSP430F5438 does not work

I just had a quick look but cannot find it right now, I think it must be in the other office. It is whatever is put on the experimenter board, REV C springs to mind, but I would have to check when I have the board in front of me.

Regards.

RE: FreeRTOS 7.0.1 + MSP430F5438 does not work

Posted by devfom on June 21, 2011

Ok. In this time I found what the tick system does not work, because vApplicationIdleHook and vApplicationTickHook don't work(I placed in their body the LED light function).

Can you help me with this moment? The ticks code you can see on the top of the topic.

Thanks, Regards Vasiliy.

RE: FreeRTOS 7.0.1 + MSP430F5438 does not work

Posted by devfom on June 21, 2011

Yeah! now it's work for me fine! But I don't know how I fixed this :( I think we problem was in the project settings, because my last action was modification project settings:I checked "Data Model" radio button to "medium", and assembler preprocessor option too.

Very big thanks for help! regards, Vasiliy.

RE: FreeRTOS 7.0.1 + MSP430F5438 does not work

Posted by devfom on June 22, 2011

I'm still have problems.... In this time, when I'm writing the simple task, and put in their body LED on operators it's all OK, but when I add the vTaskDelay function this task works only 4 times.