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

Cortex-m4
Hide thumbs Also See for STM32F4 Series:
Table of Contents

Advertisement

PM0214
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);

Table 15. 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;
DocID022708 Rev 6
// load 16-bit value from memory address
//0x20001002
The Cortex-M4 processor
35/260
259

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

This manual is also suitable for:

Stm32l4+ seriesStm32f3 series

Table of Contents

Save PDF