Quality RTOS & Embedded Software

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




Loading

FreeRTOS demo on Explorer 16 board - Newbie

Posted by Brian ODonnell on September 4, 2010
I am trying to get the FreeRTOS demo running on the explorer 16 board. Code builds OK with no errors and downloads but nothing happens when I try ti run it - no leds flash and no message on the LCD. I have built the RS232 port loopback and I know the board is OK as I successfully using it for other code I have written. I am running IDE v 8.36 with ICD3. I have not touched any of the jumpovers on the board since I bought it.

Any help / suggestions would be appreciated. Thanks

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by MEdwards on September 4, 2010
Do you have the fuses set correctly?

As you have an ICD3 then I assume you can debug the code to see where it is going wrong?

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by Brian ODonnell on September 4, 2010
Thanks for your suggestion. I have not changed any of the code settings that come in the demo. Is this a config setting I need to set up ?

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by Richard on September 5, 2010
The fuse settings can either be saved as part of the project (through the menus) or using #pragma's in the code. I think the project in question saves them as part of the project. If you have not changed anything then that should still be the case but maybe its worth checking.

As edward3 says though, using the debugger to see at what point the code stops executing properly would be your best route to a quick answer.

Regards.

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by Brian ODonnell on September 5, 2010
I have run this with the debugger turned on. It seems to stop on line 89 in the heap_1.c routine. Not sure what I need to do next !
Heap size and stack size are both set at 3000 bytes in the build options for the project.
Just in case I am doing this debug thing incorrectly. I have built the project with the debug options on as per the MPLAB IDE debug tutorial and tested the same approach OK on another much simpler program.

When the FreeRTOS program stops I am looking in the disassembly listing to see where the green arrow is - I assume that is the area of instruction where it is stopping....

P.S as you can tell I am on a steep learning curve with this stuff - still I am happy to keep plugging away so I appreciate any help I guidance . Thanks in advance.

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by Richard on September 6, 2010
> I have run this with the debugger turned on. It seems to stop on line 89 in
> the heap_1.c routine. Not sure what I need to do next !

In my version line 89 is:

void *pvPortMalloc( size_t xWantedSize )

which is just a function entry point. Which version of FreeRTOS are you using? Does pvPortMalloc() execute at all before it stops there permanently?


> Heap size and stack size are both set at 3000 bytes in the build options for
> the project.

If the heap and stack are both 3000 bytes then you won't be able to create any tasks, as the first thing that gets allocated is the task control block leaving too little heap left to allocate the task stack.

These are not the values that the project has configured when you download it. Did yo make any other changes?

Regards.

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by Brian ODonnell on September 6, 2010
Thanks for your note. I am running FreeRTOS V 6.05. The heap and stack settings were the only things I have touched. The original project came with these blank. I seem to get the same result now each time I run it in debug regardless if the haep/stack are blank or set to 3000 bytes.

Now today the program seems to stops at line 1998 in task.c which is different from where it was stopping yesterday. Do you think I need to download a new version ?

Current halt location at address 01BEO

1997: static tskTCB *prvAllocateTCBAndStack( unsigned short usStackDepth, portSTACK_TYPE *puxStackBuffer )
1998: {
01BD8 FA0000 lnk #pvParameters
01BDA BE9F88 mov.d w8,[w15++]
01BDC 781F8A mov.w w10,[w15++]
01BDE 780500 mov.w w0,w10
01BE0 780401 mov.w w1,w8
1999: tskTCB *pxNewTCB;
2000:

Many thanks for your continued help.

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by Dave on September 6, 2010
“The original project came with these blank”


You know FreeRTOS manages its own heap and does not use the compiler configured one, don't you? I would recommend starting with a simpler application or reading more about FreeRTOS. Memory management is explained on the web site and further in the e-book you can obtain from $25, not a big investment.

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by Richard Damon on September 6, 2010
Dave, if you use heap3, then the FreeRTOS heap is the compiler heap. Only heap1 and heap2 ignore the compiler heap.

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by Brian ODonnell on September 6, 2010
Ok thanks.

Have you successfully run FreeRTOS on the Explorer 16 board ? Looking at the documentation perhaps I should switch to heap2.c for the dsPIC33 demo ?

I thought the dsMAPLAB demo was supposed to run straight of the box - I did not see any commentary in the instructions about swapping to a different memory management model ?

Thanks for your help.

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by Brian ODonnell on September 7, 2010
Tried a fresh install this evening. Deleted all FreeRTOS files and downloaded latest version. Compiled all OK first time with no errors. Downloaded to Explorer 16 board again with no errors.

I plugged in the D-9 connector with the RX/TX loopback and restarted the board but still no signs of life when I tried to run it,.

I did not touch any of the settings in the project file or any compiler options. I am running the sudent edition of the C30 compiler in which the optimization features are expired so there is always a string of warning messages.

I did run the MPLAB IDE demo program on the Explorer 16 board and it worked fine.


Any suggestions gratefully received.

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by Richard on September 7, 2010
“Have you successfully run FreeRTOS on the Explorer 16 board”


Well yes, obviously, with PIC24, dsPIC and PIC32. That is why the demo is presented on that board and the documentation uses that board. I would not put together all that without actually trying it. Although this is quite an old port and I have not tried it for a while.

As I recall you have two options to run the code. Create a debug build and run it via the debugger (with the ICD2 used to download and debug - I have not tried it with an ICD3), or create a release build - flash the device - then reset to get the code to run. I would not expect a debug build to run by power cycling the board.

Regards.

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by Brian ODonnell on September 7, 2010
Thanks for your note.

I did not mean to suggest that the FreeRTOS code was untested I was just trying to find out if there are any special settings needed to run it on a recent explorer16 board with ICD3.

I think I will try running the code on the MPLAB simulator in order to get an understanding of how the code flows so I can trace how it gets to the point where it is stopping.

Thanks

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by Brian ODonnell on November 30, 2010
I have resolved why the FreeRTOS demo on the Explorer16 board was not running when I first tried it back in September. There is a text string on the MPLAB C30 command line in the demo project which starts ' -fno-omit-frame-pointer ' . When I remove this portion of the text line, the demo runs fine. According to the C30 compiler documentation this command is used to prevent the optimizer from disabling the use of the Frame Pointer.

I don't understand why I need to remove this command - would welcome any suggestions. Thanks

RE: FreeRTOS demo on Explorer 16 board - Newbie

Posted by Dave on November 30, 2010
If I remember correctly from conversations way back, that was to avoid a bug in the compiler that I'm sure would have been fixed a long time ago.


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




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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