1 Reply Latest reply on Sep 25, 2020 9:28 AM by KyTr_1955226

    Is there a UART Bootloader Host API?

    brba_4784056

      I would like to replace the UART Bootloader Host Application executable with a program written in LabVIEW. 

      Ideally LabVIEW would call a dll like BootLoad_Utils.dll that has a function Bootload. 

      The Bootload function would take in parameters: COM Port, Baud Rate, and Bootloadable File and it would output the Status Log. 

       

      Alternatively there could be functions like Set_COM_Port, Set_Baud_Rate, Set_Bootloadable_File, and Start_Bootload. 

       

      It would also work if functions like these can be sent from the command line. 

       

      Do these libraries and functions exist?  Is there documentation for how to use them? 

       

      Thanks

        • 1. Re: Is there a UART Bootloader Host API?
          KyTr_1955226

          Bootload_utils.dll is communication protocol agnostic, you have to provide the communication functions yourself in your application.  By default, Bootload_utils.dll mostly just handles the bootloader logic, features such as security keys, and packet structure and then uses your custom written comm functions to actually send/receive commands to write/erase/read/etc.

           

          It generally requires 4 functions:

          int OpenConnection()

          int CloseConnection()

          int ReadData(int * buffer, int size)

          int WriteData(int * buffer, int size)

           

          In the case of a UART, OpenConnection would be written to open the COM port,  CloseConnection would close the COM port, ReadData would receive the specified number of bytes to the specified buffer, and WriteData would write the specified number of bytes of the passed in buffer out.  These functions would need to be written for the communication interface you wish to use.

           

          This appnote for a USB HID Bootloader covers the building of a PC host in a bit more detail. (see chapter 5)

           

          If you wanted to customize bootload_utils.dll itself to your own liking, the source for the library is actually included in the PSoC Creator installation.  The location (using Creator v4.3) is:

          C:\Program Files (x86)\Cypress\PSoC Creator\4.3\PSoC Creator\cybootloaderutils

           

          As far as how to integrate it into Labview, I'm afraid I can't help much there (I haven't used LabView in probably around a decade, even then I barely used it).  There's probably a way to do what you're looking to do.  You would probably need to write the API functions to select a COM port and Baud Rate yourself, as well as the Open/Close/Read/Write functions, and then figure out how to link in bootloader_utils.dll to handle the bootload process itself.

          1 of 1 people found this helpful