4 Replies Latest reply on Nov 4, 2020 12:22 PM by RakshithM_16

    Modus Custom BSP Generate: Incorrect parameter ordering





      New to the Modus Toolbox, I was successfully guided once by a Cypress FAE to generate my custom BSP, Reference Chapter 5 in the Modus Toolbox User Guide.


      I have two targets, one of them is a PSoC 6 WiFi BT Prototyping kit, CYCPROTO-062-4343W.  Quite able to create applications using Modus 2.1 and program/debug.  No problem.


      Our company is building a custom board and exploring a different PSoC 6 series, CY8C6137BZI-F54.  With the guidance of Cypress I made the CapSense_Buttons_and_Slider_FreeRTOS application, used the modus-shell to specify a custom BSP for the 6137 and got that to program and debug on our board.


      Since then I needed to document this information so that it can be duplicated, as we proceed towards products.


      What I'm running in to is an error with the "make bsp" call attempts.


      Starting from scratch, no project, I created both Hello_World and the CapSense_Buttons_and_Slider_FreeRTOS applications using the CY8CPROTO-062-4343W kit for both.  All I've done was to generate the project.


      From that point I know I need to now make a custom BSP (Using Windows 10 by the way), and so I've proceeded to use the modus-shell to do this.



      My modus-shell command and error output:

      $ make bsp TARGET_GEN=My6137_BSP DEVICE_GEN=CY8C6137BZI-F54

      Tools Directory: C:/Users/<me>/ModusToolbox/tools_2.1

      CY8CPROTO-062-4343W.mk: ./libs/TARGET_CY8CPROTO-062-4343W/CY8CPROTO-062-4343W.mk



      Creating My6137_BSP TARGET from CY8CPROTO-062-4343W...

      Populating cy8c6xx7 linker scripts and psoc6_01 startup files...

      Running device-configurator for CY8C6137BZI-F54 CYW4343WKUBG...

      ERROR: Generating code failed. Code generation errors:

              - Unable to evaluate 'CLK_PATH Instance'. Internal error: Incorrect parameter ordering.



      ERROR: Device-configuration failed for ./TARGET_My6137_BSP/COMPONENT_BSP_DESIGN_MODUS/design.modus

      make: *** [libs/psoc6make/make/core/utils.mk:342: bsp] Error 1

      Why does this still show that it's generating for the CY8CPROTO-062-4343W board?

      In my project, should I have changed things prior to building my custom BSP?

      After this effort, I did run the Device Configurator and did File->Change Devices and selected my correct target PSoC 6.  In fact, the output shown is after that failed attempt, where I previously received the same error.


      Any guidance will be helpful.

        • 1. Re: Modus Custom BSP Generate: Incorrect parameter ordering

          I will update to say that I solved this in one manner, but I do wonder if there is another way to do this.

          I created a generic PSoC 6 project, specified that my device was the 6137 once the project was created.

          Then performed the make bsp call.  This worked.

          I next created a project mirroring something like Hello_World and copied the created BSP sub-directory from the generic PSoC project into my Hello_World project and pointed to that by editing the Makefile.

          • 2. Re: Modus Custom BSP Generate: Incorrect parameter ordering

            Hello ArMi_4729316,


            As you have started with a PSoC 62 2M device which is significantly different from the CY8C6137BZI-F54 device, the errors are expected. ModusToolbox is trying to copy all the Device Configurator settings from the CYCPROTO-062-4343W design.modus file to the new BSP and as there are architectural differences it is unable to apply the same settings which is the reason for the error.


            After getting the error, please open the design.modus file of the new BSP (which you can find here - TARGET_My6137_BSP\COMPONENT_BSP_DESIGN_MODUS\design.modus) using the Device Configurator (C:\Users\<me>\ModusToolbox\tools_2.1\device-configurator)


            This displays the reason for the error as shown -

            Fix all the errors and save the file. You will now be able to change the Target variable in makefile and build your project.


            Please let me know if this works.


            Thanks and Regards,

            Rakshith M B

            • 3. Re: Modus Custom BSP Generate: Incorrect parameter ordering

              This did not work.

              My BSP still has the additional device the CYW4343WKUBG and I cannot figure how to remove it.

              A generate of the launches did work.  A clean did work.

              A make encountered 4 errors:

              Compiling main.c -DCY_USING_HAL -DCY_APPNAME_mtb_example_psoc6_hello_world -DCY8C6137BZI_F54 -DCY_TARGET_DEVICE=CY8C6137BZI_F54 -DTARGET_My6137_BSP_1103 -DCY_TARGET_BOARD=My6137_BSP_1103 -DCOMPONENT_4343W -DCOMPONENT_BSP_DESIGN_MODUS -DCOMPONENT_CM0P_SECURE -DCOMPONENT_CM4 -DCOMPONENT_PSOC6HAL -DCOMPONENT_SOFTFP -DDEBUG  -I. -I./TARGET_My6137_BSP_1103 -I./TARGET_My6137_BSP_1103/COMPONENT_BSP_DESIGN_MODUS -I./TARGET_My6137_BSP_1103/COMPONENT_BSP_DESIGN_MODUS/GeneratedSource -I./libs -I./libs/capsense -I./libs/core-lib -I./libs/core-lib/include -I./libs/psoc6hal -I./libs/psoc6hal/COMPONENT_PSOC6HAL -I./libs/psoc6hal/COMPONENT_PSOC6HAL/include -I./libs/psoc6hal/COMPONENT_PSOC6HAL/include/pin_packages -I./libs/psoc6hal/COMPONENT_PSOC6HAL/include/triggers -I./libs/psoc6hal/include -I./libs/psoc6pdl -I./libs/psoc6pdl/cmsis -I./libs/psoc6pdl/cmsis/include -I./libs/psoc6pdl/devices -I./libs/psoc6pdl/devices/include -I./libs/psoc6pdl/devices/include/ip -I./libs/psoc6pdl/drivers -I./libs/psoc6pdl/drivers/include -I./libs/retarget-io

                  Linking output file mtb-example-psoc6-hello-world.elf

              c:/users/<me>/modustoolbox/tools_2.1/gcc-7.2.1/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: CM0+ flash image overflows with CM4, increase FLASH_CM0P_SIZE

              c:/users/<me>/modustoolbox/tools_2.1/gcc-7.2.1/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: section .text LMA [10002000,1000c40b] overlaps section .cy_m0p_image LMA [10000000,10007f23]

              collect2.exe: error: ld returned 1 exit status

              make[1]: *** [libs/psoc6make/make/core/build.mk:528: C:/cygwin64/home/<me>/workspaces/modus/Hello_World_1103/build/My6137_BSP_1103/Debug/mtb-example-psoc6-hello-world.elf] Error 1

              make: *** [libs/psoc6make/make/core/main.mk:414: secondstage_build] Error 2

              "C:/Users/<me>/ModusToolbox/tools_2.1/modus-shell/bin/make CY_MAKE_IDE=eclipse CY_IDE_TOOLS_DIR=C:/Users/<me>/ModusToolbox/tools_2.1 -j12 all" terminated with exit code 2. Build might be incomplete.



              11:49:45 Build Failed. 4 errors, 1 warnings. (took 22s.750ms)

              • 4. Re: Modus Custom BSP Generate: Incorrect parameter ordering

                Hi ArMi_4729316,


                My BSP still has the additional device the CYW4343WKUBG and I cannot figure how to remove it.

                You can disable it using the Device Configurator. Once you open the design.modus file using the Device Configurator, go to File > Change Devices

                Here you can disable the additional device. Save the configuration and build the application.


                Thanks and Regards,

                Rakshith M B