<?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: Understanding OS Layer in NullOS conficuration in NFC library (help needed) in NFC</title>
    <link>https://community.nxp.com/t5/NFC/Understanding-OS-Layer-in-NullOS-conficuration-in-NFC-library/m-p/1363780#M8962</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/187856"&gt;@Pochie&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please kindly have my comments as below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.Even in Null Os configuration it seems that hardware specific timer functions are needed? Is that true for the complete library or just the examples?&lt;/P&gt;
&lt;P&gt;An example for the functions are given in:&lt;/P&gt;
&lt;P&gt;phOsal_Port_CM3.c&lt;/P&gt;
&lt;P&gt;phOsal_Port_CM4.c&lt;/P&gt;
&lt;P&gt;phOsal_Port_PN74xxxx.c&lt;/P&gt;
&lt;P&gt;that are defined in phOsal_NullOs_Port.h and those Timer are configured in the differened ...TickTimer(void) functions in the phOsal_Port_...c files in the NullOs/portable foldel?&lt;BR /&gt;-Yes, timers are needed for users when they have to wait/pend on events.&lt;/P&gt;
&lt;P&gt;2.On the other hand “phOsal_Port_PN74xxxx.c” returns all ...TickTimer(void) functions with just an “PH_OSAL_SUCCESS”. Is it because The PN7462 family has a 32-bit Arm®Cortex®-M0 that may already be integrating an Os?&lt;/P&gt;
&lt;P&gt;But why do the files phOsal_Port_CM3.c and phOsal_Port_CM4.c (which I guess stand for Arm®Cortex®-M3 and Arm®Cortex®-M4) have dedicated software and register settings?&lt;/P&gt;
&lt;P&gt;Inside the phOsal_Port_XXX.c files and also the phOsal_NullOs_Port.h are functions to put the processor to sleep and to wake it up. That would be lees of a problem if its just for the examples. As part of a bigger project it would not be feasible to put the MCU into sleep mode just for NFC. So the question is, do I have to put the MCU to sleep for the library to function or is it for this example?&lt;BR /&gt;-Per “phOsal_Port_PN74xxxx.c”, the following statement is mentioned:&lt;BR /&gt;/**&lt;BR /&gt;* NULL OS implementation of PN74XXXX or PN73XXXX controller is just stub.&lt;BR /&gt;* In NULL OS implementation, RdLib with PN74XXXX or PN73XXXX HAL will not use any phOsal functionality.&lt;BR /&gt;*/&lt;/P&gt;
&lt;P&gt;3.It seems mandatory since the phOsal_Sleep() function is called inside the phOsal_EventPend(...) function with out a condition in an endless loop (while(1)).&lt;/P&gt;
&lt;P&gt;That function again is called by many other functions (if I look at the call hierarchy), with one of the most important “phhalHw_Pn5180_Exchange”. From that call hierarchy it would seem, the Osal layer is mandatory for the NFC library, as well as the sleep mode of the MCU right?&lt;BR /&gt;- Yes , the Osal layer is mandatory, but the sleep mode is just for null OS case.&lt;/P&gt;
&lt;P&gt;4. So the NFC library puts the used controller to sleep? That would seem strange and not very practical if NFC is just part of a bigger projects that uses the same MCU.&lt;BR /&gt;- Well, that is some kind of compromise, if you enable RTOS, you have better performance, and if you enable null OS, you have less size of image.&lt;/P&gt;
&lt;P&gt;5. At least in the “phhalHw_Pn5180_Exchange” function, there is a condition for sending the MCU into sleep mode. That would be if (pDataParams-&amp;gt;bPollGuardTimeFlag == PH_ON). Dose that mean the Exchange function can be used, with out sending the MCU into sleep?&lt;BR /&gt;- Yes, if the guardtimer is not enabled, you needn't put the MCU into sleep mode/wait for the guardtimer expired.&lt;/P&gt;
&lt;P&gt;6.In my eyes the most critical functions in the NullOs configuration would be&lt;/P&gt;
&lt;P&gt;phOsal_Sleep&lt;/P&gt;
&lt;P&gt;phOsal_WakeUp&lt;/P&gt;
&lt;P&gt;phOsal_Sleep with its assambler instruction “wfe” is quiet clear but phOsal_WakeUp with its assambler instruction “sev” seem to only make sense in a multi cpu configuration, since a sleeping cpu does not seem to be able to send it. So the wake up need to come from an interrupt source like the tick timer? How dose the MCU wake up in this library?&lt;BR /&gt;- Yes, sev instruction is just available for multi core cpu, for single core, MCU wakes up from sleep mode by interrupts or events.&lt;/P&gt;
&lt;P&gt;7. That timer would need to be a separate timer from the one configured in the Driver Abstraction Layer, like in the function ...phDriver_TimerStart...(…) in the phDriver_...c file, right?&lt;BR /&gt;- Which timer are you referring to?&lt;/P&gt;
&lt;P&gt;To sum it up: Do I need the OS Layer even in the NullOs configuration and if so are there information further information about this layer? If the OS Layer is mandatory for the NFC library can it be used with out the sleep mode of the MCU? And if so what may be the possible drawback or implications?&lt;BR /&gt;- Yes, you need OS Layer even in the NullOs configuration, if you unzip the PSP, you may find the information related with OSAL in the folder of "\docs\OSAL", the OS Layer is mandatory for the NFC library, but it can only be uses with FreeRTOS if you don't want to use the sleep mode of the MCU. NullOs option has less size but RTOS brings better performance.&lt;/P&gt;
&lt;P&gt;Hope that makes sense,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;BR /&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Oct 2021 08:55:03 GMT</pubDate>
    <dc:creator>Kan_Li</dc:creator>
    <dc:date>2021-10-29T08:55:03Z</dc:date>
    <item>
      <title>Understanding OS Layer in NullOS conficuration in NFC library (help needed)</title>
      <link>https://community.nxp.com/t5/NFC/Understanding-OS-Layer-in-NullOS-conficuration-in-NFC-library/m-p/1357244#M8935</link>
      <description>&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;Dear NXP Community,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;I am trying to &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;understand&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt; the “NxpNfcRdLib_PN5180_LPC1769_v05.22.01_Full” library &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;through&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt; the basic discovery loop &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;example&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;1.Even in Null Os configuration it seems that hardware specific timer functions are needed? Is that true for the complete library or just the examples?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;An example for the functions are given in:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;phOsal_Port_CM3.c&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;phOsal_Port_CM4.c&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;phOsal_Port_PN74xxxx.c&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;that are defined in phOsal_NullOs_Port.h and those Timer are configured in the differened ...TickTimer(void) functions in the phOsal_Port_...c files in the NullOs/portable foldel?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;2.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;On the other hand&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt; “phOsal_Port_PN74xxxx.c” returns all ...TickTimer(void) functions with just an “PH_OSAL_SUCCESS”. Is it because The PN7462 family has a 32-bit Arm®Cortex®-M0 that may already &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;be&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt; integrat&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;ing&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt; an Os? &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;But why do the files phOsal_Port_CM3.c and phOsal_Port_CM4.c (which I gu&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;ess&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt; stand for Arm®Cortex®-M&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;3 and Arm®Cortex®-M4&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;) &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;have dedicated software and register settings? &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;Inside the phOsal_Port_XXX.c files and also the phOsal_NullOs_Port.h are functions to put the processor to sleep and to wake it up. That would be lees of a problem if its just for the examples. As part of a bigger project it would not be feasible to put the MCU into sleep mode just for NFC. So the question is, do I have to put the MCU to sleep for the library to function or is it for this example? &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;3.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;It seems mandatory since &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;the phOsal_Sleep() function is called inside the phOsal_EventPend(...) function with out a condition &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;in an endless loop (while(1))&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;That function again is called by many other functions &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;(if I look at the call hierarchy)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;, with one of the most important “phhalHw_Pn5180_Exchange”. From that call hierarchy it would seem, the Osal layer is mandatory for the NFC library, &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;as well as the sleep mode of the MCU &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;right?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;4. So the NFC library puts the used controller to sleep? That would seem strange and not very practical if NFC is just part of a bigger projects that uses the same MCU.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;5. At least in the “phhalHw_Pn5180_Exchange” function, there is a condition for sending the M&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;CU&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt; into sleep mode. That would be if (pDataParams-&amp;gt;bPollGuardTimeFlag == PH_ON). Dose that mean the Exchange function can be used, with out sending the MCU into sleep?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;6.In my eyes the most critical functions in the NullOs configuration would be&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;phOsal_Sleep&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;phOsal_WakeUp&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;phOsal_Sleep with its assam&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;b&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;ler instruction “wfe” is quiet clear but phOsal_WakeUp with its assam&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;b&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;ler instruction “sev” seem to only make sense in a multi cpu configuration, since a sleeping cpu does not seem to be able to send it. So the wake up need to come from an interrupt source like the tick timer? &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;How dose the MCU wake up in this library?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;7. That timer would need to be a separate timer from the one configured in the Driver Abstraction Layer, &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;like in the function ...phDriver_TimerStart...(…&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;) in the phDriver_...c file, &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;right?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;To sum it up: Do I need the OS Layer even in the NullOs configuration and if so are there information &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;further information about this layer? &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;If the OS Layer is mandatory for the NFC library can it be used with out the sleep mode of the MCU? &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;And if so what may be the possible drawback or implications?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT color="#333f48"&gt;&lt;FONT face="Arial, sans-serif"&gt;&lt;FONT size="3"&gt;Pochie&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 13:43:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/Understanding-OS-Layer-in-NullOS-conficuration-in-NFC-library/m-p/1357244#M8935</guid>
      <dc:creator>Pochie</dc:creator>
      <dc:date>2021-10-18T13:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding OS Layer in NullOS conficuration in NFC library (help needed)</title>
      <link>https://community.nxp.com/t5/NFC/Understanding-OS-Layer-in-NullOS-conficuration-in-NFC-library/m-p/1363780#M8962</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/187856"&gt;@Pochie&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please kindly have my comments as below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.Even in Null Os configuration it seems that hardware specific timer functions are needed? Is that true for the complete library or just the examples?&lt;/P&gt;
&lt;P&gt;An example for the functions are given in:&lt;/P&gt;
&lt;P&gt;phOsal_Port_CM3.c&lt;/P&gt;
&lt;P&gt;phOsal_Port_CM4.c&lt;/P&gt;
&lt;P&gt;phOsal_Port_PN74xxxx.c&lt;/P&gt;
&lt;P&gt;that are defined in phOsal_NullOs_Port.h and those Timer are configured in the differened ...TickTimer(void) functions in the phOsal_Port_...c files in the NullOs/portable foldel?&lt;BR /&gt;-Yes, timers are needed for users when they have to wait/pend on events.&lt;/P&gt;
&lt;P&gt;2.On the other hand “phOsal_Port_PN74xxxx.c” returns all ...TickTimer(void) functions with just an “PH_OSAL_SUCCESS”. Is it because The PN7462 family has a 32-bit Arm®Cortex®-M0 that may already be integrating an Os?&lt;/P&gt;
&lt;P&gt;But why do the files phOsal_Port_CM3.c and phOsal_Port_CM4.c (which I guess stand for Arm®Cortex®-M3 and Arm®Cortex®-M4) have dedicated software and register settings?&lt;/P&gt;
&lt;P&gt;Inside the phOsal_Port_XXX.c files and also the phOsal_NullOs_Port.h are functions to put the processor to sleep and to wake it up. That would be lees of a problem if its just for the examples. As part of a bigger project it would not be feasible to put the MCU into sleep mode just for NFC. So the question is, do I have to put the MCU to sleep for the library to function or is it for this example?&lt;BR /&gt;-Per “phOsal_Port_PN74xxxx.c”, the following statement is mentioned:&lt;BR /&gt;/**&lt;BR /&gt;* NULL OS implementation of PN74XXXX or PN73XXXX controller is just stub.&lt;BR /&gt;* In NULL OS implementation, RdLib with PN74XXXX or PN73XXXX HAL will not use any phOsal functionality.&lt;BR /&gt;*/&lt;/P&gt;
&lt;P&gt;3.It seems mandatory since the phOsal_Sleep() function is called inside the phOsal_EventPend(...) function with out a condition in an endless loop (while(1)).&lt;/P&gt;
&lt;P&gt;That function again is called by many other functions (if I look at the call hierarchy), with one of the most important “phhalHw_Pn5180_Exchange”. From that call hierarchy it would seem, the Osal layer is mandatory for the NFC library, as well as the sleep mode of the MCU right?&lt;BR /&gt;- Yes , the Osal layer is mandatory, but the sleep mode is just for null OS case.&lt;/P&gt;
&lt;P&gt;4. So the NFC library puts the used controller to sleep? That would seem strange and not very practical if NFC is just part of a bigger projects that uses the same MCU.&lt;BR /&gt;- Well, that is some kind of compromise, if you enable RTOS, you have better performance, and if you enable null OS, you have less size of image.&lt;/P&gt;
&lt;P&gt;5. At least in the “phhalHw_Pn5180_Exchange” function, there is a condition for sending the MCU into sleep mode. That would be if (pDataParams-&amp;gt;bPollGuardTimeFlag == PH_ON). Dose that mean the Exchange function can be used, with out sending the MCU into sleep?&lt;BR /&gt;- Yes, if the guardtimer is not enabled, you needn't put the MCU into sleep mode/wait for the guardtimer expired.&lt;/P&gt;
&lt;P&gt;6.In my eyes the most critical functions in the NullOs configuration would be&lt;/P&gt;
&lt;P&gt;phOsal_Sleep&lt;/P&gt;
&lt;P&gt;phOsal_WakeUp&lt;/P&gt;
&lt;P&gt;phOsal_Sleep with its assambler instruction “wfe” is quiet clear but phOsal_WakeUp with its assambler instruction “sev” seem to only make sense in a multi cpu configuration, since a sleeping cpu does not seem to be able to send it. So the wake up need to come from an interrupt source like the tick timer? How dose the MCU wake up in this library?&lt;BR /&gt;- Yes, sev instruction is just available for multi core cpu, for single core, MCU wakes up from sleep mode by interrupts or events.&lt;/P&gt;
&lt;P&gt;7. That timer would need to be a separate timer from the one configured in the Driver Abstraction Layer, like in the function ...phDriver_TimerStart...(…) in the phDriver_...c file, right?&lt;BR /&gt;- Which timer are you referring to?&lt;/P&gt;
&lt;P&gt;To sum it up: Do I need the OS Layer even in the NullOs configuration and if so are there information further information about this layer? If the OS Layer is mandatory for the NFC library can it be used with out the sleep mode of the MCU? And if so what may be the possible drawback or implications?&lt;BR /&gt;- Yes, you need OS Layer even in the NullOs configuration, if you unzip the PSP, you may find the information related with OSAL in the folder of "\docs\OSAL", the OS Layer is mandatory for the NFC library, but it can only be uses with FreeRTOS if you don't want to use the sleep mode of the MCU. NullOs option has less size but RTOS brings better performance.&lt;/P&gt;
&lt;P&gt;Hope that makes sense,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;BR /&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 08:55:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/Understanding-OS-Layer-in-NullOS-conficuration-in-NFC-library/m-p/1363780#M8962</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2021-10-29T08:55:03Z</dc:date>
    </item>
  </channel>
</rss>

