Programming Hints For The Synchronization Primitives; Table 16. Cmsis Functions For Exclusive Access Instructions - ST STM32H7 Series Programming Manual

Hide thumbs Also See for STM32H7 Series:
Table of Contents

Advertisement

The Cortex-M4 processor
2.2.8

Programming hints for the synchronization primitives

ISO/IEC C cannot directly generate the exclusive access instructions. CMSIS provides
intrinsic functions for generation of these instructions:
Instruction
LDREX
LDREXH
LDREXB
STREX
STREXH
STREXB
CLREX
For example:
uint16_t
uint16_t *address = 0x20001002;
value = __LDREXH (address);
36/262

Table 16. CMSIS functions for exclusive access instructions

CMSIS function
uint32_t __LDREXW (uint32_t *addr)
uint16_t __LDREXH (uint16_t *addr)
uint8_t __LDREXB (uint8_t *addr)
uint32_t __STREXW (uint32_t value, uint32_t *addr)
uint32_t __STREXH (uint16_t value, uint16_t *addr)
uint32_t __STREXB (uint8_t value, uint8_t *addr)
void __CLREX (void)
value;
PM0214 Rev 9
// load 16-bit value from memory address
//0x20001002
PM0214

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32H7 Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents

Save PDF