Skip to main content
NCTUser
Associate II
July 3, 2025
Solved

STM32F103 and RBIT instruction

  • July 3, 2025
  • 1 reply
  • 304 views

Hello,

I use a STM32F103 MCU and I use the RBIT instruction (as an CMSIS inline functinon). The instruction works properly and I can see the rbit instruction in the disassembly window (for this project I have to use an old TrueSTUDIO IDE).

According to the ARM documentation this MCU could not execute the RBIT instruction because it is a Cortex-M3 r1p1 core (CPUID: 0x411fc231) which does not have this instruction. In spite of this the instruction seemly works and the "PM0056 Programming manual" (STM32F10xxx/20xxx/21xxx/L1xxxx) mentions too the instruction without making any difference about the revisions.

Can someone help clear up this confusion?

 

 

Best answer by TDK

Most "STM32F103" chips are counterfeit. Is this one of them?

Can you link to documentation saying RBIT is not supported? I could not find it.

1 reply

TDK
TDKBest answer
Super User
July 3, 2025

Most "STM32F103" chips are counterfeit. Is this one of them?

Can you link to documentation saying RBIT is not supported? I could not find it.

"If you feel a post has answered your question, please click ""Accept as Solution""."
NCTUser
NCTUserAuthor
Associate II
July 3, 2025

> Can you link to documentation saying RBIT is not supported? I could not find it.

Yes, I misguided myself about the documentation, after checking it again, the RBIT is indeed part of the Cortex-M3 instruction set, independetly form the chip revision. The STM32F103 is surely genuine because it comes from a big and reliable distributor. 

Thank you!