Which variable types/sizes are atomic on STM32 microcontrollers?

后端 未结 3 1141
醉酒成梦
醉酒成梦 2020-12-09 06:01

Here are the data types on STM32 microcontrollers: http://www.keil.com/support/man/docs/armcc/armcc_chr1359125009502.htm.

These microcontrollers use 32-bit ARM core

3条回答
  •  隐瞒了意图╮
    2020-12-09 06:09

    Depending what you mean by atomic.

    If it is not the simple load or store operation like

    a += 1;
    

    then all types are not atomic.

    If it is simple store or load oparation 32bits, 16 bits and 8 bits data types are atomic. If the value in the register will have to be normalized 8 & 16 bits store and load may be not atomic.

    If your hardware supports bitbanding then if the bitbanding is used the bit operations (set and reset)int the memory areas supporting bitbanding are atomic

    Note.

    if your code does not allow unaligned operations 8 & 16 bit operations may be not atomic.

提交回复
热议问题