MCU Tester, a Swiss Army Knife for PSoC (CY8CKIT-062-BLE version, CY8CKIT-062-WiFi-BT version added)

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

cross mob
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

I planned this program to show the minimum usage of the basic components of PSoC

and to help testing a new board or peripheral when application is yet to be written.

 

このプログラムは PSoC を初めて使用する方に基本的なコンポーネントの使い方をお見せするとともに

新しく作った基板や周辺をアプリケーションが出来る前に試せるようにと考えて作ってみました。

 

More than a couple weeks has passed since I posted CY8CKIT-044 version of this program.

And what I learned during this period is that PSoC 6 is different from PSoC 4!

Anyway, here is the first PSoC 6 version of this program.

 

このプログラムの CY8CKIT-044 版を投稿してから、既に2週間以上が経ってしまいました。

その間で学んだことは、PSoC 6 は PSoC 4 とは違う!という事でした。

何はともあれ、このプログラムの PSoC 6 用の初版です。

IMG_4270.JPG

 

When you build and program or debug, you will see something like below.

Basically the same help message is displayed.

Except the last one and the prompt.

 

プロジェクトをビルドして書込むかデバッグを開始すると下記のような表示になります。

基本的に前回のものと同じです、

最後の命令とプロンプトを除いては。

000-cm0-startup-teraterm-log.JPG

 

Assuming that the E-Ink Shield is mounted on your CY8CKIT-062-BLE.

Enter "i2c" at the prompt.

Now prompt changes to "CM0P:i2c>"

Enter "scan" to scan the I2C bus... it finds a device at 0x68, which is the BMI160 on the E-Ink Shield.

We can read its ID from the register address 0.

So enter "readreg 0", then expected ID of D1 is returned.

 

CY8CKIT-062-BLE に付いてくる E-Ink シールドを接続した状態で

プロンプトに "i2c" と入力します。

するとプロンプトは "CM0P:i2c>" にかわります。

更に "scan" と入力すると I2C バス上にあるデバイスを探し始め... 0x68 にデバイスがあることが分かります、

これは E-Ink シールドに乗っている BMI160 センサーです。

このセンサはレジスタアドレス 0 を読むと ID を返すことになっています。

そこで "readreg 0" と入力すると、予定通り ID の  D1 が返されました。

010-i2c-cm0.JPG

 

Now let's try the catch of the day!

Either push "reset" key or Enter "return" to return to the "CM0P:>" prompt.

Then enter "cm4" to switch the core to the CorTex-M4.

The splash says that it is "MCU Tester (CM4)..." and the last command is now "cm0".

Here we can use all commands in the previous mode, except "cm4".

For example, if you enter "i2c" same set of commands are available.

 

それでは今回の目玉を実験しましょう!

基板の RST ボタンを押すか、"return" コマンドを入力して "CM0P:>" プロンプトに戻ってください。

そこで "cm4" と入力すると、使用コアが CorTex-M4 に変わります。

オープニングメッセージも "MCU Tester (CM4) ..." となってコマンドリストの最後は  cm0 に変わっています。

ここで cm0 の時に使えたコマンドは cm4 を除き全て同様に使用できます。

例えば ”i2c" と入力すると I2C モードで使用できた全てのコマンドがここでも使えます。

011-i2c-cm4.JPG

 

To return the root prompt, enter "return".

Then enter "mem" to test the Memory Mode.

According to the TRM of PSoC 6/62 SRAM seems to be starting from 0x08000000.

So please enter "dump 0x08000000" to see what in the memory now.

 

トップレベルのプロンプトに戻るには、"return" を入力します。

次にメモリーモードを試したいので、"mem" と入力してください。

PSoC 6/62 の TRM によると、SRAM は 0x08000000 から始まっているようなので

"dump 0x08000000" と入力して、今、メモリーの中に何が入っているのか見てください。

020-mem-cm4.JPG

 

Enter "return" to go back to the root prompt.

Then enter "cm0" to switch the core to CorTex-M0+.

Now we are home.

 

再度、トップレベルのプロンプトに戻るのに "return" と入力してください。

その後、"cm0" と入力すると CorTex-M0+ のコアに戻ることができます。

ただいま!

030-return-cm0.JPG

 

To explain all the commands will take some time and energy, so let me cheat by saying that...

For other commands, please refer to the page of the previous version below.

 

コマンド全ての説明はかなり長くなってしまいますので、各コマンドについては

先のヴァージョンの説明がある以下の URL をご参照ください。

 

MCU Tester, a Swiss Army Knife for PSoC (CY8CKIT-044 version)

 

moto

27-May-2020 First introduction lines were added

28-May-2020 Sensor name corrected to BMI160

28-May-2020 There were source/header for spi and i2c missing with the first attachment. Attached file was replace with 200528A version.

2-Feb-2021 A version for CY8CKIT-062-WiFi-BT was added.

15-Feb-2021 A version for CY8CPROTO-063-BLE was added.

10 Replies
Kenshow
Level 8
Level 8
Distributor - Marubun (Japan)
50 solutions authored 25 solutions authored 10 solutions authored

Hi Motoo-san,

Thanks for the great example code.

I have a question about it. What version of PDL are you using?

I want to confirm the operation on PSoC Creator4.3 before porting into MTB.2.1

Regards,

Kenshow

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear Kenshow-san,

Thank you for asking!
Since I downloaded 3.1.2 not a once and I "thought" I installed it (not a once),

I've been believing that I had and used 3.1.2, but when I checked the PDL version

in my PSoC Creator's Build Settings...

to my surprise, my PSoC Creator is using 3.1.0!

031-PDL_version.JPG

So I opened the PDL folder, and found that 3.1.2 was not installed!

032-PDL-Folder.JPG

Then I installed 3.1.2 and now my system has 3.1.2

033-PDL_folder2.JPG

But for the answer to your question, the sample attached in the first post is using the PDL 3.1.0.

28-May-2020

moto

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

On 28-May-2020, one of my colleagues informed me that there were folders for spi and i2c missing.

So I replaced the attachment with 200528A version.

With 200528A version, there are some updates.

(1)  loop and interval to i2c, just like the 5LP version.

(2) PDL used is now PDL 3.1.2 (Although I don't know if it affects the project).

28-May-2020

moto

0 Likes
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I added schematic page enable/disable support.

Except tty, each schematic page can be enabled/disabled before compiling the project.

tty 以外の回路図ページを個別にenable / disable 出来るようになりました。

テストしたいコンポーネント以外のページを disable することで、必要なコンポーネントだけのテストが可能になりました。

Please refer to the description in the following sample.

使用方法は下記のサンプルページをご参照ください。

PSoC Creator Schematic Page Enable/Disable Sample

moto

0 Likes
CY_MD
Level 1
Level 1
First reply posted Welcome!

Moto, 
Is there a Version of this  MCU Tester, a Swiss Army Knife for PSoC - PSOC6 in Modus Toolbox?
I thought i once saw it on the forum , but just looked and could not find it.
if it is can you please point me to thread or attach.
-Thanks
Mike

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear Mike-san,

I'm sorry for this slow response.

And I'm even more sorry that there is no Modus Toolbox version of this sample, so far.

Yes, I want to implement it in Modus Toolbox, too.

Probably, I need to study Modus Toolbox more, though.

Anyway, thank you very much for asking.

Best Regards,

2-Feb-2021

Motoo Tanaka

0 Likes
lock attach
Attachments are accessible only for community members.

Hello!

This is a fun application! I have attached a port to ModusToolbox 3.2 that supports these kits:

  1. CY8CKIT-062-WIFI-BT
  2. CY8CKIT-062-BLE
  3. CY8CPROTO-063-BLE

Download and unzip the ModusToolbox_mcu_test zip file and follow these instructions to create the application in ModusToolbox™.

  1. Run Project Creator (either stand-alone or by using the New Application link inside the Eclipse® IDE for ModusToolbox™).
  2. On the Choose Board Support Package page, select the kit that you want to use from the list above.
  3. Click Next.
  4. On the Select Application page, click Browse for Application…
  5. Browse to the location with the unzipped application template (mcu_test) and click Select Folder.
  6. Check the box next to the application in the Import category.
  7. Optional: Change the application name and/or the BSP name if desired.
  8. Click OK.
  9. Click Create.

Here are the steps that were taken to port the application from PSoC™ Creator

  1. Created the mcu_test application from the Dual-CPU_Empty_PSoC6_App Code Example for the chosen BSP.
  2. Increased the CM0+ flash size from 0x4400 to 0xA000. Increased CM0+ RAM size from 0x2000 to 0x4000. This required changes to both linker scripts and Makefile for the CM0+
  3. Updated pins/peripherals/clocks in Device Configurator to match the PSoC™ Creator schematic and design-wide resources.
    1. Note that the UART needs the API Mode set to Low Level to be able to specify an interrupt for Rx FIFO not empty.
  4. Copied the “sources” directory to the mcu_test folder.
    1. I flattened the hierarchy, but it isn’t necessary.
  5. Added ../sources to the SEARCH variable in the Makefile for both CM0+ and CM4.

SEARCH+= ../sources

  1. Created a file called project.h in sources that includes cybsp.h, cycfg.h, PDL and HAL.
  2. Copied main_cm0p.c and main_cm4.c from the PSoC™ Creator project into the CM0+ and CM4 projects. I renamed both to  main.c but it isn't necessary.
  3. Called cybsp_init() in the init_hardware() function in main.c for both the CM0+ and CM4.
    1. Updated the tty functions to use #define for COMPONENT_CM0P and COMPONENT_CM4 rather than a variable. It will not compile in ModusToolbox™ using the variable.
  4. Replaced PSoC™ Creator API functions with the equivalent PDL.
    1. For example, UART_Start() becomes Cy_SCB_UART_Init() and Cy_SCB_UART_Enable().
  5. Updated UART ISR to use the Cy_SCB_GetInterruptCause() and Cy_SCB_ClearRxInterrupt() functions instead of hard-coded bit-mask values.
  6. Fixed code to set up the UART interrupt on the CM0P.
  7. Fixed warnings in mem_utils.c and tty_utils.c.

I had a lot of fun porting this application. Thank you for posting the original!

Mark.

 

MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear Mark-san,

 

Thank you very much!

A great achievement! I could not have done it!

 

Would you upload the MTB version to the github, too?

So that others will be able to easily use it.

 

Meantime, I definitely want to learn the porting steps.

(Oops, I have not been able to download v3.2, yet, though)

 

Best Regards,
6-Apr-2024
Motoo Tanaka

0 Likes

Hello!

I am afraid I cannot post to the Infineon github site. Using the zip file should be easy though.

Mark.

 

0 Likes
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

Recently I had a chance to write some program on CY8CKIT-062-WiFi-BT.

So this morning, I decided that it is the time to port this sample onto CY8CKIT-062-WiFi-BT!

I copied the project and changed the target device...

when I checked the pins, no pin needed to be changed...

After all, I could run this project without modifying a line of code,

except changing the target device.

CY8CKIT-062-BLE and CY8CKIT-062-WiFi-BT were quite compatible, Good Job Cypress!

Anyway, attached is the version for CY8CKIT-062-WiFi-BT.

moto

0 Likes