Announcement

Collapse
No announcement yet.

Firmware upgrade questions

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Firmware upgrade questions

    Hi,

    My system consists of a 4Duino (has ATmega32U4, AVR) and Microchip PIC18F57K42. The
    4Duino talks to the PIC18F57K42 via I2C.
    The 4Duino has a USB interface that can talk to the PC

    I use Arduino IDE to build the 4Duino code and flash the 4Duino.

    Question (1): Is there a way to flash the 4Duino without launching the Arduino IDE?

    Question (2): Is there a way to flash the PIC18F57K42 from the 4Duino?

    Because currently I use a JTAG programmer to flash the PIC code (uses ICD 3 and MPLAB v4.15).
    But to do this we have to open the encasing to get to the JTAG pins which is why we want to be able to do the PIC firmware upgrade without opening the encasing.

    Your suggestion and help is very much appreciated.
    Thank you,
    Asha

  • #2
    Hi Asha,

    Welcome to the forum.

    You may want to check these links related to your queries.

    For the for Arduino file of 4Duino:
    https://www.vascop.com/compiling-and...t-the-ide.html. Another set up is at http://inotool.org/ with its sample project to learn its basics at http://inotool.org/quickstart
    For flashing Arduino HEX file: http://www.ladyada.net/learn/avr/avrdude.html

    For PIC series microcontroller: https://balau82.wordpress.com/2014/0...using-arduino/

    Hope this helps.

    Best Regards,
    Danica

    Comment


    • #3
      Hi Danica,
      Thank you for your response.
      I went thru the links mentioned above and they all are for Linux and MacOS.

      My development is on Windows 10 and I was wondering if there links or anything for Windows?
      Thank you,
      Asha

      Comment


      • #4
        Hi,

        I did try this
        (1)
        For flashing Arduino HEX file:
        http://www.ladyada.net/learn/avr/avrdude.html

        But it seems that to use this tool, "avrdude" I need another device stk500 or similar.
        I was wondering
        why I cannot just flash the "hex" file into the
        4Duino via the USB?

        (2)
        I also tried the Arduino Builder tool to flash the hex file but this I need the "Freematics Esprit" dev board to flash ??

        I just want to eliminate the Arduino IDE to flash the hex file with the existing USB connection.
        The 4Duino is already part of our main board and we use a usb to connect to the 4Duino using the IDE. So is there not a way to flash the hex file this way?

        Thank you,
        Asha

        Comment


        • #5
          Hi, I am adding a word file that gives additional information ErrorFlashing4DuinoViaUSB.docx . Thank you, Asha

          Comment


          • #6
            Hi Asha,

            Since 4Duino display module uses Arduino Leonardo, you may try using the codes discussed in this thread: https://arduino.stackexchange.com/qu...g-command-line. As mentioned in the thread, they have added a Leonardo uploader ( https://github.com/vanbwodonk/leonardoUploader ) because Leonardo boards have different reset sequence. It involves two comm ports – the current port and the upload port.

            This process happens during the bootloader mode and can be confirmed when you show verbose output during compilation and upload and set compiler warnings to all. These setting can be modified through Arduino IDE > File > Preferences as shown in the attached screenshot.

            Click image for larger version

Name:	Modification.jpg
Views:	30
Size:	76.2 KB
ID:	64523

            Before the board can be uploaded, you can notice lines:

            Forcing reset using 1200bps open/close on port COM12
            PORTS {COM12, } / {} => {}
            PORTS {} / {COM15, } => {COM15, }
            Found upload port: COM15 ​​​​​​​ ​​​​​​​

            Arduino IDE is already programmed to execute the avrdude and automatically change the com port. Manually predicting the next port requires deeper modification which can be simplified using the Leonardo uploader.

            Based on the file you sent, those ‘not in sync’ errors occur because the upload port has been changed and was not found.

            Hope this helps.

            Best Regards,
            Attached Files
            Danica

            Comment


            • #7
              Hi Danica,
              Thank you. I followed your explanation concerning the changing of the com ports.
              This was new to me. Appreciate your answer for this.

              However, when I went to https://github.com/vanbwodonk/leonardoUploader and https://arduino.stackexchange.com/qu...g-command-line
              It seems both are for Linux. I need something for Windows. Is there any way I can get that? Thank you, Asha

              Comment


              • #8
                Hi Danica,

                I went thru https://arduino.stackexchange.com/qu...g-command-line and found "arduino-leonardo-uploader-master.zip". I downloaded it and modified it for my files and com port.
                But I get below failure
                C:\Users\asingh\Downloads\arduino-leonardo-uploader-master\windows>upload.bat
                find: USB Serial Device (COM10): No such file or directory
                find: Arduino Leonardo bootloader: No such file or directory

                I am attaching the zip file of my modified version of the uploader as well as captured output from the Arduino IDE that shows the 2 COM ports.

                Is there a way you could see what I am doing wrong? Thank you, Asha
                Attached Files

                Comment


                • #9
                  Hi Danica,
                  Thank you for all your help.
                  I was finally able to upload my hex file with some modification to the Arduino-Leonardo-uploader-master.

                  Now I would like your help in resolving uploading microchip
                  PIC18F57K42 from the 4Duino. Any help is very much appreciated.
                  By the way I have already looked at the microchip website and have not found something like this.
                  Thank you,Asga

                  Comment


                  • #10
                    Hi Asha,

                    Glad to hear that Leonardo Uploader finally worked for your set up.

                    We're currently on the process of research and testing the solution with your latest inquiry. We'll contact you again as soon as possible.

                    Best Regards,
                    Danica

                    Comment


                    • #11
                      Hi Danica,

                      Thank you for your help. I was wondering if there is an update on uploading microchip
                      PIC18F57K42 from the 4Duino?

                      (1) I am assuming this requires a special 4Duino code to run on 4Duino to upload the microchip?
                      (2) does this process to upload the microchip from 4Duino require that the microchip have a bootloader?

                      Thank you,
                      Asha


                      Comment


                      • #12
                        Hi,

                        I did find this but as yet I haven't tested it and it is unknown by the author if it will work on a PIC18. I think that if there is some alterations needed to the Arduino code that it may be possible.

                        There is also a windows utility that accompanies the Arduino code if you read through it.

                        https://forum.arduino.cc/index.php?topic=92929.0

                        Can you please let me know if you think this is the type of apllication you need.

                        Best regards

                        Paul

                        Comment


                        • #13
                          Hi Paul,
                          Thank you. I will try it out and see how far I can go. Will let you know.
                          Thanks, Asha

                          Comment


                          • #14
                            Hi Paul,

                            I looked at this website mentioned in "https://forum.arduino.cc/index.php?topic=92929.0" for PIC18F.

                            I went to "https://sites.google.com/site/thehighspark/arduino-pic18f" and tried to click on below "Download" but the site gave an error.
                            (see in attachment item #1)

                            Then went to the bottom of this website (see in attachment item #2) and downloaded the 2 items, ArduinoPic18F2550Programmer_V0.3.zip and PIC18f.ino

                            This is similar to what I am looking for.
                            Just a few questions
                            (1) would this work for PIC18F57K42 with 4Duino (leonardo)??
                            (2) I am hoping that this is for windows
                            (3) assuming that the PIC does not require bootloader

                            Objective is to make this work as soon as possible and that is why we are asking for help.
                            Thank you,
                            Asha









                            Attached Files

                            Comment


                            • #15
                              Hi,

                              Looking at the Arduino code, I see no reason why it wouldn't work. There would have to be some kind of serial monitoring in your normal 4Duino code to detect a Serial instruction to switch to this program. There doesn't seem to be anything special in its use that would make it only suitable for specific Arduino's.

                              I also found a download location here https://bitbucket.org/kirill578/ardu...led/?at=master

                              It doesn't state that it will work on the PIC18F57K42 so it might be necessary to try it first. Yes, the loader program is a command line program for windows

                              Best regards

                              Paul

                              Comment

                              Working...
                              X