cancel
Showing results for 
Search instead for 
Did you mean: 

i can't run keil sample -i am new-

hmehmetkurnaz
Associate II
Posted on September 04, 2007 at 07:25

i can't run keil sample -i am new-

3 REPLIES 3
hmehmetkurnaz
Associate II
Posted on May 17, 2011 at 09:46

Hi all.I am new about str9.I have keil mcb-str9 DK.And ulink2.

I can build keil sapmles and download flash memory.But it doesn't run.I tried uart sample and gpio sample.Also i wrote a basic gpio sample for leds on board.(P0.7-P0.0).

Here my sample source code.

int main()

{

unsigned char *gpio7data;

unsigned char *gpio7dataDir;

unsigned int *scu;

unsigned char *p7FullPins;

int i;

//SCU_GPIOOUT = 01

scu = (unsigned int *)0x5C002060;

*scu = 0x00005555;

//

gpio7data = (unsigned char *)(0x58000000 + 0x0000D000);

gpio7dataDir = (unsigned char *)(gpio7data + 0x400);

*gpio7dataDir = 0xFF;

//gpio7data + 3fc (PADDR? may be wrong)

p7FullPins = (unsigned char *)(gpio7data + 0x3FC);

while (1)

{

//set leds pins

*p7FullPins = 0xFF;

for (i = 0; i < 50000; i++);

//clear leds pins

*p7FullPins = 0x00;

for (i = 0; i < 50000; i++);

}

}

What is the problem.Is the STR91x.s file wrong?I attached STR91x.s

Can you attach me a basic running program.

Regards...

Mehmet Kurnaz

sarao
Associate II
Posted on May 17, 2011 at 09:46

here's a little project I have which exercises the UART and GPIO on the mcb-str9. I always have trouble remembering to include a working startup file. The one in my project works for me. BTW, I'm using uVision 3.5.

You may need to modify led.c to GPIO7 (I'm currently using GPIO6 pins connected to some prototype board.)

Example:

change my line:

#define GPIO_ADDR GPIO6

to

#define GPIO_ADDR GPIO7

Hope this helps.

hmehmetkurnaz
Associate II
Posted on May 17, 2011 at 09:46

Hi jsarao.

So thanks for help.It was useful.

Regards..

Mehmet