cancel
Showing results for 
Search instead for 
Did you mean: 

__RBIT() and Truestudio

MNoor.10
Associate

I want to reverse the Bits of a unsigned long data that is acquired by serial port. I used __RBIT() function in Attolic Truestudio but it does not work . I found during debugging the ARM_ARCH_7M  is not defined .

I compiled similar code in the KEIL , it works well. Kindly guide me in this regard.

3 REPLIES 3
AvaTar
Lead

Why not using the C language operators (~, one's complement), instead of macros with questionable portability ?

AvaTar,

this is about bit reversal, i.e. "mirroring" the word, changing the bit ordering; not bit inversion/negating.

jehanzebnoorpuri,

I don't use Atollic, but in your source you should have included stm32f7xx.h, that should include the header for your particular STM32 model, that should include core_cm7.h, that should include core_cmFunc.h , and that for gcc should include cmsis_gcc.h, and that should include definition of __RBIT() as a static inline function. Go along that chain.

JW

You're right - my bad.

Bit shuffling, as it's called in the e.g. in the FFT context.