error 131: mcs51

Help
2009-02-23
2013-03-12
  • Frank Remias
    Frank Remias
    2009-02-23

    Hi, i just installed MCU 8051 IDE and sdcc compiler.
    I tryed compile simple c code for 8052
    its
    #include <stdio.h>
    int main (void)
    {
    P1=0xff;
    while (1)
      {
        P1<<=1;
        P1=P1+0x01;
    }}

    Every time i tried compile it with this command
    sdcc --iram-size 256 --xram-size 0 --code-size 8192  --nooverlay --noinduction --verbose --debug -V --std-sdcc89 --model-small --pack-iram  "test.c" -mmcs51

    I got this error:
    at 1: error 131: cannot generate code for target 'mcs51'

    I never used sdcc before, can someone help me what to do?
    I am using Ubuntu 8.10 and i installed sdcc from deb package.
    The version is
    SDCC : avr/pic16/pic14/xa51 2.8.0 #5117 (Jun  2 2008) (UNIX)

    Thank You

     
    • C.S.M.G. Sarma
      C.S.M.G. Sarma
      2009-02-23

      ***
      #include <stdio.h>
      ***
      You should use 8051.h

      ***
      Every time i tried compile it with this command
      sdcc --iram-size 256 --xram-size 0 --code-size 8192 --nooverlay --noinduction --verbose --debug -V --std-sdcc89 --model-small --pack-iram "test.c" -mmcs51
      ***

      8051 is sdcc's default controller and so is small memory model so all you need to use is

      sdcc <file name>

      and no other conditions required, at least for this case.

       
    • Raphael Neider
      Raphael Neider
      2009-02-23

      > SDCC : avr/pic16/pic14/xa51 2.8.0 #5117 (Jun 2 2008) (UNIX)

      You seem to have configured your sdcc with --disable-mcs51, thus omitting the mcs51 code generator. Consider building sdcc using the default options, e.g.,
      ./configure --prefix=$HOME/local && make && make install
      to install sdcc in your own home (does not require root privileges).
      You might want to add
      export PATH=$PATH:$HOME/local/bin
      to your ~/.bashrc (or equivalent csh/...-constructs).

      Best regards,
      Raphael

       
      • Frank Remias
        Frank Remias
        2009-02-23

        Thank You very much for you help. I figured it out. The problem was, that the default debian package doesnt have mcs51 support. So i recompiled it from source and its working now