Skip to content

Commit

Permalink
Fix startup assembly bugs in 500b
Browse files Browse the repository at this point in the history
Root cause:
1. .s files are not processed by the preprocessor, since they are passed directly to the assembler.  Only .S files are processed by gcc, which uses the preprocessor before sending to the assembler.  Thus the #includes in startup_stdm32f.s had no effect.
2. The proxy_inc/**/*.s files were accidentally *not* filtered from the sources like the .c files in the same directory.  Thus the startup code for both boards was unconditionally included.
3. The two bugs cancelled each other out for the 500b, resulting in the correct startup code being built.  However, it was incorrectly including the 500b's startup code in the non-500b build.
  • Loading branch information
jeremysalwen committed Jul 29, 2024
1 parent 3aa2285 commit b36ab84
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions stm32/ros_usbnode/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ build_src_filter =
-<.git/>
-<.svn/>
-<proxy_inc/**/*.c>
-<proxy_inc/**/*.S>

[env:Yardforce500]
board = genericSTM32F103VC
Expand Down
5 changes: 5 additions & 0 deletions stm32/ros_usbnode/src/startup_stm32f.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#if BOARD_YARDFORCE500_VARIANT_ORIG
#include "proxy_inc/stm32f1/startup_stm32f1xx.S"
#elif BOARD_YARDFORCE500_VARIANT_B
#include "proxy_inc/stm32f4/startup_stm32f4xx.S"
#endif
5 changes: 0 additions & 5 deletions stm32/ros_usbnode/src/startup_stm32f.s

This file was deleted.

0 comments on commit b36ab84

Please sign in to comment.