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

trouble in Demo/CodeWarrior_HCS12_banked

Posted by Jeff Smith on February 17, 2006
Did the CodeWarrior/HCS12 Demo ever work? I don't see how possible.

I have been using experimental ports for GCC/HCS12 for my own stuff, and now I'm getting serious about finishing the full Demo "HCS12_GCC_banked". It is derived from the official "HCS12_CodeWarrior_banked".

It was hard getting started with a normal debuger, but I've finally found the first problem why my demo is crashing when I vAltStartComTestTasks. In "Demo/Common/comtest.c" the demos use this global:
static xComPortHandle xPort = NULL;

The problem seems to be that xSerialPortInitMinimal() returns NULL, and even if it did return the xComPortHandle as was probably intended, the global xPort is never initialized! Somebody please let me know if you have got this demo to work in CodeWarrior.

I don't have a CW setup, but I am going to try to resolve the bug to get my GCC/HCS12 demo working. I'll drop a line when it works.

Using:
FreeRTOS V3.2.3
gcc version 3.0.4 m68hc1x-20030430 (that is m68hc1x patch release 3.0.1)

RE: trouble in Demo/CodeWarrior_HCS12_banked

Posted by Nobody/Anonymous on February 17, 2006
The demo serial port driver only supports one port. The API is generic (used on all the ports) so the port number is passed in and out of the API functions but NEVER used - the COM port used is hard coded and created/initialised using the 'processor expert' addon to CodeWarrior not directly in the code.

Therefore it is not intended that it gets used, and does not matter that it is not initialised. It is only there as something has to be passed into the function.

RE: trouble in Demo/CodeWarrior_HCS12_banked

Posted by Jeff Smith on February 18, 2006
Hello Mr. Nobody, thanks for responding to my probably-mistaken question.

I know it only supports one port, I couldn't miss that when I'm this deep into development ;)
but are you trying to imply (without saying) that you have actually seen the code work? It's just hard to follow when I know it's not working.

Don't worry, I'll probably catch what I missed about xPort not being used, after I sleep a little. It's funny. I have a full application working which uses both serial ports on the MCU. That was one of the very things... I rewrote some stuff including using the xComPortHandle because I had to keep track. I probably knew back then how this demo really worked.

At least I've got that full app working. A transmitter sends wireless data and the FreeRTOS app reads it from one serial port, processes control code, and sends motor control to the second serial port to drive all the motors. It's cool, but I just haven't gotten my stupid Demo to work which doesn't have to do anything useful. Strange, huh?

RE: trouble in Demo/CodeWarrior_HCS12_banked

Posted by Richard on February 18, 2006
The demo applications are left on soak test for a week or so before they make it into the download, so yes, it has run before. It was built with Codewarrior tools, not GCC.

Sound like you have a nice application running which is more complex than the demo, which may be a clue.

The demo applications normally squeeze in as much as possible into the given ROM and RAM. Could it be that GCC is using more stack and therefore this is causing problems?

RE: trouble in Demo/CodeWarrior_HCS12_banked

Posted by Jeff Smith on February 20, 2006
-- Richard said --
"Sound like you have a nice application running which is more complex than the demo, which may be a clue."

Precisely why I was wrong :-/ My application had required that handle to be used because it uses two COM ports. So the clues are throwing me off.

Stack seems likely, although I added 16 to the minimum and that didn't solve it. I'll try something huge if I still have the ram, but the problem might also be some small thing I added when taking out some CW stuff. That extra CW overhead sure looks big and silly when you see it outside of Processor Expert, in a simple example.

Thanks, I'll post when I solve this.

RE: trouble in Demo/CodeWarrior_HCS12_banked

Posted by Jeff Smith on February 21, 2006
Oh, I think I got it.

Before, I thought I could guess how much the configMINIMAL_STACK_SIZE would need to increase, and then do a little more. Instead, apparently I should make the stack sizes obsessively huge at first, because now it is running!

I think next I'll look at a bunch of the stacks to see how oversized. I increased minimal size from 80 to 120. Maybe that's not so bad but I try to be overly conservative :) I'm just releived the demo seems to be fully working now.

When I clean this up, I'll send the demo to Richard so hopefully he can add official support for GCC/HCS12.

I've also got a little documentation to write on this demo so people will know how to config things to their environment.

Thanks everyone helping with this port. --jeffs

RE: trouble in Demo/CodeWarrior_HCS12_banked

Posted by Nobody/Anonymous on February 21, 2006
The only place that configMINIMAL_STACK_SIZE is used in the kernel code itself [rather than the demo application code] is setting the size of the idle task stack. Each other task can use different size if best.

RE: trouble in Demo/CodeWarrior_HCS12_banked

Posted by Jeff Smith on February 24, 2006
Right, meaning the Demo crashed because the configMINIMAL_STACK_SIZE was too small. In my application, I don't need as much stack as the demo tasks. It looks like the Integer math task was overflowing. It takes more stack than I anticipated for temporary storage while doing the math expressions.

I guess GCC was designed to use more registers, I turned off softregs (i.e. _.d1, _.d1), and so it quitely allocates temp stack space for it.


[ 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