How to use Before/After Build function in CoIDE This article describes how to use Before/After Build function in CoIDE and demonstrates how to use this feature to convert .elf file compiled to .lss file automatically. This article focus on introducing Before/After Build function, so it will not include some of the basic operations (such as new features, check the package) introduced, if you are a beginner, it is recommended to learn CoIDE Getting Start tutorial series first. 1. Create a new project, debugging, compiling successfully, Then we create a project named Guide_UseStaticLib as an example to demonstrate the Before/After Build function. 2. Enter the "Project Configuration" page, switch to the User tab, check the checkbox named After Build. 3. Click the file selection button behind "Run # 1", choose our batch file ELF2LSS.bat, and then click OK. 4. Click Build/Rebuild button, CoIDE will convert the generated .elf file to .lss file calling the .bat file. The whole process is shown below: The focus of special attention: 1. The batch files can be placed in the same level directory CoIDE engineering and can also be placed in another location (But if you want to copy this project to another computer, you need to change the batch path). 2. The column named Run#1 is used to indicate the relative path, the <$ {project.path}> represents the current CoIDE project directory, which is part of the Buildin variables., In the Before/After Build box, type the command is valid, but edit the batch file using Buildin variable is invalid. For more information about Buildin variable, please click "Buildin variables" (figure 5). 3. The CoIDE can’t automatically switch to the command path to the path where the batch file. So we need to switch directories manually. The process is as follows: %~d0 cd %~dp0 4. When the CoIDE calling the batch files, it will output the following information: The ' characters around the executable and arguments are not part of the command. We can ignore this message. [Appendix] The examples of batch source code (The function of the batch file is convert all the. Elf file in the directory where generation to .Lss disassembler file). @echo off rem This file is the script to set path for ARM eabi tool chain. set PATH=%PATH%;C:\Program Files\GNU Tools ARM Embedded\4.7 2013q1\bin %~d0 cd %~dp0 FOR /R %%i IN (*.elf) DO ( IF -S %%~fi > %%~fi.lss) ) EXIST ECHO Congratulations! Work is done #End# %%i (arm-none-eabi-objdump.exe
© Copyright 2024