<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Atomic access for 8/12/32bit in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Atomic-access-for-8-12-32bit/m-p/2124800#M58433</link>
    <description>&lt;P&gt;This is a standard problem with standard procedures for the embedded space in general.&lt;/P&gt;&lt;P&gt;It all depends how you are going to use these variables and if an interruption during access can lead to wrong results.&lt;/P&gt;&lt;P&gt;If you do not want (or can) disable interrupts, you can have a look at the assembly code to check if the access already is atomic.&lt;/P&gt;&lt;P&gt;The other way is that you use for example an RTOS with its synchronization methods, for example using semaphore or mutex to protect access. Again this all depends on your setup and what you need.&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jun 2025 13:01:23 GMT</pubDate>
    <dc:creator>ErichStyger</dc:creator>
    <dc:date>2025-06-27T13:01:23Z</dc:date>
    <item>
      <title>Atomic access for 8/12/32bit</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Atomic-access-for-8-12-32bit/m-p/2124621#M58428</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm using LPC1788 (Cortex-M3) for a new product where I have many global variables shared between tasks.&lt;/P&gt;&lt;P&gt;I need to be sure all variables 8/12/32 bit have atomic access in order to avoid any software complications; Usually in other products I have disabled interrupts when reading them but in this case I can't do that.&lt;/P&gt;&lt;P&gt;Can you help me?&lt;/P&gt;&lt;P&gt;All variables are declared as separated variables (not structured) so I suppose all of them are aligned. I'm not veri practive with this technical matter becasue I've never faced such problems.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2025 08:38:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Atomic-access-for-8-12-32bit/m-p/2124621#M58428</guid>
      <dc:creator>lorenzogalbiati</dc:creator>
      <dc:date>2025-06-27T08:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Atomic access for 8/12/32bit</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Atomic-access-for-8-12-32bit/m-p/2124800#M58433</link>
      <description>&lt;P&gt;This is a standard problem with standard procedures for the embedded space in general.&lt;/P&gt;&lt;P&gt;It all depends how you are going to use these variables and if an interruption during access can lead to wrong results.&lt;/P&gt;&lt;P&gt;If you do not want (or can) disable interrupts, you can have a look at the assembly code to check if the access already is atomic.&lt;/P&gt;&lt;P&gt;The other way is that you use for example an RTOS with its synchronization methods, for example using semaphore or mutex to protect access. Again this all depends on your setup and what you need.&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2025 13:01:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Atomic-access-for-8-12-32bit/m-p/2124800#M58433</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2025-06-27T13:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Atomic access for 8/12/32bit</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Atomic-access-for-8-12-32bit/m-p/2125826#M58442</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/150405"&gt;@lorenzogalbiati&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition of what &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/17173"&gt;@ErichStyger&lt;/a&gt;&amp;nbsp;mention, you can use the following documentation in order to determine if the access on assembly is atomic.&lt;/P&gt;
&lt;P&gt;You can find some of the instruction Cortex-M3 uses on the following link.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developer.arm.com/documentation/100165/0201/Programmers-Model/Instruction-set-summary/Processor-instructions" target="_blank"&gt;Arm Cortex-M3 Processor Technical Reference Manual Revision r2p1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;For all the load and store addressing modes you can also check ARMv7-M Architecture Reference Manual&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developer.arm.com/documentation/ddi0403/latest/" target="_blank"&gt;ARMv7-M Architecture Reference Manual&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;On section A3.4 Synchronization and semaphores of ARMv7-M Architecture Reference Manual you can find Load-Exclusive/Store-Exclusive instruction the Cortex has.&lt;/P&gt;
&lt;P&gt;Just make sure to follow the restriction mention on section A3.4.5 Load-Exclusive and Store-Exclusive usage restrictions.&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Pablo&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2025 18:51:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Atomic-access-for-8-12-32bit/m-p/2125826#M58442</guid>
      <dc:creator>Pablo_Ramos</dc:creator>
      <dc:date>2025-06-30T18:51:33Z</dc:date>
    </item>
  </channel>
</rss>

