- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I'm using the PSoC4100SP with PSoc Creator 4.2.
I have to use the __LDREXW, __STREXW, __DMB.
I found these functions in cmsis.armcc.h, cmsis_hcc.h but I think the macro should be defined correctly.
Please let me know how to use it.
(Add)
Actually, I'm converting other mcu firmware to PSoC.
please refer to below.
int mxc_get_lock(uint32_t *lock, uint32_t value)
{
do {
// Return if the lock is taken by a different thread
if (__LDREXW((volatile unsigned long *)lock) != 0) {
return E_BUSY;
}
// Attempt to take the lock
} while (__STREXW(value, (volatile unsigned long *)lock) != 0);
// Do not start any other memory access until memory barrier is complete
__DMB();
return E_NO_ERROR;
}
Thanks and Regards,
YS
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi YS,
I believe you should be able to use __DMB(). Regarding the __LDREXW and __STREXW, both of these are unavailable for Cortex-M0 and Cortex-M0+ CPUs -
Please refer to the Intrinsic Functions documentation for further information.
Thanks and Regards,
Rakshith M B
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi YS,
I believe you should be able to use __DMB(). Regarding the __LDREXW and __STREXW, both of these are unavailable for Cortex-M0 and Cortex-M0+ CPUs -
Please refer to the Intrinsic Functions documentation for further information.
Thanks and Regards,
Rakshith M B
Rakshith M B