11 Replies Latest reply on Oct 17, 2012 8:11 AM by silvio.ziegler

    Upload new firmware without disconnect

    markus.schatzl

      Hi,

         

      the release notes for SDK 1.2 state on p. 6 that there's a way now to reset the FX3 to the boot firmware image without the necessity to disconnect it.

         

      Can you please detail how this is going to be done? Is there a particular USB vendor command to realize this functionality?

         

       

         

      Thanks,

         

      Markus

        • 1. Re: Upload new firmware without disconnect
          rama.sai.krishna.vakkantula

          Hi Markus,

             

          CyU3PUsbJumpBackToBooter API has been added to the new SDK to support this feature. When you want to switch to the bootloader image you can call this API by passing the address of this 2nd stage bootloader.

             

          For more information regarding the same, please refer to p. 414 of FX3APIGuide document.

             

          Regards,

             

          sai krishna.

          • 2. Re: Upload new firmware without disconnect
            markus.schatzl

            Thanks. According to the API description, CyU3PUsbJumpBackToBooter() provides a way to reset the device to its primary bootloader state from firmware. This however also means that the firmware must take provisions to give the user/developer access to it (which means more application code).

               

             

               

            Furthermore, it requires a developer to retrieve the entry address beforehand, which is different for every firmware.

               

             

               

            Did you think of getting this a bit more accessible, as like the FX2 reset (which is a call to a fixed address)? I suppose that being able to conduct a reset via a simple vendor request with a fixed address would make life simpler for the majority of developers.

               

             

               

            Looking forward to your comment,

               

            Markus

            • 3. Re: Upload new firmware without disconnect
              silvio.ziegler

              Below is the verbose output of the elf2img converter. What is now the bootloader start address I need to pass as an argument?

                 

               

                 

              -Sil

                 

               

                 

              "C:\Cypress\EZ-USB FX3 SDK\1.2\\util\elf2img\elf2img.exe" -i SlaveFifoSync_10.elf -o SlaveFifoSync_10.img -v
              Endian-ness    : Little
              Note: 256 bytes of interrupt vector code have been removed from the image.
                    Use the "-vectorload yes" option to retain this code.

              Entry point    : 0x400220a8
              Program header table offset: 0x00000034
              Program header count       : 3
              Program header entry size  : 0x0020
              Copying data from program header:
                  Addr=0x00000100 Size(words)=0x00000686 FileSize=0x00000686 Offset=0x00000100 Flags=0x00000005
              Copying data from program header:
                  Addr=0x40003000 Size(words)=0x00004000 FileSize=0x00004000 Offset=0x00003000 Flags=0x00000005
              Copying data from program header:
                  Addr=0x40013000 Size(words)=0x00003d18 FileSize=0x00003d18 Offset=0x00013000 Flags=0x00000005
              Copying data from program header:
                  Addr=0x40030000 Size(words)=0x00000cfe FileSize=0x00000139 Offset=0x00028000 Flags=0x00000006
              ' '

              • 4. Re: Upload new firmware without disconnect
                silvio.ziegler

                Aside from the problem that I do not understand where I find the bootloader address, when calling the function  CyU3PUsbJumpBackToBooter () I get error code CY_U3P_ERROR_OPERN_DISABLED even if I set CyU3PUsbSetBooterSwitch(CyTrue) before. What is wrong here?

                   

                 

                   

                -Sil

                • 5. Re: Upload new firmware without disconnect
                  silvio.ziegler

                  Meanwhile I have downloaded SDK 1.2.1 where the JumpBackToBooter functionality is demonstrated in the USBBulkSourceSink example. However, it does not work properly: I have built and stored the boot_fw to the SPI flash, so that the second stage bootloader is started after power-up. Afterwards I download the USBBulkSourceSink example to the FX3 RAM using the ControlCenter. In the device manager the FX3 device stays on the old VID&PID until I reconnect the USB cable. So there seems to be something wrong with this example. Please let me know how to solve this.

                     

                   

                     

                  Regards

                  • 6. Re: Upload new firmware without disconnect
                    silvio.ziegler

                    Maybe I was asking the wrong question: What do I need to do when I want to re-enumerate between the second stage bootloader and the final application? I have different applications with different number of endpoints and PID&VID so I need to re-enumerate. However, it seems that JumpBackToBootloader can only work when no re-enumeration is set in CyU3PUsbStart().

                    • 7. Re: Upload new firmware without disconnect
                      rama.sai.krishna.vakkantula

                      Hi Sil,

                         

                      The main purpose of this API is to provide a mechanism to re-programm/update the firmware without disconnecting the EEPROM. So here the assumption is that USB descriptors are not changing. Anyways if USB descriptors are different then we can reset the device after downloading the new code so that it will enumerate with the new descriptors.

                         

                      Thanks,

                         

                      sai krishna.

                      • 8. Re: Upload new firmware without disconnect
                        rama.sai.krishna.vakkantula

                        Correction: Without disconnecting the USB*

                        • 9. Re: Upload new firmware without disconnect
                          silvio.ziegler

                          But how can I reset the FX3 by software? Hardware reset is not an option as my device does not have a reset switch.

                             

                           

                             

                          -Silvio

                          • 10. Re: Upload new firmware without disconnect
                            user_1377889

                            Try to use

                               

                            CyU3PDeviceReset(false);

                               

                             

                               

                            Bob

                            • 11. Re: Upload new firmware without disconnect
                              silvio.ziegler

                              This did the job. Thanks.

                                 

                               

                                 

                              -Silvio