11 Replies Latest reply on Jan 9, 2020 7:21 AM by PaYe_4603801

    ModusToolbox 2.0: how to program ?

    PaYe_4603801

      Hello,

      The User Guide states that in order to program device, one must use configuration unit accessible under Launches.

      I built successfully all the projects in Mesh_Demo_213043 application, but Launches remains empty.

      Probably the configuration should be created manually ?

      Ok, there is a hint on the page 37 of the user guide: right-click on project, then select on of the configurators and launch it

      But I don't see any configurator when I right-click on project !!!

      Any suggestion ?

      Thanks.

      P.S. Moreover I don't see main function in the Mesh_Demo_213043 examples.

      Does it mean that examples are incomplete ... or main is hide somwhere in BSP ?

        • 1. Re: ModusToolbox 2.0: how to program ?
          DheerajP_41

          Hi Pavel Yermolenko,

           

          I feel like you are not imported your project correctly.

          Please try below steps:

          Open ModusToolbox IDE and

          Goto File-> New Project -> ModusToolBox IDE -> ModusToolbox IDE Application -> Choose BSP (213043_Mesh) -> Choose Application (mesh_demo) -> Finish.

           

          After importing, when you click on a project you will be able to see the launch options as below.

           

          Capture1.JPG

           

           

          Also, If it doesn't work, please try to use a different relaxed internet connection when you import the project. If you are using a more customized restricted network (Eg: office network) there can be some issue, since MTB2.0 projects are directly imported from github. Applications are not part of the IDE installation.

           

          Thanks,

          -Dheeraj

          1 of 1 people found this helpful
          • 2. Re: ModusToolbox 2.0: how to program ?
            PaYe_4603801

            Tried once more.

            Exactly the same. Here is how it looks:

             

            BTW, concerning ModusToolbox IDE Application -> Choose BSP (213043_Mesh) -> Choose Application (mesh_demo) -> Finish.

            it happened slightly different. After ModusToolbox IDE Application there is choice what to select either BSP, either mesh_demo

            I selected mesh_demo.

            • 3. Re: ModusToolbox 2.0: how to program ?
              PaYe_4603801

              Well ... here is what happened (extract from console):

               

              Error creating Eclipse launch configurations: makefile:195: *** Unable to find any of the available CY_TOOLS_PATHS --  .  Stop.

               

              Error creating Eclipse launch configurations: makefile:195: *** Unable to find any of the available CY_TOOLS_PATHS --  .  Stop.

               

              Error creating Eclipse launch configurations: makefile:199: *** Unable to find any of the available CY_TOOLS_PATHS --  .  Stop.

               

              Error creating Eclipse launch configurations: makefile:193: *** Unable to find any of the available CY_TOOLS_PATHS --  .  Stop.

               

              Error creating Eclipse launch configurations: makefile:195: *** Unable to find any of the available CY_TOOLS_PATHS --  .  Stop.

               

              Error creating Eclipse launch configurations: makefile:189: *** Unable to find any of the available CY_TOOLS_PATHS --  .  Stop.

               

              Error creating Eclipse launch configurations: makefile:195: *** Unable to find any of the available CY_TOOLS_PATHS --  .  Stop.

               

              Error creating Eclipse launch configurations: makefile:195: *** Unable to find any of the available CY_TOOLS_PATHS --  .  Stop.

               

              Error creating Eclipse launch configurations: makefile:195: *** Unable to find any of the available CY_TOOLS_PATHS --  .  Stop.

               

              Unable to find configurator information: makefile:189: *** Unable to find any of the available CY_TOOLS_PATHS --  .  Stop.

              • 4. Re: ModusToolbox 2.0: how to program ?
                PaYe_4603801

                Something wrong with flow: in order to create configuration, makefile wants ModusToolbox folder be in HOME directory of Linux.

                But if I move ModusToolbox in HOME, I cant create application, because application creating wants ModusToolbox in HOME/P-ModusToolbox_2.0.0.1703-linux-install.

                How to proceed ?

                • 5. Re: ModusToolbox 2.0: how to program ?
                  PaYe_4603801

                  Well, I could create application with configuration. But only having ModusTooolbox folder in two locations:

                  • HOME
                  • HOME/P-ModusToolbox_2.0.0.1703-linux-install

                  It it flow bug or intended behavior ?

                  Once more: where is main() ???

                  Thanks.

                  • 6. Re: ModusToolbox 2.0: how to program ?
                    DheerajP_41

                    Hi Pavel Yermolenko,

                     

                    Please try to install MTB2.0 in the default directory.

                    Also please go through https://www.cypress.com/file/492936/download and check whether you are missing anything.

                    (I can see below note in this document

                    "In order for ModusToolbox to work correctly, you must install an additional "libusb-0.1-4" package for the Ubuntu 18.xx OS. To do that, run the following command in the Terminal window: $ sudo apt-get install libusb-0.1-4")

                     

                    Please go through the https://www.cypress.com/file/492951/download  for other information.

                    "Note For Bluetooth applications, you must first create a separate project called wiced_btsdk, which contains the SDK, BSPs, and libraries that are shared among all Bluetooth applications in a workspace. This application only needs to be created once per workspace"

                     

                    For mesh, mesh_app_init() function is the place where the application model starts.

                    Please go through https://www.cypress.com/documentation/application-notes/an227069-getting-started-bluetooth-mesh  to understand the mesh stack implementation.

                     

                    Thanks,

                    -Dheeraj

                    • 7. Re: ModusToolbox 2.0: how to program ?
                      PaYe_4603801

                      Hi Dheeraj,

                      Please try to install MTB2.0 in the default directory.

                      I was baffled by "Extract the ModusToolbox_2.0.0.<build>-linux-install.tar.gz file to your <user_home> directory" (ModusToolbox™ Installation Guide, p. 2).

                      The problem is ... in such extracting ModulToolbox path is preceded by P-ModusToolbox_2.0.0.1703-linux-install.

                      Once P-ModusToolbox_2.0.0.1703-linux-install is removed from path (or speaking more correctly, ModulToolbox is moved to user_home) and all necessary install_rules are run, it becomes correct.

                       

                       

                      For mesh, mesh_app_init() function is the place where the application model starts.

                       

                      In C programs the entry point is main(), it's standard. So, the main() function must exist somewhere. And mesh_app_init() must be called from main or from other function, which in turn called from main().

                       

                      Updated: The only location where I've found main() is:

                       

                      ~/mtw/wiced_btsdk/tools/btsdk-peer-apps-mesh/mesh_client_lib/meshdb.c

                       

                      Sincerely,

                       

                      Pavel.

                      • 8. Re: ModusToolbox 2.0: how to program ?
                        NazarP_56

                        Hi Pavel,

                         

                        The main() it is like a common name for the application entry point, but it is not the must-have rule. A main() function called by startup code after doing some initializing (copy vectors from rom to ram, enable FPU, etc). In 213043 Mesh device,  instead main() uses application_start() function (see ...\wiced_btsdk\dev-kit\libraries\btsdk-mesh\COMPONENT_mesh_app_lib\mesh_application.c).  So because of this, you can not find main().

                         

                        In application_start, initializes BLE stack and do some platforms related steps.  The implementation in COMPONENT_mesh_app_lib should be applicable for most use cases. So, hardware-specific initialization and application-specific callbacks are defined in the wiced_bt_mesh_app_func_table_t structure to enable the Mesh application library to route appropriate callbacks to the user application code. See Table8 in https://www.cypress.com/documentation/application-notes/an227069-getting-started-bluetooth-mesh


                        Regards,
                        Nazar.

                        • 9. Re: ModusToolbox 2.0: how to program ?
                          PaYe_4603801

                          Thanks Nazar,

                          Anyway, the entry point, i.e. application_start () must be specified in a linker script so that the linker can correctly build the code, isn't it ?

                          If so, where such linker script is located ?

                          I believe that I could see the sequences of all function calls when I push on RESET button on a board.

                          If so, does exist some document (e.g. app note) that explain how to proceed ?

                          Thanks once more.

                          Pavel.

                          • 10. Re: ModusToolbox 2.0: how to program ?
                            DheerajP_41

                            Hi Pavel Yermolenko ,

                             

                            When a WICED device turns on, the chip boots, starts the RTOS and then jumps to a function called application_start which is where your Application firmware starts. Common Application definitions can be get from sparcommon.h

                             

                            "If so, does exist some document (e.g. app note) that explain how to proceed ?" -> Proceed what?

                             

                            I would suggest you to go through the LAB manual, GitHub - cypresssemiconductorco/CypressAcademy_WBT101_Files: Files for WICED Bluetooth 101 class which cover all about the basic concepts and doubts for a beginner.

                             

                            Also Please go through https://www.cypress.com/documentation/application-notes/an227069-getting-started-bluetooth-mesh  to understand the mesh stack implementation.

                             

                            Thanks,

                            -Dheeraj

                            1 of 1 people found this helpful
                            • 11. Re: ModusToolbox 2.0: how to program ?
                              PaYe_4603801

                              Hi Dheeraj,

                               

                              Thanks for info.

                              When executing

                              readelf --headers ./BLE_Mesh_Dimmer.elf | grep 'Entry point'

                              the output is as follows:

                              Entry point address:           0x522f19

                              Searching for 0x522f19 in disassembly reveals that entry for  BLE_Mesh_Dimmer application point corresponds to the spar_crt_setup function.

                              My question was about realization of this staff, i.e. what item (e.g. script, conf. file, etc.) specifies that entry point is spar_crt_setup (by the way where it is located ?)

                               

                              "If so, does exist some document (e.g. app note) that explain how to proceed ?" -> Proceed what?

                              I meant how can I check (e.g. see in Console) the sequence of function calls when I do "RESET" on the board ?

                               

                              I would suggest you to go through the LAB manual ...

                              Good source but already outdated, because based on old MT version.

                               

                              Sincerely,

                               

                              Pavel.