Why does code become twice as large in mcuxpresso

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Why does code become twice as large in mcuxpresso

ソリューションへジャンプ
1,982件の閲覧回数
Kratz
Contributor IV

I am converting a working bare metal project from IAR kickstarter to MCUXpresso to take advantage of the unlimited code size.  Without making any changes to the program other than using the macros provided the code doubled in size. When contrasting at the IAR and MCUXpresso .map files I noticed the lines on IAR are 16 bits wide and 32 bits wide in Xpresso.  The instruction size becomes just more than twice as large.  What setting needs to be changed in Xpresso?

name                              location & width    instruct size  (IAR)

get_key_status               0x1a59                 0x66             Code  Gb  io.o [1]

name                           location & width    instruct size  (Xpresso)

.text.get_key_status  0x00000728            0xe8             ./source/io.o   0x00000728  get_key_status 

0 件の賞賛
返信
1 解決策
1,897件の閲覧回数
converse
Senior Contributor V

1. It looks like you have built MCUXpresso with debug and no optimisation. This greatly affects the code size. By default, MCUXpresso provides two type of build: Debug and Release. Debug builds with all debug information and no/minimal optimisation to aid debugging. Release builds include optimisation - but you can change the optimisation level to suit you needs (speed vs size) - see this FAQ for more information

https://community.nxp.com/thread/388981 

2. I don't know where you got instruction size from. All Cortex-M parts (M0, M1, M3, M4, M33, M7 etc) are Thumb processors which use 16-bit instruction width. MCUXpresso builds the correct instructions

元の投稿で解決策を見る

2 返答(返信)
1,897件の閲覧回数
Kratz
Contributor IV

You are correct that the optimization was the issue. The code size reduced from 37K down to 28.5K. Thank you!!!

0 件の賞賛
返信
1,898件の閲覧回数
converse
Senior Contributor V

1. It looks like you have built MCUXpresso with debug and no optimisation. This greatly affects the code size. By default, MCUXpresso provides two type of build: Debug and Release. Debug builds with all debug information and no/minimal optimisation to aid debugging. Release builds include optimisation - but you can change the optimisation level to suit you needs (speed vs size) - see this FAQ for more information

https://community.nxp.com/thread/388981 

2. I don't know where you got instruction size from. All Cortex-M parts (M0, M1, M3, M4, M33, M7 etc) are Thumb processors which use 16-bit instruction width. MCUXpresso builds the correct instructions