I am programming a STM32F411 on the Online Compiler.
I am using the UIT_FFT_Real Library that uses some ARM Intrinsics. The code worked fine until last year!
But after some Mbed update, I started to get the error:
Error: Use of undeclared identifier ‘__rbit’ in “UIT_FFT_Real/fftReal.cpp”, Line: 36, Col: 26
From the Documentation, I am guessing that the compiler stopped to recognize the __rbit intrinsic:
Any ideias on how to solve that and why my code stopped working?
Try to replace
WARNING : Beware that the
__RBIT function takes and returns an
uint32_t value, rather than an
unsigned int! So additional modifications might be needed.
__RBIT is defined in the
mbed-os/cmsis/CMSIS_5/CMSIS/TARGET_CORTEX_M/Include/cmsis_armcc.h file as follows:
\brief Reverse bit order of value
\details Reverses the bit order of the given value.
\param [in] value Value to reverse
\return Reversed value
#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
(defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) )
#define __RBIT __rbit
__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */
result = value; /* r will be reversed bits of v; first get LSB of v */
for (value >>= 1U; value != 0U; value >>= 1U)
result <<= 1U;
result |= value & 1U;
result <<= s; /* shift when v's highest bits are zero */
It worked like a charm!
Thank you very much Zoltan Hudak! You helped me a lot!