Code size increase following MCUXpresso upgrade

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Code size increase following MCUXpresso upgrade

跳至解决方案
478 次查看
jstark
Contributor II

  I've developed some instrumentation which uses an MK22DX128 and noted a substantial code size increase since MCUXpresso-11.7. This was first experienced with 11.9, and testing today using the most current revision (25.6.3) yields similar results. Reported code and data sizes for the same source base are shown below.

MCUXpresso-11.7.1

Debug

PROGRAM_FLASH: 91812 B 128 KB 70.07%

Release

  PROGRAM_FLASH: 83748 B 128 KB 63.89%


MCUXpresso-25.6.136

Debug

PROGRAM_FLASH: 126084 B 128 KB 96.19%

Release

PROGRAM_FLASH: 117836 B 128 KB 89.90%

  The project was exported from 11.7 and imported without change into 25.6, and as far as I can tell is compiled using the same build parameters. Had I not recently deleted some diagnostics from the source base, the code would exceed available flash storage if compiled using the current revision of MCUXpresso. As it is likely that future updates to the source base will be required,  I am concerned about ongoing support. At present, I have an older machine running Ubuntu-20.04 to host 11.7, however I cannot be assured that it will be available indefinitely.

  Compiler options have been determined to be identical in both build environments and are listed below. Because my application depend upon 64-bit variables (both integer and floating point), Newlib is required.

  I'm hoping that the difference in generated code size is due to some build parameter which I've overlooked. If that may be the case, any assistance in identifying and correcting the discrepancy would be most appreciated.

  - J

Compiler options

-D__USE_CMSIS
-DCR_INTEGER_PRINTF
-DSDK_DEBUGCONSOLE=0
-D__MCUXPRESSO
-DNDEBUG
-DFSL_RTOS_BM
-DSDK_OS_BAREMETAL
-DCPU_MK22DX128VLF5
-DCPU_MK22DX128VLF5_cm4
-D__NEWLIB__
-I"/home/jstark/MCUXpresso/PTR-2/source"
-I"/home/jstark/MCUXpresso/PTR-2"
-I"/home/jstark/MCUXpresso/PTR-2/startup"
-I"/home/jstark/MCUXpresso/PTR-2/CMSIS"
-Os
-fno-common
-g
-gdwarf-4
-Wall
-c
-fmessage-length=0
-fno-builtin
-ffunction-sections
-fdata-sections
-fsingle-precision-constant
-fmacro-prefix-map="$(<D)/"=
-mcpu=cortex-m4
-mthumb
-D__NEWLIB__
-fstack-usage

0 项奖励
回复
1 解答
392 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @jstark 

MCUXpresso IDE v25.06 is based on Arm GNU Toolchain version 14.2.Rel1, while MCUXpresso IDE v11.7 uses GCC 10.x.
The compiler upgrade is significant, which may introduce additional code.
Moreover, the newer Newlib provides more complete support for 64-bit integers and floating-point operations, but it is also more bloated.
Also you should check whether your project includes printf calls to the console, as this can consume a large amount of flash memory.

 

BR

Alice

在原帖中查看解决方案

0 项奖励
回复
1 回复
393 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @jstark 

MCUXpresso IDE v25.06 is based on Arm GNU Toolchain version 14.2.Rel1, while MCUXpresso IDE v11.7 uses GCC 10.x.
The compiler upgrade is significant, which may introduce additional code.
Moreover, the newer Newlib provides more complete support for 64-bit integers and floating-point operations, but it is also more bloated.
Also you should check whether your project includes printf calls to the console, as this can consume a large amount of flash memory.

 

BR

Alice

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2205538%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMCUXpresso%20%E5%8D%87%E7%BA%A7%E5%90%8E%E4%BB%A3%E7%A0%81%E9%87%8F%E5%A2%9E%E5%8A%A0%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2205538%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%20%20%E6%88%91%E5%BC%80%E5%8F%91%E4%BA%86%E4%B8%80%E4%BA%9B%E4%BD%BF%E7%94%A8%20MK22DX128%20%E7%9A%84%E4%BB%AA%E5%99%A8%EF%BC%8C%E5%B9%B6%E6%B3%A8%E6%84%8F%E5%88%B0%E8%87%AA%20MCUXpresso-11.7%20%E4%BB%A5%E6%9D%A5%E4%BB%A3%E7%A0%81%E9%87%8F%E5%A4%A7%E5%B9%85%E5%A2%9E%E5%8A%A0%E3%80%82%E7%AC%AC%E4%B8%80%E6%AC%A1%E5%87%BA%E7%8E%B0%E8%BF%99%E7%A7%8D%E6%83%85%E5%86%B5%E6%98%AF%E5%9C%A8%2011.9%20%E7%89%88%EF%BC%8C%E4%BB%8A%E5%A4%A9%E4%BD%BF%E7%94%A8%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC%EF%BC%8825.6.3%EF%BC%89%E8%BF%9B%E8%A1%8C%E4%BA%86%E6%B5%8B%E8%AF%95%E4%BA%A7%E9%87%8F%E7%B1%BB%E4%BC%BC%E7%9A%84%E7%BB%93%E6%9E%9C%E3%80%82%E5%90%8C%E4%B8%80%E6%BA%90%E7%A0%81%E5%BA%93%E7%9A%84%E6%8A%A5%E5%91%8A%E4%BB%A3%E7%A0%81%E5%92%8C%E6%95%B0%E6%8D%AE%E5%A4%A7%E5%B0%8F%E5%A6%82%E4%B8%8B%E6%89%80%E7%A4%BA%E3%80%82%3C%2FP%3E%3CP%3E%3CSTRONG%3EMCUXpresso-11.7.1%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%E8%B0%83%E8%AF%95%3C%2FP%3E%3CP%3E%E7%A8%8B%E5%BA%8F%E9%97%AA%E5%AD%98%EF%BC%9A%2091812%20B%20128%20KB%2070.07%25%3C%2FP%3E%3CP%3E%E7%89%88%E6%9C%AC%3C%2FP%3E%3CP%3E%20%20%E7%A8%8B%E5%BA%8F%E9%97%AA%E5%AD%98%EF%BC%9A%2083748B%20128KB%2063.89%25%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CSTRONG%3EMCUXpresso-25.6.136%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%E8%B0%83%E8%AF%95%3C%2FP%3E%3CP%3E%E7%A8%8B%E5%BA%8F%E9%97%AA%E5%AD%98%EF%BC%9A%20126084B%20128KB%2096.19%25%3C%2FP%3E%3CP%3E%E7%89%88%E6%9C%AC%3C%2FP%3E%3CP%3E%E7%A8%8B%E5%BA%8F%E9%97%AA%E5%AD%98%EF%BC%9A%20117836B%20128KB%2089.90%25%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9E%9C%E6%83%85%E5%86%B5%E5%B1%9E%E5%AE%9E%EF%BC%8C%E8%AF%B7%E5%8D%8F%E5%8A%A9%E6%9F%A5%E6%98%8E%E5%B9%B6%E7%BA%A0%E6%AD%A3%E5%B7%AE%E5%BC%82%E3%80%82%3C%2FP%3E%3CP%3E%20%20-%20J%3C%2FP%3E%3CP%3E%E7%BC%96%E8%AF%91%E5%99%A8%E9%80%89%E9%A1%B9%3C%2FP%3E%3CP%3E-d__use_cmsis%3CBR%20%2F%3E-dcr_integer_printf%3CBR%20%2F%3E-dsdk_debugconsole%3D0%3CBR%20%2F%3E-d__mcuxpresso%3CBR%20%2F%3E-dndebug%3CBR%20%2F%3E-dfsl_rtos_bm%3CBR%20%2F%3E-dsdk_os_baremetal%3CBR%20%2F%3E-dcpu_mk22dx128vlf5%3CBR%20%2F%3E-%20DCPU_MK22DX128VLF5_cm4%20-D%20%20-I%20%2Fome%2Fjstark%2FMCUXpresso%2FPTR-2%2Fsource%20%20-IDCPU_MK22DX128VLF5_cm4%3CBR%20%2F%3E-D__NEWLIB__%3CBR%20%2F%3E%20-I%22%2Fhome%2Fjstark%2FMCUXpresso%2FPTR-2%2Fsource%22%3CBR%20%2F%3E%20-I%22%2Fhome%2Fjstark%2FMCUXpresso%2FPTR-2%22%3CBR%20%2F%3E%20-I%22%2Fhome%2Fjstark%2FMCUXpresso%2FPTR-2%2Fstartup%22%3CBR%20%2F%3E%20-I%22%2Fhome%2Fjstark%2FMCUXpresso%2FPTR-2%2FCMSIS%22%3CBR%20%2F%3E%20-Os%3CBR%20%2F%3E-fno-common%3CBR%20%2F%3E-g%3CBR%20%2F%3E-gdwarf-4%3CBR%20%2F%3E-Wall%3CBR%20%2F%3E-c%3CBR%20%2F%3E-fmessage-length%3D0%3CBR%20%2F%3E-fno-builtin%3CBR%20%2F%3E-ffunction-sections%3CBR%20%2F%3E-fdata-sections%3CBR%20%2F%3E-fsingle-precision-constant%3CBR%20%2F%3E-fmacro-prefix-map%3D%22%24(%3CD%3E%3C%2FD%3E-mcpu%3Dcortex-m4%3CBR%20%2F%3E-mthumb%3CBR%20%2F%3E-D__NEWLIB__%3CBR%20%2F%3E%20-fstack-usage%3C%2FP%3E%3C%2FLINGO-BODY%3E