cancel
Showing results for 
Search instead for 
Did you mean: 

Cosmic C doesnt step into some code parts

sebastian239955_stm1
Associate II
Posted on February 19, 2008 at 07:15

Cosmic C doesnt step into some code parts

3 REPLIES 3
sebastian239955_stm1
Associate II
Posted on February 18, 2008 at 07:33

hi!

I have a problem with my STVD7 using Cosmic C.

As i just started to work with my ST7 i only want to write a kind of ''hello world'' programm - really simple.

it looks like this:

#include ''ST7521R9.h''

void peripherals_init ()

{

PBDDR = 0xFF; //Port B output

PBDR = 0x0; //Clear Port B

}

void main()

{

peripherals_init();

for (;;)

{

PBDR = 0xFF //activate all LED's connected to Port B

}

}

now the problem is following: when i first started the programm it worked, and the LED went on. then i wanted to expand the code a little, and all of a sudden it didn't work anymore. so i reset the code to the version above, but it still didn't work.

when i step through the code, it enters main, then the peripherals_init() function and then it only reads the first line (PBDDR = 0xFF) but steps over the second line. it also never enters the for - construct. when i put a breakpoint to these lines, the program tells me that the breakpoint is in an empty line that doesnt contain code.

what did i do wrong? has anyone experienced a similar problem?

thanks for your help!

sebastian

luca239955_st
Associate III
Posted on February 19, 2008 at 04:51

one possibility is that your second and/or third built went wrong but you didn't notice, so you are loading an hex file that is no more related to the source.

Another possibility is that the optimizer removed part of your code (that for loop is useless); try to disable it with the -no option.

Hope it helps.

Luca

sebastian239955_stm1
Associate II
Posted on February 19, 2008 at 07:15

i closed the STVD7, opend it again and loaded one of the examplecodes. this one worked and i changed the example-code to my program which again worked. so now the problem is solved, all LED's blinking as if i it were christmas *g*

thanks though for your reply!

sebastian