Visual Studio Code setup (advanced users)


#1

Hi,

any news on the Visual Studio Code project?

Tamás


What Integrated Development Environment do I need to use with the Onethinx Core Module?
#2

Hi Tkiraly,

You can check out this video:

Tom


#3

my god way too complicated for visual studio install …

I thought Cypress Modus IDE and Creator programs would be easy to setup your own projects at least - now you tell us that we cannot use them for new projects !


#4

Hi Socie,

I’m sorry to hear the VScode setup is too complicated. VScode is a generic code editor, which is not a PSoC specialized IDE like PSoC Creator or Modus Toolbox is. I agree the one-time setup is not really easy. We will try to make it as easy as possible to setup, although a lot of extensions are needed and have to be configured as well.

The demo project on our download page are for use with Modus Toolbox however and should work out of the box on Modus Toolbox without the need of additional setups.

Initially we started with PSoC Creator as this tool is most easy to use. We learned halfway the development of the module that PSoC Creator is not able to support our secure setup as implemented in our module. This means PSoC Creator would not be able to debug code on our module, which we see as mandatory.

As the only other option was to use Modus Toolbox we realized this IDE would not satisfy everyone’s needs and so we set up an alternative using VScode.

It’s up to you if you want to use VScode or Modus Toolbox. I’ll advise to use the latter is you don’t want to do all the setup.

Please let us know wether you run into problems using Modus Toolbox and we’re happy to assist you further.

Regards,
Rolf


#5

Hi Rolf,

Thanks for this update.
I guess I will start with the basics and tell you what I need for Lora development particularly as I am not proficient in coding ;

  • your Lora module looks good with interesting new features ahead of the competition.
    I received your dev kit and appreciate this. I have yet to download your sample programs or setup Modus IDE.

  • what attracted me initially to your module was IDE Creator as I thought that I could add peripheral blocks and tie them together in code flows - something like Node Red.
    Also, later I could add a Lora block and edit it accordingly. Even a Lora API that could be imported and plugged into the code flow would be ok for now. That was my ideal setup.

  • now you seem to be saying something different in that we cannot use IDE Creator and have to use Modus IDE instead or the more awkward Visual Studio program.
    Please correct me if I am wrong but is my ideal setup above still possible someway ?

  • For example, can I use IDE Creator to configure PSOC peripherals in a code flow and then export the compiled code to Modus IDE ?

  • In Modus, can I then add your Lora API to existing sample code and imported Creator code, edit and debug it and finally program your module ?

Best Rgds, Sean.


#6

Hi Sean,

I fully understand the way you would like to setup your application and code. We had envisioned this flow (using only PSoC Creator) as well when we started developing our module.

We succeeded in writing the stack in such a way that you’re able to fully use LoRaWAN with the use of only 3 API calls.

Unfortunately we are not in control of the tools needed to program PSoC controllers and when we started development we never heard of ModusToolbox. We didn’t expect that Creator was unable to support debugging the M4 while having the secure image implemented.

Your suggestion to generate source with PSoC Creator sounds very nice although moving this generated code to ModusToolbox is not a process that’s straightforward at the moment.

If you’re okay with using PSoC Creator without the option to do debugging, we are able to supply you with a programming tool that we made initially to program our module.

If you like to develop your code with PSoC Creator and do debugging with another tool then there’s currently a solution to accomplish this. It’s possible to set up VScode in such a way that you could develop your code with PSoC Creator and then do debugging with VScode on the same directory as PSoC Creator is using. This would require a lot of effort though to set this up correctly.

If you are able to share your PSoC Creator application we’re able to help you with your further development.

Thanks,
Rolf


#7

Hi Rolf,
Maybe Cypress can do something here as it sounds awkward for debugging.
I have 2 Lora projects coming up and would love to use your module.
The applications are simple enough and I am a bit concerned that we will have trouble with coding them.
Do you think that in time that you will have an easier way to do the debugging ?
I welcome your suggestion that we send to you our app Creator files and maybe that is the way to go initially,


#8

Did you try to use ModusToolbox yet?

The provided examples for Modus are really easy to use and are working out of the box on ModusToolbox. We only showed VScode as another alternative (which needs some effort to set up).

So I suggest to start with ModusToolbox, as this is the official tool for PSoC6 as well.

For ModusToolbox questions, go here.


#9

Ok Rolf, I will try Modus toolbox.
I need to get programmer as well.

Can I paste code from Creator into Modus ?


#10

Hi Sean,

This is the programmer we use: CY8CKIT-147

You’re able to put code from Creator into Modus, as long as all referenced sources are included. Please send me a message if you need any assistance.


#11

hi,

did anyone migrate this guide from windows to linux (ubuntu)?


#12

I was able to get the VScode setup working on Arch Linux.

First of all I installed Modustoolbox, it’s in the Arch User Repository: https://aur.archlinux.org/packages/modustoolbox/

Then I installed VScode, can also be found in the Arch User Repository: https://aur.archlinux.org/packages/visual-studio-code-bin/

Then I installed the following packages: arm-none-eabi-gcc, arm-none-eabi-gdb, cmake

Then I installed the plugins for VScode:

  • ARM Support For Visual Studio Code dan-c-underwood
  • C/C++ IntelliSense, debugging microsoft
  • CMake language support twxs
  • CMake Tools vector-of-bool
  • Cortex-Debug GDB support marus25
  • LinkerScript support for GNU Zixuan Wang
  • Open in Application Fabio Spampinato
  • Output Colorizer IBM

Then I cloned the GetStartedWithVSCode repo.

Then I made the following changes in a number of files:
(Assuming Modustoolbox is installed in /opt/modustoolbox)

  • In CMakeLists.txt:
    set(CY_MODUS_DIR C:/ModusToolbox_1.0) to set(CY_MODUS_DIR /opt/modustoolbox)

  • In launch.json:
    "searchDir": [ "C:/ModusToolbox_1.0/tools/openocd-1.0/scripts" ] to "searchDir": [ "/opt/modustoolbox/tools/openocd-1.0/scripts"]

  • in ~/.config/Code/User/settings.json:

    "openInApplication.applications": { "PSocConfig": "/opt/modustoolbox/tools/device-configurator-1.0/device-configurator"},
    "cortex-debug.openocdPath": "/opt/modustoolbox/tools/openocd-1.0/bin/openocd",
    "cmake.cmakePath": "/usr/bin/cmake",

Then you can choose clean configure in cmake menu and then compile and debug.