Floating-point Math problem, MC9S08PT60

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Floating-point Math problem, MC9S08PT60

587件の閲覧回数
AndreiLuchuk
Contributor I

Having an issue I can't resolve, the following lines of code cause a reset

 

   FLOAT32 fPct100 = 100.00;   FLOAT32 fPct18  = 18.00;   FLOAT32 fPvPercent;    FLOAT32 fBarGraphPercent;   UINT32  nBarGraphSegment   = 0;   fPvPercent = gfPVPercent * fPct100;   fBarGraphPercent = (UINT32)(fPvPercent / NUM_BG_SEGENTS);      //fPvPercent = 20.0000;      fPvPercent = (fPvPercent / fPct100);      //problem here      fPvPercent = fPvPercent / fPct18;         //problem here

 it is possible to step through this statement and hit brakepoints at the end of main loop. however, running is not working. i can't catch the reset with Cpu_OnReset either. 

 

Using CWIDE 10.2 with the latest updates.

 

any suggestions are greatly appreciated.

ラベル(1)
0 件の賞賛
返信
3 返答(返信)

392件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee

Make sure you are not running out of stack. Increase the STACKSIZE in the prm file

(not sure where to set the stack size with Processor Expert).

 

Daniel

 

0 件の賞賛
返信

392件の閲覧回数
AndreiLuchuk
Contributor I

Thanks for looking in, Daniel.

 

I've increased the stack from 0x0080 to 0x0500, but no solution. How much stack does this need?

0 件の賞賛
返信

392件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee

Not that much :smileyhappy:.

Thought 0x80 feels a bit low when using floating point arithemtic.

 

To see how much stack it needs, search for STACKSIZE in the forums. Also one way:

https://community.freescale.com/message/115600#115600

 

Another cause might be the COP/watch dog timer, try disabling it temporarly to see.

 

Otherwise, I would recommend to create a small example app showing your issue.

 

Daniel

0 件の賞賛
返信