9 Replies Latest reply on Oct 26, 2020 10:37 AM by DheerajP_41

    Downloading firmware via UART pins on CYBT-213043 Mesh Kit

    LUAB_4724786

      Hello,

       

      Previously we already purchase a few CYBT-213043-02-EZ-BT, before we create a PCB to test it, I would like to simulate downloading the firmware via UART directly with existing Mesh Kit in hand. I can only guess a few steps to do that, e.g. switching the dip switch, usb to serial, changing the com port in make file ... and use the connector point in the kit, well ... its guessing only for now, kindly help me with the proper steps ?

       

      Our target for the PCB is to use it later to download the firmware with very minimum components, just BLE Mesh and some pins, for further development, thanks.

       

      Best Regards,

      LUTHFI AD

        • 1. Re: Downloading firmware via UART pins on CYBT-213043 Mesh Kit
          DheerajP_41

          Hi,

           

          I assume, you wanted the steps for programming CYBT-213043-MESH (or EVAL) kit?

          Then, Kindly check Eclipse IDE for ModusToolbox Quick Start Guide , if you have any doubt in how to use the Modustoolbox for downloading the application. (For ModusToolbox version 2.1 documentation, please click here.) The steps for downloading a program to a board is generic in nature, not specific for each kit.

           

          In general, minimum steps for programming the kit, would be like: -

          1. Import an application to the Modustoolbox workspace.

          2. Connect the kit to the PC via USB. (The board will be having a USB to Serial Converter).

          3. Build and program the kit.

          (The IDE will automatically search and find the compatible kit connected to the PC. Otherwise you can mention the COM Port in the makefile)

           

          If you wanted to program the mesh module (CYBT-213043-02-EZ-BT), before you create the final PCB for testing, you can try connecting the module as per the reference design given in the corresponding evaluation kits. (E.g. https://www.cypress.com/documentation/development-kitsboards/cybt-213043-eval-ez-bt-module-arduino-evaluation-board ). The corresponding HW schematic, will show the minimum components needed to get the module work.

           

          Thanks,

          -Dheeraj

          • 2. Re: Downloading firmware via UART pins on CYBT-213043 Mesh Kit
            LUAB_4724786

            Dear Dheeraj,

             

            I understand the normal procedure to download the program to the mesh kit, Any chance to simulate programming via usb to serial with to the mesh kit ?

             

             

             

             

            Best Regards,

            LUTHFI AD

            • 3. Re: Downloading firmware via UART pins on CYBT-213043 Mesh Kit
              LUAB_4724786

              I saw these pins, can I use it with USB To Serial to download program in order to simulate it ?

               

              InkedIMG_2962_LI.jpg

               

              Best Regards,

              LUTHFI AD

              • 4. Re: Downloading firmware via UART pins on CYBT-213043 Mesh Kit
                LUAB_4724786

                Hi Dheeraj,

                 

                I decide to go ahead with those socket connection on Mesh Kit after reading the schematic and it seems working fine ! just want to share what I did, see below :

                 

                • Change the com port to my USB To Serial Bridge (I am using FTDI232) in make file.
                • Switch off SW4.
                • Connecting the USB To Serial pins, need to swap RX->TX, RTS->CTS, etc.
                • VDD is 3.3V.

                 

                And it is working ! sometimes need to do some procedure hold recovery button and reset based on the instruction to load. I will proceed and order our custom host PCB then, thanks for the support.

                1 of 1 people found this helpful
                • 5. Re: Downloading firmware via UART pins on CYBT-213043 Mesh Kit
                  DheerajP_41

                  Hi,

                   

                  It is recommend to recover the device before programming. This allows the device to enter into download mode which accept is ready to accept firmware state.

                   

                  So currently, are you using external USB-to-Serial converter in-order to program mesh module on the mesh kit? Then, It is perfectly fine.

                   

                  Please reach out to us when you need further support.

                   

                  Thanks,

                  -Dheeraj

                  • 6. Re: Downloading firmware via UART pins on CYBT-213043 Mesh Kit
                    LUAB_4724786

                    Dear Dheeraj,

                     

                    Thanks a lot for the support, yes everything working fine with USB to serial and my host PCB is working fine as well, lucky I have to test it with the mesh kit, because previously I have some dilemma about the PCB design ... "should I put the button or not" but after the test with the kit and reading the spec, I feel that I have to put the button in there, since sometime need to do that before downloading.

                     

                    Many thanks to you for all the reminders on the specs and know how and guidelines start from the beginning, finally we manage to make our first pcb for our future product (I separate the RGB led, well .. it works), you are the best !

                     

                    photo_2020-10-21_16-29-40.jpg

                     

                    Last homework ... (it might be minor), need to get rid the button somehow (I know I know ... it is needed before downloading), based on the schematic it looks like XRES is being Pull Up normally (reset button) and UART_CTS is need to be pull down to do reset (recovery button).

                     

                    I will test it later by controlling those button state with FTDI232 usb to serial via pc app to simulate the recovery + reset before downloading, if it is working ... we can download it seamlessly via in-house app combine with chipload.exe without having physical button (need to reduce the size of pcb for future project).

                     

                    But, if you have any info or workaround or ideas about those button, please please let me know, thaaaaanks a lot Dheeraaaj !

                     

                    Best Regards,

                    LUTHFI AD

                    1 of 1 people found this helpful
                    • 7. Re: Downloading firmware via UART pins on CYBT-213043 Mesh Kit
                      DheerajP_41

                      Hi,

                       

                      Recovery method is needed in-order to put the device into download mode. The mode is detected by the ROM boot code sequence.

                      Obviously, It is possible to control these signals using a host MCU instead of manual pushing of buttons. But not sure how you are trying to implement it using FTDI232. Anyway good luck. Please reach out to us if you find any difficulty in your development.

                       

                      Thanks,

                      -Dheeraj

                      • 8. Re: Downloading firmware via UART pins on CYBT-213043 Mesh Kit
                        LUAB_4724786

                        Dear Dheeraj,

                         

                        I just want to share what I did with FTDI, it is working properly actually, now I can go seamless downloading without button in my PCB (next version), yeay !!! so happy ! well ... below is the details when I simulate this with the Mesh Kit.

                         

                        1. You need FTDI module, the one with RTS, CTS, and DTR pin expose.
                        2. Based on the schematic, RECOVERY button is actually connected to UART_CTS, it is pull down when you press the button and held pull up when it is off, anyway ... it is connected to CTS line, so we need to connect it to FTDI RTS obviously.
                        3. For RESET button, we use FTDI DTR Pin, connect it to one of its pin (see below)

                        photo_2020-10-26_17-32-05.jpg

                         

                        Once it is done, below is the simple C# sequence to simulate the buttons.

                        Screenshot (20).png

                         

                        If everything is set, test it by powering up Mesh Kit and if it is working well, in my case I have 2 sign that it is working :

                        1. The Mesh Kit become undetected when you check it via mobile app when you try to "add devices"
                        2. and the other one in my case, the LED D4 in Mesh Kit is light up.

                        photo_2020-10-26_17-32-09.jpg

                         

                        I hope it is clear and can be help for others.

                         

                        Best Regards,

                        LUTHFI AD

                        1 of 1 people found this helpful
                        • 9. Re: Downloading firmware via UART pins on CYBT-213043 Mesh Kit
                          DheerajP_41

                          Hi,

                           

                          Thank you for the detailed description.

                          I hope, this information will be helpful for others as well. 

                           

                          I remember long back ago, I have simulated the recovery procedure using software controlled relay board.

                          I have controlled the relay board using simple python script to do the recovery button presses on the board and then proceeded with firmware download using command line interface.

                           

                          Thanks,

                          -Dheeraj