Can Modus export generated code as CMSIS pack?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
xubo_2592826
Level 2
Level 2
5 replies posted 5 questions asked First question asked

Hi,

PSoc creator can export generated code as CMSIS pack,

and this pack can be used BY KEIL,

so I want to confirm whether Modus can export generated code as CMSIS pack too?

would you like to tell me method if it can support.

Best Regards,

0 Likes
1 Solution
JamesT_21
Moderator
Moderator
Moderator
10 solutions authored 5 solutions authored First solution authored

A bit more info. I'm actually writing an app note on how to use generated code in IAR and Keil tools. This is actually simpler than the CMSIS PACK export process.

The configurators put all the generated code into the GeneratedSource folder, which is right beside the design.modus file. Add the source code to your Keil projects, and adjust your include paths to find the header files. It really is that simple.

The devil is in the details. The app note will have chapter and verse, but here are the big things I've learned. For Keil tools, you may encounter a couple of non-obvious setup issues.

  1. For Keil tools a one-time setup step is required to enable support for PSoC 6 devices and debug probes. If you have already used Keil tools (I assume you have) then you've done this and don't need to do it again. If you want to double check, look to see if this path exists in your Keil installation: C:\Keil_v5\ARM\PACK\Cypress\Probes Support\1.0.0. If that's present you are good to go. If it is not, you should install the support pack.  You can get it by separately installing PDL v3.1.

    ModusToolbox doesn't use PDL 3.1, but that's where the support pack is for now.
    C:\Program Files (x86)\Cypress\PDL\3.1.0\tools\probes

  2. The Keil compiler defaults to type wchar being 16 bits wide. The ModusToolbox libraries require 32 bits. When working with your own projects to build an application, all projects much use the -wchar32 directive. You can set this in the C/C++ settings panel in the Keil tools, look near the bottom for "Misc Controls" and specify -wchar32 there.

In terms of adding files, If you use middleware, you need to manually add the middleware files (and paths) to the project. For some libraries, there are Keil-specific precompiled binaries for some library functionality. Example, for CapSense, you add the cy_capsense_gcc_cm4f.a library. And, of course, there is one more gotcha hiding here. The Keil tools assume that .a  is an assembly file. It is not. In the Keil project explorer, right click the file, choose Options, and identify the file as a library file. Otherwise the build will fail when it tries to use the assembler on the file.

Those are the biggies I have run across so far. I'm still exploring.

View solution in original post

2 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

Presently, there is no Export to 3rd Party feature (as it is there in PSoC Creator)  in Modus.

You can check this KBA for exploring features available in Modus :

Eclipse IDE Survival Guide – KBA225399 *D

JamesT_21
Moderator
Moderator
Moderator
10 solutions authored 5 solutions authored First solution authored

A bit more info. I'm actually writing an app note on how to use generated code in IAR and Keil tools. This is actually simpler than the CMSIS PACK export process.

The configurators put all the generated code into the GeneratedSource folder, which is right beside the design.modus file. Add the source code to your Keil projects, and adjust your include paths to find the header files. It really is that simple.

The devil is in the details. The app note will have chapter and verse, but here are the big things I've learned. For Keil tools, you may encounter a couple of non-obvious setup issues.

  1. For Keil tools a one-time setup step is required to enable support for PSoC 6 devices and debug probes. If you have already used Keil tools (I assume you have) then you've done this and don't need to do it again. If you want to double check, look to see if this path exists in your Keil installation: C:\Keil_v5\ARM\PACK\Cypress\Probes Support\1.0.0. If that's present you are good to go. If it is not, you should install the support pack.  You can get it by separately installing PDL v3.1.

    ModusToolbox doesn't use PDL 3.1, but that's where the support pack is for now.
    C:\Program Files (x86)\Cypress\PDL\3.1.0\tools\probes

  2. The Keil compiler defaults to type wchar being 16 bits wide. The ModusToolbox libraries require 32 bits. When working with your own projects to build an application, all projects much use the -wchar32 directive. You can set this in the C/C++ settings panel in the Keil tools, look near the bottom for "Misc Controls" and specify -wchar32 there.

In terms of adding files, If you use middleware, you need to manually add the middleware files (and paths) to the project. For some libraries, there are Keil-specific precompiled binaries for some library functionality. Example, for CapSense, you add the cy_capsense_gcc_cm4f.a library. And, of course, there is one more gotcha hiding here. The Keil tools assume that .a  is an assembly file. It is not. In the Keil project explorer, right click the file, choose Options, and identify the file as a library file. Otherwise the build will fail when it tries to use the assembler on the file.

Those are the biggies I have run across so far. I'm still exploring.