Where do I enter a "post-build" step (script) when using MCUXpresso for VS Code?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Where do I enter a "post-build" step (script) when using MCUXpresso for VS Code?

Jump to solution
2,133 Views
CktDesigner
Contributor IV

I converted a project from the MCUXpresso IDE to MCUXpresso for VS Code.   I have everything working except for the "post-build" steps...

In MCUXpresso, post-build steps can be specified in Properties->C/C++Build-?Settings->BuildSteps

Where is the equivalent in the VS Code version?

Thanks! 

0 Kudos
Reply
1 Solution
2,112 Views
cristiantepus
NXP Employee
NXP Employee

Hi,

We did not implement this to be automatically done yet. We'll add it in a future release. Till then, you can work around the issue by adding a custom command with post build step (in CMakeLists.txt) like in the example below:

ADD_CUSTOM_COMMAND(TARGET ${MCUX_SDK_PROJECT_NAME} POST_BUILD COMMAND echo ${EXECUTABLE_OUTPUT_PATH}/${MCUX_SDK_PROJECT_NAME})
 

cristiantepus_0-1721725192740.png

Some other example, if you import from SDK a multicore project, core1 is generating a bin from an executable file in a similar post build command:

ADD_CUSTOM_COMMAND(TARGET ${MCUX_SDK_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_OBJCOPY}
-Obinary ${EXECUTABLE_OUTPUT_PATH}/${MCUX_SDK_PROJECT_NAME} ${EXECUTABLE_OUTPUT_PATH}/core1_image.bin)

Regards,

Cristian

View solution in original post

2 Replies
2,053 Views
CktDesigner
Contributor IV

Thanks!!

 

0 Kudos
Reply
2,113 Views
cristiantepus
NXP Employee
NXP Employee

Hi,

We did not implement this to be automatically done yet. We'll add it in a future release. Till then, you can work around the issue by adding a custom command with post build step (in CMakeLists.txt) like in the example below:

ADD_CUSTOM_COMMAND(TARGET ${MCUX_SDK_PROJECT_NAME} POST_BUILD COMMAND echo ${EXECUTABLE_OUTPUT_PATH}/${MCUX_SDK_PROJECT_NAME})
 

cristiantepus_0-1721725192740.png

Some other example, if you import from SDK a multicore project, core1 is generating a bin from an executable file in a similar post build command:

ADD_CUSTOM_COMMAND(TARGET ${MCUX_SDK_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_OBJCOPY}
-Obinary ${EXECUTABLE_OUTPUT_PATH}/${MCUX_SDK_PROJECT_NAME} ${EXECUTABLE_OUTPUT_PATH}/core1_image.bin)

Regards,

Cristian

%3CLINGO-SUB%20id%3D%22lingo-sub-1914477%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EWhere%20do%20I%20enter%20a%20%22post-build%22%20step%20(script)%20when%20using%20MCUXpresso%20for%20VS%20Code%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1914477%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20converted%20a%20project%20from%20the%20MCUXpresso%20IDE%20to%20MCUXpresso%20for%20VS%20Code.%26nbsp%3B%20%26nbsp%3BI%20have%20everything%20working%20except%20for%20the%20%22post-build%22%20steps...%3C%2FP%3E%3CP%3EIn%20MCUXpresso%2C%20post-build%20steps%20can%20be%20specified%20in%20Properties-%26gt%3BC%2FC%2B%2BBuild-%3FSettings-%26gt%3BBuildSteps%3C%2FP%3E%3CP%3EWhere%20is%20the%20equivalent%20in%20the%20VS%20Code%20version%3F%3C%2FP%3E%3CP%3EThanks!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1919962%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Where%20do%20I%20enter%20a%20%22post-build%22%20step%20(script)%20when%20using%20MCUXpresso%20for%20VS%20Code%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1919962%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThanks!!%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1914859%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Where%20do%20I%20enter%20a%20%22post-build%22%20step%20(script)%20when%20using%20MCUXpresso%20for%20VS%20Code%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1914859%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EWe%20did%20not%20implement%20this%20to%20be%20automatically%20done%20yet.%20We'll%20add%20it%20in%20a%20future%20release.%20Till%20then%2C%20you%20can%20work%20around%20the%20issue%20by%20adding%20a%20custom%20command%20with%20post%20build%20step%20(in%20CMakeLists.txt)%20like%20in%20the%20example%20below%3A%3C%2FP%3E%0A%3CDIV%3E%0A%3CDIV%3E%3CSPAN%3EADD_CUSTOM_COMMAND%3C%2FSPAN%3E%3CSPAN%3E(TARGET%20%3C%2FSPAN%3E%3CSPAN%3E%24%7BMCUX_SDK_PROJECT_NAME%7D%3C%2FSPAN%3E%3CSPAN%3E%20POST_BUILD%20%3C%2FSPAN%3E%3CSPAN%3ECOMMAND%3C%2FSPAN%3E%3CSPAN%3E%20echo%20%3C%2FSPAN%3E%3CSPAN%3E%24%7BEXECUTABLE_OUTPUT_PATH%7D%3C%2FSPAN%3E%3CSPAN%3E%2F%3C%2FSPAN%3E%3CSPAN%3E%24%7BMCUX_SDK_PROJECT_NAME%7D%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22cristiantepus_0-1721725192740.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22cristiantepus_0-1721725192740.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F289870iECA06F0D0322727D%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22cristiantepus_0-1721725192740.png%22%20alt%3D%22cristiantepus_0-1721725192740.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ESome%20other%20example%2C%20if%20you%20import%20from%20SDK%20a%20multicore%20project%2C%20core1%20is%20generating%20a%20bin%20from%20an%20executable%20file%20in%20a%20similar%20post%20build%20command%3A%3C%2FP%3E%0A%3CP%3EADD_CUSTOM_COMMAND(TARGET%20%24%7BMCUX_SDK_PROJECT_NAME%7D%20POST_BUILD%20COMMAND%20%24%7BCMAKE_OBJCOPY%7D%3CBR%20%2F%3E-Obinary%20%24%7BEXECUTABLE_OUTPUT_PATH%7D%2F%24%7BMCUX_SDK_PROJECT_NAME%7D%20%24%7BEXECUTABLE_OUTPUT_PATH%7D%2Fcore1_image.bin)%3C%2FP%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3ECristian%3C%2FP%3E%3C%2FLINGO-BODY%3E