2026-05-05 12:39 PM - last edited on 2026-05-06 8:05 AM by Andrew Neil
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:
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'
Any sugestion?
Thank's
2026-05-06 2:20 AM
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.
2026-05-06 2:26 AM
@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.
2026-05-06 4:45 AM
Hello @Saket_Om
Thank for your help! Yes the macro #define HAL_SD_MODULE_ENABLED was defined in stm32h7xx_hal_conf.h
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!
2026-05-06 6:58 AM
Could you please share your .ioc file?
2026-05-06 7:23 AM
@JEAN_121188 - you didn't answer if you had any other build errors.
Please post the whole build log - copy & paste as text
2026-05-06 7:50 AM
2026-05-06 7:51 AM
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!
2026-05-06 7:59 AM - edited 2026-05-06 8:20 AM
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.
2026-05-06 8:18 AM
@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