2021-07-19 09:33 AM
Hi,
A few weeks ago, I created a STM32CubeIDE project for STM32MP157F-DK2 where wrote my CM4 firmware. Everything went well. However, today I decided to make little changes in the code and now there are strange errors when building. IT IS NOT POSSIBLE, I HAVEN'T CHANGED ANYTHING RELATED TO THE NEW ERRORS!
In file included from ../Core/Src/main.c:15:
../../Drivers/CMSIS/Include/core_cm4.h:105:8: error: #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
105 | #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
| ^~~~~
In file included from ../Core/Src/main.c:15:
../../Drivers/CMSIS/Include/core_cm4.h:1688:39: error: unknown type name 'IRQn_Type'; did you mean 'ITM_Type'?
1688 | __STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
| ^~~~~~~~~
| ITM_Type
../../Drivers/CMSIS/Include/core_cm4.h:1705:46: error: unknown type name 'IRQn_Type'; did you mean 'ITM_Type'?
1705 | __STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
| ^~~~~~~~~
| ITM_Type
../../Drivers/CMSIS/Include/core_cm4.h:1724:40: error: unknown type name 'IRQn_Type'; did you mean 'ITM_Type'?
1724 | __STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
| ^~~~~~~~~
| ITM_Type
../../Drivers/CMSIS/Include/core_cm4.h:1743:47: error: unknown type name 'IRQn_Type'; did you mean 'ITM_Type'?
1743 | __STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
| ^~~~~~~~~
| ITM_Type
../../Drivers/CMSIS/Include/core_cm4.h:1762:43: error: unknown type name 'IRQn_Type'; did you mean 'ITM_Type'?
1762 | __STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
| ^~~~~~~~~
| ITM_Type
../../Drivers/CMSIS/Include/core_cm4.h:1777:45: error: unknown type name 'IRQn_Type'; did you mean 'ITM_Type'?
1777 | __STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
| ^~~~~~~~~
| ITM_Type
../../Drivers/CMSIS/Include/core_cm4.h:1794:43: error: unknown type name 'IRQn_Type'; did you mean 'ITM_Type'?
1794 | __STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)
| ^~~~~~~~~
| ITM_Type
../../Drivers/CMSIS/Include/core_cm4.h:1816:41: error: unknown type name 'IRQn_Type'; did you mean 'ITM_Type'?
1816 | __STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
| ^~~~~~~~~
| ITM_Type
../../Drivers/CMSIS/Include/core_cm4.h:1838:45: error: unknown type name 'IRQn_Type'; did you mean 'ITM_Type'?
1838 | __STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)
| ^~~~~~~~~
| ITM_Type
../../Drivers/CMSIS/Include/core_cm4.h: In function 'NVIC_EncodePriority':
../../Drivers/CMSIS/Include/core_cm4.h:1869:64: error: '__NVIC_PRIO_BITS' undeclared (first use in this function)
1869 | PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
| ^~~~~~~~~~~~~~~~
../../Drivers/CMSIS/Include/core_cm4.h:1869:64: note: each undeclared identifier is reported only once for each function it appears in
../../Drivers/CMSIS/Include/core_cm4.h: In function 'NVIC_DecodePriority':
../../Drivers/CMSIS/Include/core_cm4.h:1896:64: error: '__NVIC_PRIO_BITS' undeclared (first use in this function)
1896 | PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
| ^~~~~~~~~~~~~~~~
../../Drivers/CMSIS/Include/core_cm4.h: At top level:
../../Drivers/CMSIS/Include/core_cm4.h:1913:39: error: unknown type name 'IRQn_Type'; did you mean 'ITM_Type'?
1913 | __STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
| ^~~~~~~~~
| ITM_Type
../../Drivers/CMSIS/Include/core_cm4.h:1928:43: error: unknown type name 'IRQn_Type'; did you mean 'ITM_Type'?
1928 | __STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
| ^~~~~~~~~
| ITM_Type
In file included from ../Core/Inc/stm32mp1xx_hal_conf.h:214,
from ../../Drivers/STM32MP1xx_HAL_Driver/Inc/stm32mp1xx_hal.h:30,
from ../Core/Inc/main.h:31,
from ../Core/Src/main.c:16:
../../Drivers/STM32MP1xx_HAL_Driver/Inc/stm32mp1xx_hal_cortex.h: In function 'HAL_MPU_Disable':
../../Drivers/STM32MP1xx_HAL_Driver/Inc/stm32mp1xx_hal_cortex.h:398:3: error: 'MPU' undeclared (first use in this function); did you mean 'FPU'?
398 | MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk;
| ^~~
| FPU
../../Drivers/STM32MP1xx_HAL_Driver/Inc/stm32mp1xx_hal_cortex.h:398:18: error: 'MPU_CTRL_ENABLE_Msk' undeclared (first use in this function); did you mean 'LPTIM_CR_ENABLE_Msk'?
398 | MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk;
| ^~~~~~~~~~~~~~~~~~~
| LPTIM_CR_ENABLE_Msk
../../Drivers/STM32MP1xx_HAL_Driver/Inc/stm32mp1xx_hal_cortex.h: In function 'HAL_MPU_Enable':
../../Drivers/STM32MP1xx_HAL_Driver/Inc/stm32mp1xx_hal_cortex.h:415:3: error: 'MPU' undeclared (first use in this function); did you mean 'FPU'?
415 | MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
| ^~~
| FPU
../../Drivers/STM32MP1xx_HAL_Driver/Inc/stm32mp1xx_hal_cortex.h:415:31: error: 'MPU_CTRL_ENABLE_Msk' undeclared (first use in this function); did you mean 'LPTIM_CR_ENABLE_Msk'?
415 | MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
| ^~~~~~~~~~~~~~~~~~~
| LPTIM_CR_ENABLE_Msk
make: *** [Core/Src/subdir.mk:39: Core/Src/main.o] Error 1
make: *** Waiting for unfinished jobs....
"make -j8 all" terminated with exit code 2. Build might be incomplete.
18:17:51 Build Failed. 20 errors, 0 warnings. (took 7s.808ms)
Solution is easy: remove "core_cm4.h" include, but that provokes firmware doesn't work...
Note that the only difference when opening STM32CubeIDE since last time was that IP address had changed. It is already updated in "Debug configurations".
Any ideas?
EDIT
Fortunately, I had a back-up. Checking the differences between both codes, I hav realized that there are new includes which I didn't add consciously. I've recovered the original file and everything works again.
What happens is incomprehensible for me, idk...
Thanks
2021-07-19 11:28 PM
Hi,
Glad to see you solved the issue, bunch of compile errors usually come from tiny mistake :)
Regards.
In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'