Hey ModusToolbox users. This blog post is a follow-up to the post I recently made showing a WiFi Scanner using the Mbed->ModusToolbox flow. While that was meant as an introduction, this post will actually be a lot shorter. Basically, all I’ll cover here is how to use an example from the Cypress GitHub code example repository instead of Mbed’s.
I will be using the PSoC 6 Wi-Fi BT prototyping kit (CY8CPROTO-062-4343W). But, you can also use the CY8CKIT-062-BLE or the CY8CKIT-062-WiFi-BT. You can use any Cypress kit supported in Mbed that has a CapSense slider on the board.
OK, I am going to assume you have already gone through that first blog post and have your ModusToolbox and Mbed environment all set up. The first thing we need to do is go get the code example. You can do that in a couple of ways.
1. Go directly to the GitHub location for ModusToolbox examples, which is here
https://github.com/cypresssemiconductorco/Code-Examples-for-ModusToolbox-Software
2. From the ModusToolbox IDE Quick Panel, select “Search Online for Code Examples” like this
Either way, you’ll end up at this location. Focus on the area labeled “Mbed OS Examples”.
I want the Mbed OS and CapSense example so I’ll click on that. There are actually instructions on running this example right on that GitHub page, but I’ll repeat most of them here so you are not jumping back and forth.
3. Open up a Git Bash shell first (you can use a Cygwin terminal or a Windows cmd window, the instructions for setting up your environment will vary slightly).
4. Import the code example like this
mbed import https://github.com/cypresssemiconductorco/mbed-os-example-capsense
Depending network traffic, it may take a minute or two to copy the example over (it’s almost a Gb on disk).
5. Go to the example folder
cd mbed-os-example-capsense
6. Plug in your kit and ensure the kit is in DAPLink mode. See my earlier blog post or the Switch Kit to DAPLink Mode section in chapter 3 of the ModusToolbox IDE User Guide if you need more information on this. For my kit, I press and hold SW3 for > 2 seconds.
7. Compile the example and program the board with the following command
mbed compile --target CY8CPROTO_062_4343W --toolchain GCC_ARM --flash --sterm
For other targets:
mbed compile -m CY8CKIT_062_WIFI_BT -t GCC_ARM -f –sterm
mbed compile -m CY8CKIT_062_BLE -t GCC_ARM -f --sterm
Note: -f is equivalent to –flash, -t is equivalent to --toolchain
OK, what is that –sterm option? In my other examples I have used PuTTY or TeraTerm (you can still use those if you want).
The --sterm option opens a serial terminal set to 9600-8N1 on your the command window after programming completes. Obviously, leave this option out if you wish to connect using another serial terminal application.
8. After the kit is programmed and the program starts, you will see this message in your terminal window that looks something like this.
+++++++++++++++++++ Application has started. Touch any CapSense button or slider.
9. Touch the buttons and the slider to observe the red LED changing its state and to see the status of the various CapSense sensors printed in the terminal. The messages in the terminal will look something like this.
10. You can also monitor the CapSense data using the CapSense Tuner application as described on the GitHub site or in this blog post.
That’s it for this post. Hit me up in the comments if you have questions.
--Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We use cookies and similar technologies (also from third parties) to collect your device and browser information for a better understanding on how you use our online offerings. This enables us to optimize and personalize your experience with Infineon and to provide you with additional services and information based on your individual profile. Details are available in our privacy policy where you can also change your preferences on cookies at any time.
By technically required cookies we mean cookies without those the technical provision of the online service cannot be ensured. These include e.g. cookies supporting essential services like a smooth reproduction of video or audio footage. So called ‘functional cookies’ are also assigned belonging to this category. Functional cookies store information in order to provide you comfortable use of our online services (e.g. language selection). The legal basis for the processing of personal data by means of cookies of this category is Infineon’s legitimate interest. This includes, among other things, the interest in having a professional external presentation as well as an optimal balancing of the loads on the server due to technical reasons.
By performance and marketing cookies we mean cookies which are technically not required. We use performance and marketing cookies only if you have given us your prior consent. With such cookies, we collect information about how users interact with our website and which pages have been visited. This helps us to understand user activity on our website on an aggregated as well as on a personal level to provide you relevant content and services.