Community Translation - Call Stack Doesn’t Unwind in Call Stack Window when CY_ASSERT() fails with a Third-party Toolchain in PSoC Creator 4.2 in PSoC 6 MCU Devices – KBA229134

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

Hi,

I'd like to translate KBA229134 into Japanese.

moto

Original KBA: KBA229134

Call Stack Doesn’t Unwind in Call Stack Window when CY_ASSERT() fails with a Third-party Toolchain i...

Translated by: MoTa_728816

==============================

タイトル: PSoC 6 MCU デバイスを PSoC Creator 4.2 でサードパーティ製ツールチェーンを使用してデバッグ時に CY_ASSERT() が失敗するとコールスタックウィンドウ内のコールスタックがアンワインドされない - KBA229134

問題:PSoC® Creator™ 4.2 で MDK-ARM ツールチェーンを使用してのデバッグモード時、プログラムが CY_ASSERT() 関数内で失敗すると図1のようにコールスタックウィンドウがコールスタック全体を表示しなくなる (赤枠部分)。

図 1. コールスタックウィンドウ

001-pastedImage_10.png

原因: これは MDK-ARM ツールチェーンのデフォルトの設定に起因します。現在のアプリケーションスタックのアドレスを保持するフレームポインタレジスタは、最も低い最適化レベルでも汎用レジスタ (r11)として使用されます。その為、デバッガは全スタックをアンワインド出来なくなります。

解決策: あるレジスタをフレームポインタとして予約するためには、コマンドラインオプション --use_frame_pointer を使用する必要があります。Thumb-2 テクノロジーをサポートしている最近のプロセッサ (ARMv6T2 およびそれ以降) では予約されるレジスタは常に r11 です。

コンパイラでこのコマンドを設定するのには、図2 に示されるように以下の手順に従ってください:

  1. プロジェクトを右クリックして Build Settings を選択する。
  2. CM4 ARM MDK Generic > Compiler > Command Line を選択する。
  3. Custom Flags フィールドに --use_frame_pointer と入力して OK をクリックする。

図 2. Build Settings の Custom Flags

002-pastedImage_20.png

この処理後には、図3 のようにデバッグ時にコールスタックの全体を見ることが出来るようになります。

図 3. アンワインドできたコールスタック

003-pastedImage_26.png

より詳しい情報と参考資料:

  1. Compiler User Guide の --use_frame_pointer, --no_use_frame_pointer 参照
  2. ARM registers
  3. Arm MCU の Usage of Frame Pointer  参照
  4. PDL 内の CY_ASSERT()

==============================

10-Apr-2020

moto

0 Likes
4 Replies
JennaJo
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello, Tanaka-san

We receive your translation, it will be published to KBA to Community.

After upload, You will receive the points as the word of KBA.

Due to the current volume of works, Please bear with me for the delayed the response,

Thanks for your contribution to CDC!

Will keep you update the status.

Thanks,

Jenna Jo

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

Dear Jenna-san,

One of my colleague has just informed me that the title of the published page is starting from

"SoC 6 MCU" instead of "PSoC 6 MCU".

SoC 6 MCU デバイスを PSoC Creator 4.2 でサードパーティ製ツールチェーンを使用してデバッグ時に CY_ASSERT() が失敗するとコールスタックウィンドウ内のコールスタック...

I'm very sorry that I should have noticed it.

May I ask you for adding "P" at the beginning?

Best Regards,

5-May-2020

Motoo Tanaka

0 Likes
JennaJo
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello, Tanaka-san

Hope you had a good golden holiday.

Yes, The tile will be updated.

thanks for letting me know.

Regards,

Jenna

Jenna Jo
0 Likes