Post-build steps triggering too early

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

Post-build steps triggering too early

跳至解决方案
2,704 次查看
roy_vanlierop
Contributor III

I'm trying to fix the failed implementation of generating s-records by adding my own build-step. 

After building the application, the generated .srec file should be automatically aligned by using the srec_cat tool: 

roy_vanlierop_0-1620829864121.png

This "Post" build executes before the generation of the needed Srecords file. Thus causing the srec_cat executable too fail. 

roy_vanlierop_0-1620830355797.png

 

Could I get a work-around for this? Can I "Invoke" my own executable like Objcopy is invoked? 

 

0 项奖励
回复
1 解答
2,686 次查看
jiri_kral
NXP Employee
NXP Employee

Hi,

this is known issue - but I think that it is already fixed in S32DS v3.4. So, the issue is that post build command is called right after .elf file is produced. And other tools (like .srec output and size) is called after post build step. 

As a more clean workaround you can create some .bat file (executed as a postbuild step) which creates .srec file from .elf and you can perform your srec_cat steps on that file. 

 

Jiri

在原帖中查看解决方案

标记 (1)
0 项奖励
回复
6 回复数
2,695 次查看
roy_vanlierop
Contributor III

Found a workaround by abusing the "Print Size" feature: 

roy_vanlierop_0-1620835444674.png

 

0 项奖励
回复
2,687 次查看
jiri_kral
NXP Employee
NXP Employee

Hi,

this is known issue - but I think that it is already fixed in S32DS v3.4. So, the issue is that post build command is called right after .elf file is produced. And other tools (like .srec output and size) is called after post build step. 

As a more clean workaround you can create some .bat file (executed as a postbuild step) which creates .srec file from .elf and you can perform your srec_cat steps on that file. 

 

Jiri

标记 (1)
0 项奖励
回复
2,586 次查看
roy_vanlierop
Contributor III

Hello @jiri_kral,

After migrating to S32DS 3.4 the bug is still not fixed. The Tool Chain Editor displays the following error:

roy_vanlierop_0-1623323416631.png

This is a new project, nothing changed. 

0 项奖励
回复
2,575 次查看
jiri_kral
NXP Employee
NXP Employee

Hi, 

I checked the ticket related to Post build steps - and the resolution is that this is correct behavior. The logic behind is that product of build is .elf file (or .a archive - depends on project type). After that is called user post build step and then are called external tools selected by user -> Print size/Create flash image/Create extended listing.  

 

Anyway - I tried reproduce the error message in toolchain editor - but no success. How did you get this error? 

 

Jiri 

0 项奖励
回复
2,572 次查看
roy_vanlierop
Contributor III

Hello Jiri,

It's too bad that this is desired/intended behavior. For anyone who comes after me and want to modify s-records in the Post-Build step:

${cross_prefix}${cross_objcopy}${cross_suffix} -O srec  ${ProjName}.elf tmp.srec; "${ProjDirPath}/Tools/srec_cat.exe" tmp.srec -fill 0x00 -within tmp.srec -range-padding 256 -address-length=4 -obs=32 -o aligned_${ProjName}.srec;rm tmp.srec

This three step command calls the build-in ObjCopy instance, creates a fresh S-record and modifies it using srec_cat. 

The Tool Conflict error message came from a freshly installed S32DS 3.4 with a fresh new project. The error is visible in all my projects, even older projects. Project -> Properties -> C/C++ Build -> Tool Chain Editor -> Select Tools.

roy_vanlierop_0-1623401943456.png

 

0 项奖励
回复
2,655 次查看
roy_vanlierop
Contributor III

It's too bad the S32DS doesn't support the S32K microcontrollers. When will S32K DS for Arm be updated?

 

0 项奖励
回复