<?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>S32K中的主题 Re: Do you have flash read/write sample code with s32K144</title>
    <link>https://community.nxp.com/t5/S32K/Do-you-have-flash-read-write-sample-code-with-s32K144/m-p/1672660#M24192</link>
    <description>&lt;P&gt;Can you create a new thread for this question?&lt;/P&gt;
&lt;P&gt;It has nothing to do with the flash.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jun 2023 10:31:28 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2023-06-20T10:31:28Z</dc:date>
    <item>
      <title>Do you have flash read/write sample code with s32K144</title>
      <link>https://community.nxp.com/t5/S32K/Do-you-have-flash-read-write-sample-code-with-s32K144/m-p/1671775#M24119</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;s32k144 flash API don't support read ?&lt;/P&gt;&lt;P&gt;i find only below API&amp;nbsp;FLASH_DRV_ReadResource can read data from flash , it only support 8bytes ?&lt;/P&gt;&lt;P&gt;if i want to support any length to read the data from, can i do it below ? or do you have example project or code ?&lt;/P&gt;&lt;P&gt;BTW,i need the flex_nvm data from data (addr:0x10000000U)&lt;/P&gt;&lt;P&gt;status_t hal_read_from_flash(uint32_t address, uint8_t* p_bufsrc,uint32_t length)&lt;BR /&gt;{&lt;BR /&gt;uint8_t data[8];&lt;BR /&gt;int i;&lt;BR /&gt;int ret;&lt;BR /&gt;for(i=0;i&amp;lt;length/8;i++)&lt;BR /&gt;{&lt;BR /&gt;memset(data,0,8);&lt;BR /&gt;FLASH_DRV_ReadResource(&amp;amp;ssdConfig,(address+8*i),data,0);&lt;BR /&gt;memcpy(p_bufsrc+i*8,data,8);&lt;BR /&gt;}&lt;BR /&gt;int remain_len = length%8;&lt;BR /&gt;ret = FLASH_DRV_ReadResource(&amp;amp;ssdConfig,(address+8*i),data,0);&lt;BR /&gt;memcpy(p_bufsrc+i*8+remain_len,data,remain_len);&lt;BR /&gt;return ret;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*FUNCTION**********************************************************************&lt;BR /&gt;*&lt;BR /&gt;* Function Name : FLASH_DRV_ReadResource&lt;BR /&gt;* Description : Read data from special purpose memory in Flash memory module&lt;BR /&gt;* including P-Flash IFR, swap IFR, D-Flash IFR space and version ID.&lt;BR /&gt;*&lt;BR /&gt;*END**************************************************************************/&lt;BR /&gt;status_t FLASH_DRV_ReadResource(const flash_ssd_config_t * pSSDConfig,&lt;BR /&gt;uint32_t dest,&lt;BR /&gt;uint8_t * pDataArray,&lt;BR /&gt;uint8_t resourceSelectCode)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 08:57:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Do-you-have-flash-read-write-sample-code-with-s32K144/m-p/1671775#M24119</guid>
      <dc:creator>alice_th</dc:creator>
      <dc:date>2023-06-19T08:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Do you have flash read/write sample code with s32K144</title>
      <link>https://community.nxp.com/t5/S32K/Do-you-have-flash-read-write-sample-code-with-s32K144/m-p/1671950#M24137</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;BTW,i need read flash(addr:0x10000000U) data to ram with random length&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 11:30:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Do-you-have-flash-read-write-sample-code-with-s32K144/m-p/1671950#M24137</guid>
      <dc:creator>alice_th</dc:creator>
      <dc:date>2023-06-19T11:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Do you have flash read/write sample code with s32K144</title>
      <link>https://community.nxp.com/t5/S32K/Do-you-have-flash-read-write-sample-code-with-s32K144/m-p/1672536#M24184</link>
      <description>&lt;P&gt;Hello Alice,&lt;/P&gt;
&lt;P&gt;There is no SDK API to read the flash, the FLASH_DRV_ReadResource() launches the FTFx_READ_RESOURCE command (FTFx_CMD 0x3) that is not supported on S32K1xx.&lt;/P&gt;
&lt;P&gt;But the flash can be easily read by a pointer.&lt;/P&gt;
&lt;P&gt;Or you can use the RTD Ftfc_Ip driver that has this API:&lt;/P&gt;
&lt;P&gt;Ftfc_Fls_Ip_Read()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 08:27:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Do-you-have-flash-read-write-sample-code-with-s32K144/m-p/1672536#M24184</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2023-06-20T08:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Do you have flash read/write sample code with s32K144</title>
      <link>https://community.nxp.com/t5/S32K/Do-you-have-flash-read-write-sample-code-with-s32K144/m-p/1672578#M24186</link>
      <description>&lt;P&gt;ok, got it, thanks&lt;/P&gt;&lt;P&gt;another question is&amp;nbsp;&lt;/P&gt;&lt;P&gt;does this&amp;nbsp;osif_IsIsrContext API is get current status in isr or task with freertos?&lt;/P&gt;&lt;P&gt;can i used it in printf/scanf ?&lt;/P&gt;&lt;DIV&gt;static inline bool osif_IsIsrContext(void)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; bool is_isr = false;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; uint32_t ipsr_code = (uint32_t)( (S32_SCB-&amp;gt;ICSR &amp;amp; S32_SCB_ICSR_VECTACTIVE_MASK) &amp;gt;&amp;gt; S32_SCB_ICSR_VECTACTIVE_SHIFT );&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; if (ipsr_code != 0u)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; is_isr = true;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; return is_isr;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;int_t __read_console(__file_handle handle, uchar_t * buffer, size_t * count)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;#ifdef rtos_version&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; if(osif_IsIsrContext() == true)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; taskDISABLE_INTERRUPTS();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; else&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; taskENTER_CRITICAL();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;#endif&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; uint32_t bytesRemain;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;bool MsgDone=false;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;uchar_t new_lin[]={"\n"};&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;int i=0;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;while (MsgDone==false)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; LPUART_DRV_ReceiveData(INST_LPUART1, &amp;amp;buffer[i], 1);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; while(LPUART_DRV_GetReceiveStatus(INST_LPUART1, &amp;amp;bytesRemain) != STATUS_SUCCESS);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; LPUART_DRV_SendData(INST_LPUART1, &amp;amp;buffer[i], 1);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; while(LPUART_DRV_GetTransmitStatus(INST_LPUART1, &amp;amp;bytesRemain) != STATUS_SUCCESS);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; if(buffer[i++] == '\r')&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;buffer[i-1]='\n';&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;MsgDone = true;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;LPUART_DRV_SendData(INST_LPUART1, new_lin, 1);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;while(LPUART_DRV_GetTransmitStatus(INST_LPUART1, &amp;amp;bytesRemain) != STATUS_SUCCESS);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;buffer[i]=0;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;*count = (size_t)i;&lt;/DIV&gt;&lt;DIV&gt;#ifdef rtos_version&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;if(osif_IsIsrContext() == true)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; taskENABLE_INTERRUPTS();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; else&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; taskEXIT_CRITICAL();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;#endif&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;return 0;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Jun 2023 09:05:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Do-you-have-flash-read-write-sample-code-with-s32K144/m-p/1672578#M24186</guid>
      <dc:creator>alice_th</dc:creator>
      <dc:date>2023-06-20T09:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Do you have flash read/write sample code with s32K144</title>
      <link>https://community.nxp.com/t5/S32K/Do-you-have-flash-read-write-sample-code-with-s32K144/m-p/1672660#M24192</link>
      <description>&lt;P&gt;Can you create a new thread for this question?&lt;/P&gt;
&lt;P&gt;It has nothing to do with the flash.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 10:31:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Do-you-have-flash-read-write-sample-code-with-s32K144/m-p/1672660#M24192</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2023-06-20T10:31:28Z</dc:date>
    </item>
  </channel>
</rss>

