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:
This "Post" build executes before the generation of the needed Srecords file. Thus causing the srec_cat executable too fail.
Could I get a work-around for this? Can I "Invoke" my own executable like Objcopy is invoked?
Solved! Go to Solution.
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
Found a workaround by abusing the "Print Size" feature:
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
Hello @jiri_kral,
After migrating to S32DS 3.4 the bug is still not fixed. The Tool Chain Editor displays the following error:
This is a new project, nothing changed.
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
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.
It's too bad the S32DS doesn't support the S32K microcontrollers. When will S32K DS for Arm be updated?