cancel
Showing results for 
Search instead for 
Did you mean: 

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

JEAN_121188
Visitor

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

9 REPLIES 9
Saket_Om
ST Employee

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om
Andrew Neil
Super User

@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.

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!

Could you please share your .ioc file?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om
Andrew Neil
Super User

@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.

Yes! I have

 

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!

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.

@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

 

 

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.