Skip to main content
Associate
May 5, 2026
Solved

SDMMC2 build fails - Unknown destination type (ARM/Thumb)

  • May 5, 2026
  • 4 replies
  • 1070 views

Title edited to highlight that this is a build error, "Unknown destination type (ARM/Thumb)"


Hi!

I'm trying develop code with STM32H745IIT using SDMMC2 in M7 core based in this tutorial:

https://www.youtube.com/watch?v=I9KDN1o6924

My version the CubeMX is: 6.17 and STM32CubeIDE is 2.1.0

Initially I set mode: SD 4 bits Wide bus and configuration is:SD.png
NVIC: Enabled

NO constants

GPIO Setting:
- PB3: D2, PB4: D3, PB14: D0, PB15: D1, PD6: CK and PD7: CMD

- DMA: not exist??

Only with this code is the following error generated in CubeIDE:

(HAL_SD_Init): Unknown destination type (ARM/Thumb) in ./Application/User/Core/main.o
(HAL_SD_IRQHandler): Unknown destination type (ARM/Thumb) in ./Application/User/Core/
undefined reference to `HAL_SD_Init'
undefined reference to `HAL_SD_IRQHandler'

SD_Code.png

Any sugestion?

Thank's

Best answer by Andrew Neil

@Saket_Om so this is another occurrence of the "dangerous relocation: unsupported relocation" issue which seems to have appeared with GCC 14 in CubeIDE v2.1.0.

@Mahmoud Ben Romdhane raised internal ticket Number: 228023 on it here.

See also:

CubeIDE 2.1.0: system_stm32wl3x.o dangerous relocation: unsupported relocation

livetune Designer Source Code Compilation Error

 

 

4 replies

Technical Moderator
May 6, 2026

Hello @JEAN_121188 

Is the macro #define HAL_SD_MODULE_ENABLED is defined in stm32h7xx_hal_conf.h. If this define is missing, the SD HAL APIs such as HAL_SD_Init() and HAL_SD_IRQHandler() may not be compiled correctly.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om
Associate
May 6, 2026

Hello @Saket_Om

Thank for your help! Yes the macro #define HAL_SD_MODULE_ENABLED was defined in stm32h7xx_hal_conf.h

SD_MODULE_ENABLED.png

What I find strange is the location of these files:
stm32h7xx_hal_conf.h is in:
..\workspace_2.1.0\CCK7700\CM7\Core\Inc\stm32h7xx_hal_conf.h
and the M7 main file is in:
..\workspace_2.1.0\CCK7700\CM7\Core\Src\main.c

see project explorer in left

 

By, have a beautiful day!

Technical Moderator
May 6, 2026

Could you please share your .ioc file?

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om
Andrew Neil
Super User
May 6, 2026

@JEAN_121188 wrote:

with this code is the following error generated in CubeIDE:

(HAL_SD_Init): Unknown destination type (ARM/Thumb) in ./Application/User/Core/main.o
(HAL_SD_IRQHandler): Unknown destination type (ARM/Thumb) in ./Application/User/Core/


(red highlighting added)

Are those the only errors ?

Specifically, are you also getting dangerous relocation: unsupported relocation errors ?

If so, see this thread.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Andrew Neil
Super User
May 6, 2026

@JEAN_121188 - you didn't answer if you had any other build errors.

Please post the whole build log - copy & paste as text

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate
May 6, 2026

Yes, have many erros:

Description Resource Path Location Type
(HAL_SD_Init): Unknown destination type (ARM/Thumb) in ./Application/User/Core/main.o FIRM_NORAM_CM7 C/C++ Problem
(HAL_SD_IRQHandler): Unknown destination type (ARM/Thumb) in ./Application/User/Core/stm32h7xx_it.o FIRM_NORAM_CM7 C/C++ Problem
(MX_FATFS_Init): Unknown destination type (ARM/Thumb) in ./Application/User/Core/main.o FIRM_NORAM_CM7 C/C++ Problem
dangerous relocation: unsupported relocation FIRM_NORAM_CM7 line 0, external location: C:\Users\jeand\STM32CubeIDE\workspace_2.1.0\CCK7700\CM7\Core\Src\main.c:263 C/C++ Problem
dangerous relocation: unsupported relocation FIRM_NORAM_CM7 line 0, external location: C:\Users\jeand\STM32CubeIDE\workspace_2.1.0\CCK7700\CM7\Core\Src\main.c:829 C/C++ Problem
dangerous relocation: unsupported relocation FIRM_NORAM_CM7 line 0, external location: C:\Users\jeand\STM32CubeIDE\workspace_2.1.0\CCK7700\CM7\Core\Src\stm32h7xx_it.c:215 C/C++ Problem
make: *** [makefile:69: FIRM_NORAM_CM7.elf] Error 1 FIRM_NORAM_CM7 C/C++ Problem
undefined reference to `HAL_SD_Init' FIRM_NORAM_CM7 line 0, external location: C:\Users\jeand\STM32CubeIDE\workspace_2.1.0\CCK7700\CM7\Core\Src\main.c:829 C/C++ Problem
undefined reference to `HAL_SD_IRQHandler' FIRM_NORAM_CM7 line 0, external location: C:\Users\jeand\STM32CubeIDE\workspace_2.1.0\CCK7700\CM7\Core\Src\stm32h7xx_it.c:215 C/C++ Problem
undefined reference to `MX_FATFS_Init' FIRM_NORAM_CM7 line 0, external location: C:\Users\jeand\STM32CubeIDE\workspace_2.1.0\CCK7700\CM7\Core\Src\main.c:263 C/C++ Problem

 

Thank for your help!

Andrew Neil
Super User
May 6, 2026

So you do have "dangerous relocation" errors:

The reason for those, and how to fix them, is in the thread I linked earlier.

TL;DR: you need to downgrade your GCC toolchain to an earlier version.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate
May 7, 2026

Hello!!!

The problem today resolved!!! two methods are used: firts the solution by @Andrew Neil with solution of the occurrence of the "dangerous relocation: unsupported relocation.

Secound with Brasil support ST: Was movie archive of the comum path from projetc:

image004.pngimage009.pngCaptura de tela 2026-05-07 092119.png

I would like to thank everyone who helped me @Mahmoud Ben Romdhane @Saket_Om and @Andrew Neil 

Thank's all!!