Showing results for 
Search instead for 
Did you mean: 

Ceedling and STM32CubeIDE arm-none-eabi/bin/ld warning: cannot find entry symbol Reset_Handler; defaulting to 0000000008000000


I am trying to create a first Unit Test with Ceedling/Unity/CMoke for my STM32CubeIDE project.

The project has started building but getting an error:


Linking test_functions_STM32G474RB.out... /Applications/STMicroelectronics/ warning: cannot find entry symbol Reset_Handler; defaulting to 0000000008000000 Running test_functions_STM32G474RB.out...

ERROR: Test executable "test_functions_STM32G474RB.out" failed.

Produced no final test result counts in $stdout: sh: build/test/out/test_functions_STM32G474RB.out: No such file or directory And exited with status: [0] (count of failed tests). This is often a symptom of a bad memory access in source or test code.

rake aborted!


This is the project.yml file:


# Notes:

# Sample project C code is not presently written to produce a release artifact.

# As such, release build options are disabled.

# This sample, therefore, only demonstrates running a collection of unit tests.


 :use_exceptions: FALSE

 :use_test_preprocessor: TRUE

 :use_auxiliary_dependencies: TRUE

 :build_root: build

# :release_build: TRUE

 :test_file_prefix: test_

 :which_ceedling: gem

 :ceedling_version: 0.31.1


  - test:all



# :use_assembly: TRUE


# :output: MyApp.out

# :use_assembly: FALSE



 :executable: .out



  - +:test/**

  - -:test/support


  - Core/Inc/**

  - Core/Src/**

  - Core/**

  - Drivers/CMSIS/Device/ST/STM32G4xx/Include/**

  - Drivers/CMSIS/Include/**

  - Drivers/STM32G4xx_HAL_Driver/Inc/**

  - Drivers/STM32G4xx_HAL_Driver/Inc/Legacy/**


  - test/support

 :libraries: []


 # in order to add common defines:

 # 1) remove the trailing [] from the :common: section

 # 2) add entries to the :common: section (e.g. :test: has TEST defined)

 :common: &common_defines []


  - *common_defines

  - TEST


  - *common_defines

  - TEST


 :mock_prefix: mock_

 :when_no_prototypes: :warn

 :enforce_strict_ordering: TRUE


  - :ignore

  - :callback


  uint8:  HEX8

  uint16: HEX16

  uint32: UINT32

  int8:  INT8

  bool:  UINT8


  - <stdbool.h>

  - <stdint.h>

 :treat_externs: :include

# Add -gcov to the plugins list to make sure of the gcov plugin

# You will need to have gcov and gcovr both installed to make it work.

# For more information on these options, see docs in plugins/gcov



  - HtmlDetailed


  :html_medium_threshold: 75

  :html_high_threshold: 90


# Ceedling defaults to using gcc for compiling, linking, etc.

# As [:tools] is blank, gcc will be used (so long as it's in your system path)

# See documentation to configure a given toolchain for use



  :executable: arm-none-eabi-gcc


   - '${1}'

   - '-mcpu=cortex-m4'

   - '-std=gnu11'

   - '-g3'

   - '-DDEBUG'


   - '-DSTM32G474xx'

   - '-c'

   - '-I Core/Inc'

   - '-I Core/Startup'

   - '-I Drivers/STM32G4xx_HAL_Driver/Inc'

   - '-I Drivers/STM32G4xx_HAL_Driver/Inc/Legacy'

   - '-I Drivers/CMSIS/Device/ST/STM32G4xx/Include'

   - '-I Drivers/CMSIS/Include'

   - '-I #{Ceedling.load_path}/../vendor/unity/src'

   - '-I Core/Startup'

   - '-O0'

   - '-ffunction-sections'

   - '-fdata-sections'

   - '-Wall'

   - '-fstack-usage'

   - '--specs=nano.specs'

   - '-mfpu=fpv4-sp-d16'

   - '-mfloat-abi=hard'

   - '-mthumb'


  :executable: arm-none-eabi-gcc


   - '-o "STM32G474RB - PLATFORM.elf"'

   - '-mcpu=cortex-m4'

   - '-T"/Users/raul/Documents/repository/platform-firmware-c/STM32G474RB - PLATFORM/STM32G474RBTX_FLASH.ld"'

   - '--specs=nosys.specs'

   - '-Wl,-Map="${BuildArtifactFileBaseName}.map"'

   - '-Wl,--gc-sections'

   - '-static'

   - '--specs=nano.specs'

   - '-mfpu=fpv4-sp-d16'

   - '-mfloat-abi=hard'

   - '-mthumb'

   - '-Wl,--start-group'

   - '-lc'

   - '-lm'

   - '-Wl,--end-group'


# These libraries are automatically injected into the build process. Those specified as

# common will be used in all types of builds. Otherwise, libraries can be injected in just

# tests or releases. These options are MERGED with the options in supplemental yaml files.


 :placement: :end

 :flag: "-l${1}"

 :path_flag: "-L ${1}"

 :system: []  # for example, you might list 'm' to grab the math library

 :test: []

 :release: []



  - "#{Ceedling.load_path}"


  - stdout_pretty_tests_report

  - module_generator



I have tried to add the .S file on the compiler/linker flags. But, either I am doing it wrongly or it doesn't work.

I would really appreciate that somebody with more experience than me could point what I am doing wrong.

Thanks in advance.


For future visitors, if can be of any help…

I ended up using the gcc compiler instead of the arm one. I removed the HAL drivers and the rest of the source files from the :source: includes. Then I created a separate .h and .c with the code I wanted to test. Then I had to mock up a few included headers with the minimum required functions and variables to be able to build the test code. The functions and the variables were in some cases adjusted/mocked to make it work.

Good luck…

Associate II

It looks like the linker is missing the startupcode, where reset_handler is a part of and which is provided via the startup...s file.

the .s file must be compiled with arm-none-eabi-as and not with arm-none-eabi-gcc, so maybe you are missing this in your ceedling project settings.

But you can also provide the startup Code in C. For STM32H7 (that is the SoC i work on) i found this repo: