This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Function editor problem (uVision2)

Hello,

I've written an initialization file via the Function Editor (uVision2, version V2.37 ) to generate pulses on P3_2.

This is to simulate RC5.

I've written -among other things- the following button definition

define button "Send 0x2183","send_p32_info( 0x2183 )"
When I compile this file, I get the following error:
*** error75, line13: too many items

According to the documentation (and also to me), this is syntactically correct. When I ignore the error message and just start a new PC debug session, the initialization file works as it should and I can perfectly simulate RC5.

Also, when I restart the IDE and compile again the same initialization file without changing something, I do not get this error message.

Anyone experienced something similar?

--Geert

This is the complete initialization file:
//ws 1, _rword(&PulseWidth)
//ws 1, _rword(&RCapTime)
//ws 1, _rword(&RcMessage)
//ws 1, PrevEdgeInMiddleOfBit
//ws 1, FirstNegEdge
ws 1, ReloadTimerTime
ws 1, EdgeDetectTime
ws 1, NrOfBools
ws 1, Rc5Input

// VALUE TO SEND SHOULD BE AT LEAST 0x2000: FIRST BIT IS ALWAYS 1!!!

define button "Send 0x2183"   , "send_p32_info( 0x2183 )"
define button "Send Vol Up"   , "send_p32_info( 0x3010 )"
define button "Send Vol Down" , "send_p32_info( 0x3011 )"
define button "Send 0x2AAA"   , "send_p32_info( 0x2AAA )"
define button "Send 0x2781"   , "send_p32_info( 0x2781 )"
define button "Send 0x2766"   , "send_p32_info( 0x2766 )"
define button "Send 0x2677"   , "send_p32_info( 0x2677 )"
define button "Send 0x3677"   , "send_p32_info( 0x3677 )"
define button "Send 0x3676"   , "send_p32_info( 0x3676 )"
define button "Send 0x2888"   , "send_p32_info( 0x2888 )"
define button "Send 0x3999"   , "send_p32_info( 0x3999 )"
define button "Send 0x3FFF"   , "send_p32_info( 0x3FFF )"
define button "Send 0x2000"   , "send_p32_info( 0x2000 )"
define button " Send all  "   , "send_all()"
define button "Stop sending"  , "signal kill send_p32_info"
define button "Send 0x20FF"   , "send_p32_info( 0x20AA )"


signal void send_p32_info( unsigned int val )
{
    signed char i;

    //while (1)
    {
        for (i = 13; i >= 0; i--)
        {
            if (val & (1 << i))   /* Send 1 */
            {
                //printf( "P3.2 high\n" );
                P3 |= 0x04; twatch (889);
                //printf( "P3.2 low\n" );
                P3 &= ~0x04; twatch (889);
                printf( "Send 1, counter is: %i\n", i );
            }
            else                  /* Send 0 */
            {
                //printf( "P3.2 low\n" );
                P3 &= ~0x04; twatch (889);
                //printf( "P3.2 high\n" );
                P3 |= 0x04; twatch (889);
                printf( "Send 0, counter is: %i\n", i );
            }
        }

    }
    P3 |= 0x04; twatch (889);
    printf( "***************\n" );
    printf( "***************\n" );
    printf( "* End Sending *\n" );
    printf( "***************\n" );
    printf( "***************\n" );
}


signal void send_all()
{
    signed int i;
    i = 0x2000;

    while ( 1 )
    {
        send_p32_info( i );
        i++;

        if ( i == 0x4000 )
        {
            i = 0x2000;
        }
        swatch( 1 );
    }
}

  • I just tried it here and it compiles just fine. Maybe there's a hidden character or something else on that line that's not obvious.

    Jon

  • Jon,

    When I comment out the line that gives problems, then the next line gives the same problem and so on, until I have commented out all my 'define' lines. Then it's compiling without any complains.

    I'll try to come back to an earlier version of uVision2 to see if the problem remains. Let you know about the result.

    --Geert

  • Jon,

    When I comment out the line that gives problems, then the next line gives the same problem and so on, until I have commented out all my 'define' lines. Then it's compiling without any complains.

    I'll try to come back to an earlier version of uVision2 to see if the problem remains. Let you know about the result.

    --Geert

  • Jon,

    What I have seen is the following:

    When the toolbox is visible, then the Function Editor has compilation problems.
    When I first remove the toolbox and then compile, there's no problem.

    As far as I know (but I can be mistaken), there's nowhere mentioned in the documentation that you should not compile a file in the Function Editor while the toolbox is activated. Is this right?

    Could you pls. redo the test again with the toolbox visible before starting the compilation and see if you have the same phenomenon as I have?

    Rgds,

    --Geert

  • Jon,

    I think I finally found what it was. All my previous explanations were not completely correct. For instance, the fact that the toolbox should not be visible while compiling is not true. After I posted this answer, I tried again and then it went wrong again.
    What I finally did (after re-installing V7.01 and seeing also there it went wrong), was deleting the .opt file that belongs to the project (when I created a new project, I did not have problems with a similar initialization file).
    When I then compiled the original initialization file, I didn't see any problems anymore.
    And indeed, when you look in the .opt file, you can see some sections containing the keyword OPTBT, which can have the following syntax:

    OPTBT 0,(Vol Up)(p32_info( 0x3010))
    
    This defines the different buttons in the toolbox.

    Maybe I should have looked in the corrupted .opt file before deleting it and see if there was something wrong with the syntax of OPTBT. If it still happens in the future, I will do this to see what's going wrong.

    Rgds,

    --Geert

  • Jon,

    I think I finally found what it was. All my previous explanations were not completely correct. For instance, the fact that the toolbox should not be visible while compiling is not true. After I posted this answer, I tried again and then it went wrong again.
    What I finally did (after re-installing V7.01 and seeing also there it went wrong), was deleting the .opt file that belongs to the project (when I created a new project, I did not have problems with a similar initialization file).
    When I then compiled the original initialization file, I didn't see any problems anymore.
    And indeed, when you look in the .opt file, you can see some sections containing the keyword OPTBT, which can have the following syntax:

    OPTBT 0,(Vol Up)(p32_info( 0x3010))
    
    This defines the different buttons in the toolbox.

    Maybe I should have looked in the corrupted .opt file before deleting it and see if there was something wrong with the syntax of OPTBT. If it still happens in the future, I will do this to see what's going wrong.

    Rgds,

    --Geert

  • Don't know why some of the answers are appearing twice on the page!!! :-(

  • Don't know why some of the answers are appearing twice on the page!!! :-(

    That is bizarre. I'll get someone to take a look and see if they can figure it out. Nothing's been changed on the posting mechanism for a while.

    As for the toolbox. There is a configuration option to restore all toolbox buttons when you re-start a debug session. I ALWAYS disable this kind of stuff since I have my debugger functions build buttons.

    Jon

  • I have a hunch that your problem is you're simply generating too many entries in the toolbox.

    In our debugger startup scripts here, we usually make sure to clean the toolbox completely (delete button *) and then add new buttons to the empty box.