Skip to main content
Visitor II
February 22, 2008
Question

can we use examples using stlib for keil evaluation board mcbstr9

  • February 22, 2008
  • 10 replies
  • 2009 views
Posted on February 22, 2008 at 21:06

can we use examples using stlib for keil evaluation board mcbstr9

    This topic has been closed for replies.

    10 replies

    nanuradhaAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    Hi,

    we are using keil evaluation board for str912fw44.We are not able to work with examples which use stlib.only ex blinky without lib we are able to do.Is there any problem or we are doing any mistake.Please guide me.

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    Hello,

    if you want to use the Stlib example (witch are writen for IAR compiler) you should use the ''like IAR'' startup file

    These two file initialise chip like IAR startup does and then call the KEIL C Stdlib start code.

    ps

    this only work with keil V3.xx

    nanuradhaAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    hi,

    here we are using MCBSTR9 Evaluation Board. for this board only one example has given. it is working. the path for this program is: ARM/RV30/BOARDS/KEIL/BLINKY.

    program is:

    #include

    void delay(u32);

    int main (void)

    {

    SCU->GPIOOUT[7] = 0x5555; /* P7.0..7 output - mode 1 */

    GPIO7->DDR = 0xFF; /* P7.0..7 Outputs (LED Data) */

    while (1)

    { /* Loop forever */

    GPIO7->DR[0x3FC] = 0xF0; /* Turn on LED */

    delay(0x0FFF);

    GPIO7->DR[0x3FC] = 0x0F; /* Turn on LED */

    delay(0x0FFF);

    }

    }

    void delay(u32 i)

    {

    u8 j;

    while(i-->0)

    for(j=0;j<=100;j++);

    }

    The path for another program :ARM/RV30/BOARDS/ST/BLINKY ,with some modifications according to my board, is not working.

    i don't know why it is not working in my board(MCBSTR9 Evaluation Board).

    the modified code which is not working in my board is:

    #include ''91x_lib.h''

    GPIO_InitTypeDef GPIO_InitStructure;

    u32 var;

    void SCU_Configuration(void);

    static void Delay(u32 nCount);

    int main()

    {

    #ifdef DEBUG

    debug();

    #endif

    SCU_Configuration();

    GPIO_StructInit(&GPIO_InitStructure);

    /* GPIO Configuration ------------------------------------*/

    GPIO_DeInit(GPIO7);

    GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput;

    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;

    GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ;

    GPIO_Init (GPIO7, &GPIO_InitStructure);

    while(1)

    {

    GPIO7->DR[0x3FC] = 0xFF;

    Delay(0x0FF);

    GPIO7->DR[0x3FC] = 0x00;

    GPIO_WriteBit(GPIO7, GPIO_Pin_0, Bit_RESET);

    GPIO_WriteBit(GPIO7, GPIO_Pin_1, Bit_RESET);

    GPIO_WriteBit(GPIO7, GPIO_Pin_2, Bit_RESET);

    GPIO_WriteBit(GPIO7, GPIO_Pin_3, Bit_RESET);

    Delay(0x0FF);

    }

    }

    void SCU_Configuration(void)

    {

    SCU_APBPeriphClockConfig(__GPIO7 ,ENABLE);

    }

    static void Delay(u32 nCount)

    {

    u32 j = 0;

    for(j = nCount; j != 0; j--);

    }

    to work this program in my board (MCBSTR9) what i have to do?

    Thanks in advance

    regards

    raj.

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    hi raj,

    have you check if the __GPIO7 is defined in the right way?

    the label is in the SCU_Configuration().

    the correct label there could be GPIO7, the other one seem to

    be a CUP generated label.

    nanuradhaAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    ''this only work with keil V3.xx''

    Hello,

    we have used 91x_vect.s,91x_init.s along with STR91x.s as start up code.But still we are facing the same problem. let me know anybody is there who works on the same board(MCBSTR9). can u please help us.

    regards

    anuradha.

    nanuradhaAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    Hai stevejamal,

    ya it is the right way to define like __GPIO7.

    The program which i have given is working program for STR910 EVALUATION BOARD which is supplied by ST. but we are using MCBSTR9 Evaluation board which is supplied by KEIL. here for this board just i have changed the GPIO9 to GPIO7. Rest is same.

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    hi anuradha,

    try to add to the GPIO_Initstrcture

    GPIO_InitStructure.GPIO_Alternate=GPIO_OutputAlt1;

    I compiled your code with iar and without this field

    the gpio doesn't work.

    If you see in the blinky example there is

    SCU->GPIOOUT[7] = 0x5555; /* P7.0..7 output - mode 1 */

    Ste

    nanuradhaAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    Hai Steve,

    thanks for u'r reply.

    i have modified my code according u'r sugession. but no use.

    i think there should be need to modify the start up code, what do u say?

    here we are using KEIL-REALVIEW compiler and MCBSTR9 Evaluation board.

    could u please send the working code for me.

    thanks & regards

    raj.

    nanuradhaAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    Hai Steve,

    now it is working.

    thank u.

    raj........

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:33

    Hi, I ran into this same problem... RAJ, could you please post the solution?

    Thanks in advance,

    Dave

    [ This message was edited by: dbarbarine on 25-02-2008 19:31 ]