How to start a project from scratch in ModusToolbox?

  1. Open Modus Toolbox and Create fresh workspace: File – Switch Workspace (if not already in a new workspace)

  2. Create new application: File – New – New ModusToolbox IDE Application

  3. Scroll to the bottom and select: Custom Board, press Next

  4. Find and select CY8C6347BZI-BLD53, next, finish

  5. From one of our examples that can be downloaded here, lets say Hello World, copy the following files and folders: design.modus, cy8c6xx7_cm4_dual.ld, DemoKit (folder), OnethinxCore (folder) and paste them in your CustomApp_mainapp folder of the project you are building from scratch.

  6. Replace the two files: OnethinxCore01.c and OnethinxCore01.h within your project with the latest files found on our GitHub: https://github.com/onethinx/OnethinxCoreAPI

  7. In ModusToolbox, double-click the file design.modus(found in the project explorer on the lefit). A window called Device Configurator will open. Go to: File > Save (yes). Exit the Device Configurator by pressinx X.

  8. In the ModusToolbox (see image below), press Project Build Settings (in the left-bottom corner, under option “Clean”), a window should open which shows: Properties for CustomApp_mainapp (C/C++ Build, Settings, Tool Settings)

  1. please select “Include” under the CNU ARM Cross Assembler, press the “Add…” icon (Icon with paper and green plus), press Workspace button, expand your CustomApp_mainapp folder and select folders DemoKit and OnethinxCore. Press OK and OK. (image above, green lines)

  2. Repeat the step 7., but instead of “Includes” under GNU ARM Cross Assembler, select the “Includes” under GNU ARM Cross C Compiler. (image above, blue lines)

  3. Press the button “Apply and Close”

  1. Press the little down triangle next to the “Debug” icon (as seen on the image above), press Debug Configuration and under GDB OpenOCD Debugging select “CustomApp” Debug (KitProg3).

  2. Under tab main (see image above), in the textbox called C/C++ Application: delete the part “_final”. Press apply

  1. Under tab Debugger (image above), Under Config options copy and paste the following (replacing what was before):

    -s "${cy_tools_path:openocd}/scripts"
    -s "${workspace_loc}/OnethinxCore_00_config/GeneratedSource"
    -c "source [find interface/kitprog3.cfg]"
    -c "transport select swd"
    -c "set ENABLE_CM0 0"
    -c "set ENABLE_ACQUIRE 0"
    -c "source [find target/psoc6.cfg]"
    -c "puts stderr {Started by GNU MCU Eclipse}"
    -c "init; reset init"
    

    Press Apply, press Close

  2. Please copy and paste the following includes (over the existing ones) in your main:

    #include "OnethinxCore01.h"
    #include "DemoKit01.h"
    #include "LoRaWAN_keys.h"
    #include "cy_pdl.h"
    #include "cycfg.h" 
    

if you get a warning (?): Invalid preprocessor directive #include… please revrite the quotation marks " "

  1. Write your code, Save, Clean, Buld, Debug, Enjoy (Follow the latest API reference in our datasheet and on GitHub)
4 Likes

After following the instructions I got this error:

“Unable to evaluate parameter ‘Feedback (22-112)’ on personality ‘PLL’. Undefined identifier “feedbackDiv””
file cycfg_notices.h

[Update] How to start a project from scratch in ModusToolbox 1.1
Reply from Cypress community :
https://community.cypress.com/message/208196#208196

1 Like