3 Replies Latest reply on Feb 9, 2016 3:28 AM by user_1377889

    Programmatically Changing Bootloader Communications Component

    user_71310180

      Hello,

         

      I would like to programmatically change the communications component utilized by the bootloader on a PSoC5. Here's why. Normally I would bootload a bit of firmware over USBFS. However, there could be an alternative way of bootloading through a serial port that would be advantageous under certain circumstances. Is there a way to programmatically select which component is used before the bootloader component is initialized? 

         

      This statement in the data sheet is a little ominous: "Select one, and only one, communications component", but hey, I'm willing to try! I suppose one way to do this would be to create a custom component that would select the communications component functions of choice at that time. Any other ways?

         

      Thanks.

        • 1. Re: Programmatically Changing Bootloader Communications Component
          user_1377889

          You cold use a self-written custom bootloader. The communication is in your hand, so you may select from different sources when you discover that they are present.

             

           

             

          Bob

          • 2. Re: Programmatically Changing Bootloader Communications Component
            user_71310180

            True, there is that option. I was looking for something a little more out-of-the box. I am looking through the "custom" interface information now.

               

            Edit: In the end, I simply created a new file with the custom communications interface function prototypes that allowed the correct function references to be called depending upon which configuration I wanted. For example:

               
                
            #define USBFS   1u  void CyBtldrCommStart(void) { #ifdef USBFS         USBFS_Bootloader_CyBtldrCommStart(); #else     PM_UART_CyBtldrCommStart(); #endif }  void CyBtldrCommStop (void) { #ifdef USBFS     USBFS_Bootloader_CyBtldrCommStop(); #else     PM_UART_CyBtldrCommStop(); #endif     }  void CyBtldrCommReset(void) { #ifdef USBFS    USBFS_Bootloader_CyBtldrCommReset();  #else     PM_UART_CyBtldrCommReset(); #endif }  cystatus CyBtldrCommWrite(uint8* buffer, uint16 size, uint16* count, uint8 timeOut) { #ifdef USBFS     return USBFS_Bootloader_CyBtldrCommWrite(buffer, size, count, timeOut); #else     return PM_UART_CyBtldrCommWrite(buffer, size, count, timeOut); #endif     }  cystatus CyBtldrCommRead (uint8* buffer, uint16 size, uint16* count, uint8 timeOut) { #ifdef USBFS         return USBFS_Bootloader_CyBtldrCommRead(buffer, size, count, timeOut); #else     return PM_UART_CyBtldrCommRead(buffer, size, count, timeOut); #endif     }
               
               

            Thanks for responding. 

            • 3. Re: Programmatically Changing Bootloader Communications Component
              user_1377889

              You are always welcome.

                 

               

                 

              Bob