Community Translation - Set Stack and Heap Size for PSoC 6 MCU Devices – KBA225135

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 KBA225135 into Japanese.

moto

Original KBA: KBA225135

Set Stack and Heap Size for PSoC 6 MCU Devices – KBA225135

Translated by: MoTa_728816

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

タイトル: PSoC 6 MCU デバイスのスタックとヒープサイズの設定 - KBA225135

質問:

PSoC® 6 MCU デバイスでスタックとヒープのサイズを設定するのにはどうしたら良いですか?

回答:

PSoC 6 MCU デバイスのスタック/ヒープのサイズを変更するのには下記の2種類の方法をどちらかをご使用ください。

方法 1:

PSoC Creator™ でコンパイラ設定にヒープとスタックサイズのマクロを追加します。(Project > Build settings > CM0+ 又は CM4 > Compiler) 例えば、図1 のように、General Compiler settings の下の Preprocessor definitions で、スタックサイズを400バイトに設定する場合には __STACK_SIZE=400 と定義します、ヒープサイズを 400 バイトに設定する場合には __HEAP_SIZE=400 と定義します。 この設定はコア毎、ツールチェーン毎、そして "Release" と "Debug" のコンフィグレーション毎に行う必要があることにご注意ください。

図 1. PSoC Creator でヒープとスタックサイズを変更する

001-pastedImage_8.png

ModusToolbox では、アプリケーションプロジェクト (CM4 には _mainapp, CM0+ には _mainapp_cm0p) を選択して、Project > Properties > C/C++ Build > Settings > GNU ARM Cross Assembler へ移動します。図2 のように Preprocessor の下の Defined symbolsスタックサイズを400バイトに設定する場合には __STACK_SIZE=400 と定義します、ヒープサイズを 400 バイトに設定する場合には __HEAP_SIZE=400 と定義します。

図 2. ModusToolbox でヒープとスタックサイズを変更する。

002-pastedImage_4.png

方法 2:

CM4 と CM0+ の両方をソースフォルダ内で スタートアップファイルを見つけます。例えば PSoC Creator では startup_psoc63_xxx.s/S, ModusToolbox では startup_psoc6_0x_xxx.s/S というファイル名になります。スタートアップファイルは各ツールチェーンに専用のものとなります。ファイル内で、Heap_Size と Stack_Size の定義を見つけて、それらの値を必要に応じて変更してください。IAR Embedded Workbench ではヒープ/スタックサイズはリンカファイル (.lcf) 内で __ICFEDIT_size_cstack__ と __ICFEDIT_size_heap__ と定義されていることにご注意ください。

Cypress は変更には、ファイルを編集する後者 (方法 2) よりも、プリプロセッサ設定を使用する前者 (方法 1) を推奨します、こちらの方法の方が簡潔でソースの変更があった場合なども長期的にみて保守が容易になります。

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

13-Apr-2020

moto

2 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
0 Likes
JennaJo
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

PSoC 6 MCU デバイスのスタックとヒープサイズの設定 - KBA225135 - Community Translated (JA)

Dear, Tanaka-san

Your translation has been released.

Sorry for the delayed response.

You will receive the point as a token of appreciation.

Thank you for your continuous contribution to Community !

Regards,

Jenna Jo

Jenna Jo
0 Likes