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: .S assembly files not being compiled #181

Open
Maobuff opened this issue Apr 16, 2024 · 4 comments
Open

BUG: .S assembly files not being compiled #181

Maobuff opened this issue Apr 16, 2024 · 4 comments

Comments

@Maobuff
Copy link

Maobuff commented Apr 16, 2024

Platform: Windows 10/Linux
stm32-for-vscode v3.2.6
Way to reproduce:

  1. Create a project with STM32U595ZJT6
  2. Enable threadx in Middleware
  3. Try to build project.
  4. *** No rule to make target 'build/tx_initialize_low_level.o', needed by 'build/xxx.elf'. Stop.

Output of make -f STM32Make.make -qp

....
# makefile (from 'STM32Make.make', line 600)
ASM_SOURCES = Core/Src/tx_initialize_low_level.S startup_stm32u595xx.s
....
# Not a target:
build/tx_initialize_low_level.o:
#  Implicit rule search has not been done.
#  Modification time never checked.
#  File has not been updated.
....
build/xxx.elf: .... tx_intialize_low_level.o ....
....

The original makefile from CubeMX has ASMM_SOURCES which stm32-for-vscode is completely ignoring.

@jortbmd
Copy link
Member

jortbmd commented Apr 24, 2024

Hi. Thanks for opening up an issue. That is an interesting one. I have been trying to compile threadx for a hobby project a while ago and ran into similar issues. Can't promise I will have a fix very soon, however will put it on top of my list. If you have any idea of a quick fix in mind I would be happy to hear it.

@Maobuff
Copy link
Author

Maobuff commented Apr 26, 2024

Splitting assembly code and assembly language files is a good idea (.s and .S). Like the original Makefile from STM32CubeMX: ASM_SOURCES are used for .s and ASMM_SOURCES are used for .S. Main issue right now is that threadx uses a lot of .S files from the threadx library.

I will do some research over the weekend to find out more.

@Maobuff
Copy link
Author

Maobuff commented Apr 27, 2024

I managed to modify STM32Make.make to build firmware. Here are the steps that I did in order to build.

  1. Append ASMM_SOURCES variable from STM32CubeMX Makefile to an ASM_SOURCES of STM32Make.make
  2. change vpath %.s $(sort $(dir $(ASM_SOURCES))) to vpath %.s $(sort $(dir $(LOWER_CASE_ASM_SOURCES)))
  3. add vpath %.S $(sort $(dir $(UPPER_CASE_ASM_SOURCES))) right below step 2.

Also, STM32Make.make doesn't set AS_DEFS the same as in the original Makefile.

jortbmd added a commit that referenced this issue Apr 27, 2024
…troduced in the out of source build branch. Like using environment variables for GCC and OpenOCD.
@jortbmd
Copy link
Member

jortbmd commented Apr 28, 2024

As stated in the pull request, which I thank you for tremendously even though it is not merged. I really appreciate people trying to merge in new stuff. So thank you a bunch for your contribution! A new beta version is out which includes some of your fixed described above. If you would like to test it it can be found here: https://github.com/bmd-studio/stm32-for-vscode/releases/tag/v3.2.7-beta
Could you check if this works for you? You can install it by downloading the VSIX package and then use ctrl/CMD+shift+p and selecting Extensions: Install from VSIX.
Hoping to release a new minor version soon which should fix this for you. Will update you once I have done this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants