Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: CMSIS Solution project: I cannot set an input dependency on an INCBIN binary asset #280

Open
4 of 13 tasks
MK-HTX opened this issue Feb 6, 2025 · 3 comments
Open
4 of 13 tasks
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@MK-HTX
Copy link

MK-HTX commented Feb 6, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

An assembler file that includes an INCBIN directive (e.g. an assembler file in an LPC55S69 CPU0 based project) is not automatically rebuilt if the binary asset included by an INCBIN directive changes (e.g. the binary generated by an LPC55S69 CPU1 based project).

Expected Behavior

The AXF file for a project that contains INCBIN directives is rebuilt when there is a change to any INCBIN referenced binary assets.

Steps To Reproduce

  1. Create a dummy binary asset.
  2. Add an INCBIN directive for the dummy binary asset to a assembler file in a project that builds successfully.
  3. Build the project.
  4. Modify the contents of the binary asset.
  5. Rebuild theproject.

Affected tools

  • cbuild
  • cbuild2cmake
  • cpackget
  • csolution
  • packchk
  • svdconv

Affected operating systems

  • Windows amd64
  • Windows arm64
  • Linux amd64
  • Linux arm64
  • MacOS amd64
  • MacOS arm64

Environment

No response

@MK-HTX MK-HTX added the bug Something isn't working label Feb 6, 2025
@brondani
Copy link
Collaborator

brondani commented Feb 7, 2025

It seems CMake ninja generator does not properly support it:
https://gitlab.kitware.com/cmake/cmake/-/issues/20426

And from the AC6 Migration and Compatibility Guide:

Note
Only dependencies visible to the preprocessor are included. Files added using the GNU assembler syntax .incbin or .include directives, or armasm syntax INCBIN, INCLUDE, or GET directives, are not included.

However regardless of CMake/toolchain's support it's possible to explicitly set dependencies in csolution via executes, for example:

  executes:
    - execute: image_dep
      run: ${CMAKE_COMMAND} -E touch $output$
      input:
        - image.bin
      output:
        - asm.s

@MK-HTX
Copy link
Author

MK-HTX commented Feb 7, 2025

The following works, but having to touch a pack file seems wrong:

  executes:
    - execute: CopyCore1Image
      run: Cmake -E copy ${INPUT_0} ${OUTPUT_0}
      input:
        - $bin()$
      output:
        - $SolutionDir()$/Common/core1_image.bin
    - execute: INCBINCore1Image
      run: ${CMAKE_COMMAND} -E touch $output$
      input:
        - $SolutionDir()$/Common/core1_image.bin
      output:
        - $Pack(NXP::LPC55S69_DFP)$/devices/LPC55S69/utilities/incbin/fsl_incbin.S

@jkrech jkrech changed the title [Bug]: Cannot set an input dpendency on an INCBIN binary asset [Bug]: CMSIS Solution project: I cannot set an input dependency on an INCBIN binary asset Feb 11, 2025
@ReinhardKeil ReinhardKeil added the documentation Improvements or additions to documentation label Feb 11, 2025
@ReinhardKeil ReinhardKeil moved this to In Progress in CMSIS-Toolbox 2.8.0 Feb 12, 2025
@ReinhardKeil ReinhardKeil self-assigned this Feb 12, 2025
@ReinhardKeil
Copy link
Collaborator

Covered in new Troubleshooting chapter.

jkrech added a commit that referenced this issue Feb 18, 2025
…291)

## Fixes
<!-- List the issue(s) this PR resolves -->
- Troubleshooting explains workaround for
#280
- Troubleshooting covers
Open-CMSIS-Pack/devtools#1778

---------

Co-authored-by: Joachim Krech <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
Status: In Progress
Development

No branches or pull requests

3 participants