11 Replies Latest reply on Jan 20, 2017 1:06 PM by newtneutrino

    MCU doesn't work

    josemanugg

      Hi everyone,

       

      I need to use the MCU to get a perfect PWM signal with 85KHz

       

      First of all, I am trying to test the MCU following every steps of this website and compiling the "blinking LED" example.

      "Eclipse MCU" builds correctly the file "/lib/firmware/intel_mcu.bin", but when I run the init_DIG.sh, nothing happens.

       

      What do you think could happens?

       

      I am using Yocto Linux 2.1 with the version "159.devkit"


      Thank you and regards

        • 1. Re: MCU doesn't work
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hello josemanugg,

           

          So, you are following this guide: Creating applications with the MCU SDK for the Intel® Edison board: Overview | Intel® Developer Zone, right? You are stock in Blinking an LED using the MCU | Intel® Developer Zone, right? If so, did you have any issues while installing the MCU's SDK? Which OS are you using to build the MCU applications?
          Why do you say that nothing happens? If you are uploading the stock blink example, then, pin 7 should toggle, is this not happening? If so, how are you testing it?

           

          Peter.

          • 2. Re: MCU doesn't work
            josemanugg

            Hello Peter,

            Thanks for your answer.

             

            As you say, I am following these two guides.

             

            I am using Eclipse MCU on Ubuntu 32bits. I don't have any issues installing the software on this OS.

             

            The application building works without any issue and the file "/lib/firmware/intel_mcu.bin" is loaded correctly to the edison board. But when I reset the board and execute the script, pin 7 doesn't toggle. I am using and oscilloscope to test it.

             

            When I run a program compiled with arduino, with non-MCU eclipse or using mraa library, in other words, for linux, the program works. I think that it could be problem of the update from yocto 2.0 to 2.1 or that the mcu is broken down.

            • 3. Re: MCU doesn't work
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              I understand, does this behavior occurs every time you upload a script or is it sporadic? In any case, have you tried to reflash your board with either Flash Tool Lite or flashall? In case you haven't, why don't you try it? If you do, let us know if it helps.

              Peter.

              • 4. Re: MCU doesn't work
                josemanugg

                I have never been able to work with the MCU since I have the board. Of course, I have reflashed the board with flashall script with different versions.


                Thank you for your answer

                • 5. Re: MCU doesn't work
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  Did you make sure to install the required version of Java (Java SE Runtime Environment 7u75) and to define the environmental variable?
                  Also, does your board connect correctly through SSH to your PC? If the SSH connection is not correctly set, the script won't be uploaded even if it is built correctly. Are you able to start an SSH session to your Edison on your PC?

                  Peter.

                  • 6. Re: MCU doesn't work
                    josemanugg

                    The answer is yes for every question.

                     

                    In fact, I have deleted the file "/lib/firmware/intel_mcu.bin" and the eclipse MCU compiler have created a new binary file in this directory.

                     

                    I don't have any idea about what happened.

                     

                    Thanks for your help

                    • 7. Re: MCU doesn't work
                      Intel Corporation
                      This message was posted on behalf of Intel Corporation

                      This behavior is definitely not normal. Since we have discarded pretty much all other options, I'd guess that the issue was caused by something during the IDE's installation. In that case I'd suggest you to remove it from your PC and try to install it again. Have you tried this?
                       
                      Let me know if it helps.
                       
                      Peter.

                      • 8. Re: MCU doesn't work
                        Bylos

                        Hi josemanugg,

                        It seems that the binary file for the MCU is built on the Eclipse side, and properly uploaded to the Edison board (/lib/firmware/intel_mcu.bin)

                        I would check that the firmware is actually loaded into the MCU at boot, by adding this line at the beginning of the MCU program (for example at the beginning :

                         

                        [...]

                        void mcu_main()

                        {

                             debug_print(DBG_WARNING, "The MCU program has started \n");

                        [...]

                         

                        After compiling, uploading and rebooting, you can log in the Edison console and run the following command :

                        cat /dev/ttymcu1

                         

                        You should then verify that the line "The MCU program has started" is written.

                         

                        Which board are you using ? Sparkfun, Mini breakout, Arduino ?

                         

                        Edit : additionally you can also check that the process of loading the firmware ended successfully with the command line :

                        systemctl status mcu_fw_loader

                        • 9. Re: MCU doesn't work
                          JamesLeo

                          HI,

                          My question is , how to debug MCU 's code?

                          When I click 'debug', the Eclipse says:

                          But, I've build the bin file and can download to Edison board...and then ....---should reset the board?

                           

                          How to debug the code?  the download - reset steps take a long time -- does this download effect the bin of Linux side?

                           

                          If MCU-connect, there be a error:

                           

                           

                          Thanks

                           

                          James

                          • 10. Re: MCU doesn't work
                            Electrumpet

                            Dear all,

                             

                            I have the same issue (I think). Could it be that you are using the breakout board instead of the Arduino board just like me?

                             

                            I get this when I follow the instructions and it does not work either:

                             

                             

                            root@ediElectrumpet:~# sh init_DIG.sh -o 7 -d output

                            DIG = 7

                            DIR = output

                            init_DIG.sh: line 29: echo: write error: No such device

                            // (this is strange because I can just cd to the location /sys/class/gpio/ and see the export file)

                            init_DIG.sh: line 68: /sys/class/gpio/gpio214/direction: No such file or directory

                            (correct. I don't see that)

                            init_DIG.sh: line 29: echo: write error: No such device

                            init_DIG.sh: line 171: /sys/class/gpio/gpio255/direction: No such file or directory

                            (correct. I don't see that)

                            init_DIG.sh: line 283: /sys/class/gpio/gpio214/direction: No such file or directory

                            (correct. I don't see that)

                             

                            Would it be possible to find an init_DIG.sh file for the Edison breakout? I thought that using the MCU is particularly interesting for those of us who want to use the bare bone board?

                             

                            Best, Hans.

                            • 11. Re: MCU doesn't work
                              newtneutrino

                              I had the same problem.  If you check the GPIO pins after running the script you will find te GPIOs in three state.  If you refer to the Edison Manual and the init_GPIO.sh published by intel you will find that the required states of GPIO 214 is reversed.  GPIO needs to be high forcing the GPIOs into three state prior to changing any pins function, then returned to low upon completion.  the sh has it backwards.  Alter the export_gpio 214 function to high and on the last line change of the file, after the case statement change the state from high to low.