How to integrate EIV into an existing project
Integration package structure
└── sternum-eiv-integration
├── config
├── lib
├── src
│ ├── include
│ └── ports
│ ├── freertos/...
│ └── rtos
└── tools
Importing the integration package
- Using your IDE, please import all code files in
src/ports/
and insrc/ports/[your-os]
. - Add
/src/include
in your project's include path. - Implement the ports in the
user_ports.c
file. Documentation can be found in the included header files. - Include
sternum_ads_api.h
and callSTERNUM_ADS_BOOT()
earliest as possible, after system initialization.- Please note, in
FreeRTOS/SafeRTOS
,STERNUM_ADS_BOOT()
must be called at the beginning of the first running task - (the OS will not allow using OS resources outside an execution context of a task).
- Please note, in
- Include the relevant static library in
/lib/
to your project.- Please note that in
Keil
, all libraries must have the .lib extension.
- Please note that in
Setting up EIV as a post-build step
Keil v4-v5
- Please go to
Project Options->User->After Build
- Add the following post build command:
../sternum-eiv-integration/tools/EIVRunner --build_env keil --conf_dir "../sternum-eiv-integration/config/" "#P" "#L"
- Set
Stop on Exit condition
to>= 1
.
Eclipse (MCUXpresso v11/Simplicity Studio 5)
- Please go to
Project Properties->C/C++ Build->Settings->Build steps->Post-build steps
- Add the following post build command:
../sternum-eiv-integration/tools/EIVRunner --build_env eclipse --conf_dir "../sternum-eiv-integration/config/" "${ProjName}" "${BuildArtifactFileName}"
IAR 8.x
- Please go to
Project Options->Build Actions->Post-build command line
- Due to IAR 8.x limited post build action information, we offer 2 post build options (Please adjust the path of sternum-eiv-integration if needed):
- The first will write all output to EIV.log in your project's root directory:
cmd.exe /c ""$PROJ_DIR$\sternum-eiv-integration\tools\EIVRunner.exe" --build_env iar --conf "$PROJ_DIR$\sternum-eiv-integration\config" "$TARGET_PATH$" "$LIST_DIR$" "$EW_DIR$" > "$PROJ_DIR$\EIV.log"" 2>&1
- The second will direct all output into a CMD shell. The terminal must be closed when EIV indicates success for the IAR build to complete.
cmd.exe /c start cmd.exe /k ""$PROJ_DIR$\sternum-eiv-integration\tools\EIVRunner.exe" --build_env iar --conf "$PROJ_DIR$\sternum-eiv-integration\config" "$TARGET_PATH$" "$LIST_DIR$" "$EW_DIR$""
Troubleshooting
If you encounter with any errors in EIV, please provide the following information to Sternum:
- EIV terminal output
eiv_post_protect.[bat/sh]
eiv_protect.[bat/sh]
protected_link.[bat/sh]
- Map files