Connect with us

Embedded Project In Linux

Discussion in 'Microcontrollers, Programming and IoT' started by vead, May 23, 2017.

Scroll to continue with content
  1. vead

    vead

    473
    14
    Nov 27, 2011
    Hello Everyone
    I have installed ubuntu in my PC. I want to develop embedded project under Linux operating system. I have been developed embedded project under windows based operating system. I have heard that most of companies develop their project on Linux for security purpose . so that's why I want to learn project development in linux. operating system. I am doing some practice on linux by using some commands.I know to develop embedded project we need hardware (8051 development kit), compiler or assembler and programmer software. so I did google search and found that sdcc is suitable software for Linux. it support for intel 8051 and I found flesh magic software to program my p89v51rd2. I think its enough to work on Linux but I am not sure that it's enough tool to work on linux for embedded project.
     
  2. Amar Dhore

    Amar Dhore

    129
    12
    Dec 2, 2015
    One good thing I love about Linux is most of the software are free/open source. There is no specific tool you have to learn but I would start how to manage your files and folder, basic commands. Debugging a small c code with gdb (gcc) is really cool. eclipse is a good tool to have. Just start playing with linux and with your code, eventually you will figure it out. Google is you best friend.
     
  3. Hellmut1956

    Hellmut1956

    53
    3
    Aug 11, 2014
    A good platform to start learning Linux is the RaspBerry Pi. Usually you will not need to modify the kernel of the Linux release you are using.
    Now as to learn what in an RTOS is its Kernel have a look into FreeRTOS. In a very abstract way and by sure oversimplifying the Kernel is the code that manages your system and its resources and to which your application accesses via API calls. Another simplistic way to put it. Kernel what's runs in privileged mode, while your code runs in user privilege. To put it simple. Your code runs in EL0, the Kernel in EL1.
    Once you get a feeling why there are different privilege modes and understand the reason they exist, you will understand why ARM has for so called "hypervisors" an additional level of privilege in ts latest IP releases for Cortex Mx controllers, ARM Cortex M23 and 33, EL2.
    As to your last questions, "vead", as long as you do not need deterministic latency for your system to react well below 1 ms, Linux is fine. Once you get to the latency limits of a release of Linux for embedded systems, there are patches for certain Linux releases that allow you to shorten deterministic latency times.
    Once you really need to stress the deterministic latencies, there are ways to split the cores of a multi core controllers to assign specific core to achieve best latency while executing the non critical tasks in Linux on other cores.
    But when you start to deal with this kind of funny tasks you will be expert enough to spell more challenging questions!
     
    vead likes this.
  4. vead

    vead

    473
    14
    Nov 27, 2011
    Thanks for your help. I am studying some material. If there will be doubt anywhere I will ask
     
  5. shumifan50

    shumifan50

    548
    56
    Jan 16, 2014
    I use Ubuntu and MPLABX to develop software for PIC microcontrollers and it works great. I think you want to develop for the 8051 microcontroller and not an embedded Linux project as such. There is also MikroC available that (I think) supports the 8051. However, using MPLABX and a PicKit3 it is possible to develop the code on your Linux desktop, program the PIC controller and interactively debug your program, without disturbing timings - you can set breakpoints, read and set variables while doing in circuit debugging. Note that some of the smaller PICs cannot be debugged as they do not have enough pins.
    Ignore this post if I misunderstood your problem.
     
    vead likes this.
  6. vead

    vead

    473
    14
    Nov 27, 2011
    yas I want to develop program for 8051 microcontroller. actually I have experience with windows.Now I want to work with Linux I am learning about Linux . I searched on internet SDCC support 8051 microcontroller. than I downloaded SDCC . Now I am trying to install sdcc compiler on ubuntu using command mode. I saw this link for sdcc installation https://sourceforge.net/p/sdcc/discussion/1865/thread/0887092e/
    but I am not able to install sdcc. can someone tell me what I have to do ? where did I mistake ? How to install sdcc in ubuntu?
    Screenshot from 2017-05-27 00-01-09.png
     
    Last edited: May 27, 2017
  7. bushtech

    bushtech

    997
    151
    Sep 13, 2016
    The system can't find the file you are trying to tar. When you are in /tmp directory type ls (which means list) and check if your tar file is actually in the /tmp directory
     
  8. vead

    vead

    473
    14
    Nov 27, 2011
    First I downloaded software that is stored in download folder of ubuntu than I extract that file than I followed following step. created tmp directory
    cd ~
    mkdir tmp
    cd tmp
    what is meaning of this line "tar -xjf ../sdcc-2.7.0-i386-unknown-linux2.5.tar.bz2"
    should I have to type same line ?
    I know I have to learn more about linux command but This time I just want to develop at least one program just want to see how do we create code in sdcc on linux plateform.
     
  9. bushtech

    bushtech

    997
    151
    Sep 13, 2016
    The tar command is used to compress and extract files and programs. See here: https://www.howtogeek.com/248780/how-to-compress-and-extract-files-using-the-tar-command-on-linux/

    So your "tar -xjf ../sdcc-2.7.0-i386-unknown-linux2.5.tar.bz2" command will unzip that file, but the system couldn't find the file in /tmp. I suspect it is still in the download directory.

    I suggest you download a linux cheat sheet from a place like this: https://www.cheatography.com/davechild/cheat-sheets/linux-command-line/

    It will make your life much easier with a few standard commands under your belt.
     
  10. shumifan50

    shumifan50

    548
    56
    Jan 16, 2014
    In ubuntu desktop you don't have to go to the command line to extract the files. At the top of the bar on the left of your screen is an icon that looks like a folder. Click on it and it behaves much like file manager under windows. It will allow you to extract the files if you double click on the .tar file and you can specify where you want it extracted. The days where you have to do everything from the command line in Linux is long gone. Most things can be done very simply from a GUI application.
     
    bushtech likes this.
  11. shumifan50

    shumifan50

    548
    56
    Jan 16, 2014
    tar - the program you are running
    -x = extract the file
    f is followed by the file name
    j - use bzip2 to decompress
    ../ means go up one directory level and then fins the file/sdcc........
    So in your case you would
    cd ~tmp
    tar -xvf sdcc-2.7.0-i386-unknown-linux2.5.tar.bz2

    HOWEVER, the compiler is available under Ubuntu repository and the easiest way to install is

    sudo apt-get install sdcc
    follow the instructions
     
  12. vead

    vead

    473
    14
    Nov 27, 2011
    when I go to home, I see tmp folder under this folder there is floder sdcc-3.6.0. does it means that file has been extracted under tmp folder ? I think yas
    So I think to install compiler I have to follow below steps
    So I have to create user folder first then under the user folder I have to create local folder. right
    am I getting something ?
     
    Last edited: May 27, 2017
  13. bushtech

    bushtech

    997
    151
    Sep 13, 2016
    do cd/tmp/sdcc-3.6.0/
    Then type ls to look at what is in the /sdcc-3.6.0 folder. Then you can see if your files were extracted there.

    But shumifan50's advice is much easier:
    sudo apt-get install sdcc
    follow the instructions
     
  14. vead

    vead

    473
    14
    Nov 27, 2011
    I have run that command. how to check that my compiler has been installed correctly ? also see the below picture where I have run that command
    Screenshot from 2017-05-27 11-54-33.png
     
  15. bushtech

    bushtech

    997
    151
    Sep 13, 2016
    you forgot the sdcc part;)

    sudo apt-get install sdcc

    Then for good measure do

    apt update

    followed by

    apt upgrade

    This is to check if anything is missing
     
  16. vead

    vead

    473
    14
    Nov 27, 2011
    I have typed both command
    sudo apt-get install sdcc
    sudo apt-get update

    Now I am telling what I did , first I have downloaded software which is in download directory and created new folder abhi using mkdir command. I have extracted downloaded file and save to folder abhi (gui mode ) than I typed sudo apt-get install sdcc and than sudo apt-get update. what is next step , how to know that compiler installed successfully?
     
  17. bushtech

    bushtech

    997
    151
    Sep 13, 2016
    Well you could just type sdcc and see if it runs.

    Or click the top button (search) on the line of buttons down the LHS of your desktop and see if it's there or search for it there
     
  18. shumifan50

    shumifan50

    548
    56
    Jan 16, 2014
    Forget about the download you have done and all the other commands you found. When you do the 'sudo apt-get install sdcc', it does everything needed to be done. It also means if you no longer want it you can do apt-get remove to get rid of it. If you do it all by hand then uninstalling (and updating) becomes a nightmare.
    If you do "apt-get install ......."
    then in fiture to update to latest version all you need to do is
    apt-get update
    followed by
    apt-grade upgrade
    To test if it worked after using apt-get
    cd ~<enter>
    then
    sdcc<enter>

    To be honest, I would look for a complete IDE not just a compiler (a bit like Visual Studio).
    Look at this link
    http://www.silabs.com/products/development-tools/software/8-bit-8051-microcontroller-software

    or search for 8051 IDE for Linux
     
  19. vead

    vead

    473
    14
    Nov 27, 2011
    I feel sad when you give your full effort to teach me but I don't understand.
    I found following message. I think I need to install so I typed command
    program sdcc can found following packages
    * cc1111
    * sdcc
    please see the pictures
    Screenshot from 2017-05-27 18-51-28.png
    Screenshot from 2017-05-27 18-45-02.png
    Screenshot from 2017-05-27 19-29-18.png
    when I try to install. it show message, see the third picture
     
    Last edited: May 28, 2017
  20. vead

    vead

    473
    14
    Nov 27, 2011
    Visual studio does not support the the microcontroller that I use in project. I have seen most people use sdcc on linux platform and sdcc support my microcontroller so that's why I am trying to install I think compiler and IDE both are same. by using both we can develop program
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-