MC9S08GB32 Memory Ploblem with Codewarrior

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC9S08GB32 Memory Ploblem with Codewarrior

3,000 Views
Alexandre_Mello
Contributor II
I'm using a program with Codewarrior, but my variables keep disapearing, like they were saved in a memory area that doesn't exist. I'm using no external memory, and would like some help with how to set Codewarrior to not trying to use external memory.
I've tried to use memory model Tiny and Small, and I got ploblems in both cases, but with different variables in each.
Labels (1)
0 Kudos
8 Replies

727 Views
Nouchi
Senior Contributor II
Hi,

maybe you are talking about a local variable, if it's the case, you probably used high level optimization (speed or size) and your local is optimized, (displayed in Grey in hiwave). If you want to trace your variable you can declare it as 'volatile' or declare it as global or select (with smart sliders) an easier debug mode level.


Emmanuel
0 Kudos

727 Views
Alexandre_Mello
Contributor II
Well, I did use the project wizard, and I didn't used any kind of optimization. Any suggestion on what may be happening?
0 Kudos

727 Views
Geezer
Contributor I
attach your code, and the project link file (.prm)
Better yet zip up the entire project.
0 Kudos

727 Views
Alexandre_Mello
Contributor II

I'm sending my entire project.

This project I got from the Freescale site and modified it a little (just changed the ports where my hardware were connected). The program was originaly designed for the MC9S08GB60 to be used with te MC13192, but I'm using the MC9S08GB32.

The variable that I'm having problem with is the "Timer_Goal", but there must be other variables with problems, but I couldn't find which ones exactly.
What happends is that this variable changes to a negative number without reason making the timer to stop too soon.

Also, I am using the version 3.1 of Codewarrior.

 

Sem_Fio.zip

Message Edited by t.dowe on 2009-10-27 12:31 PM
0 Kudos

727 Views
CompilerGuru
NXP Employee
NXP Employee
could this be a stack overrun?
Timer_Goal is around the highest allocated variables and the stack just has 0x50 bytes.
Try to increase the STACKSIZE in the prm file.

Daniel
0 Kudos

727 Views
Alexandre_Mello
Contributor II
It worked, the problem was really the STACKSIZE. Thank you all for the help!

And yes, I'm from Brazil-Curitiba-PR.
0 Kudos

727 Views
Br
Contributor I
Hi Alexandre,

I opened your project in my CodeWarrior CW08 V5.0 . At first look it seems that the program is OK.
Try to download this CodeWarrior version (CW08 V5.0) and test your project.


Where are you from? I saw the name "Sem Fio" in your project. I´m from Brasil.

Regards,
Emerson
0 Kudos

727 Views
Br
Contributor I
I'm using a program with Codewarrior, but my variables keep disapearing, like they were saved in a memory area that doesn't exist. I'm using no external memory, and would like some help with how to set Codewarrior to not trying to use external memory.
I've tried to use memory model Tiny and Small, and I got ploblems in both cases, but with different variables in each.

Hi Alexandre,

Nowadays I´m working wiht MC9S08GT32, that is the same MCU that you are using. The only difference is the number of pins.
I´m considering that you are programming in C language. Both of them can be created automatically by the CodeWarrior on the correct place in RAM memory if you create your project using the CodeWarrior wizard assistent. Please verify this possibility and post your conclusion here in our forum.

Regards

Emerson
0 Kudos