<?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: Unable to Erase Sector  in S32K</title>
    <link>https://community.nxp.com/t5/S32K/Unable-to-Erase-Sector/m-p/1035102#M6572</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your swift response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First doubt was cleared as we are using&amp;nbsp;FS32K144U&amp;nbsp;AVLH ON57U&amp;nbsp;CTAW1818A &amp;amp;&amp;nbsp;therefore we are production samples only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now comes the actual part. I'm dividing the task into 5 parts&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Disabling interrupts&lt;/P&gt;&lt;P&gt;2. CAN Response&lt;/P&gt;&lt;P&gt;3. Erase Sector&lt;/P&gt;&lt;P&gt;4. Success Message over CAN&lt;/P&gt;&lt;P&gt;5. Reset the Device&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I receive the CAN command, disable the interrupts, responding to CAN &amp;amp; finally erase the sector and send the success message over CAN then reset the device.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this I'm able to receive the message, able to disble to interrupts (Step 1), responding to CAN (Step 2), Erase function starts (Step 3) &amp;amp; the device resets and program starts again. I'm not able to&amp;nbsp;see&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;Success Message over CAN (Step 4)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore I suspect that there is a reset happening during erase command. I would like to know the possible cases for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also&amp;nbsp;is there any chance that&amp;nbsp;&lt;SPAN style="color: #ff0000;"&gt;__asm("cpsid i")&lt;/SPAN&gt;&amp;nbsp; command for disabling Interrupts won't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help in this regard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Raju.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Dec 2019 05:33:58 GMT</pubDate>
    <dc:creator>bjrajendra</dc:creator>
    <dc:date>2019-12-13T05:33:58Z</dc:date>
    <item>
      <title>Unable to Erase Sector</title>
      <link>https://community.nxp.com/t5/S32K/Unable-to-Erase-Sector/m-p/1035100#M6570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to erase the sector based on the can commands. When I'm trying to erase one of the sector it's not able to erase.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code structure is Once CAN command comes, it should disable the interrupts and respond the can message and erase the sector and reset the device, so that it can enter the bootloader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;__asm("cpsid i") ;&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;response_handler(f_info,f_data);&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;ret=FlashEraseSector(&amp;amp;flashSSDConfig, flash_prog_address, FEATURE_FLS_PF_BLOCK_SECTOR_SIZE, FlashCommandSequence);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;if(C90FL_OK != ret)&lt;BR /&gt; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;negative_response(f_info,PROGRAM_FAILURE);&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;asm("nop");&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;S32_SCB-&amp;gt;AIRCR &amp;amp;=0x0000FFFF;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Delay_in_usec(1000000);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;// request software reset&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;S32_SCB-&amp;gt;AIRCR = S32_SCB_AIRCR_VECTKEY(0x5FA)| S32_SCB_AIRCR_SYSRESETREQ_MASK;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;// wait for reset to occur&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;while(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the CAN Error I can see. &lt;SPAN style="color: #ff0000;"&gt;I can able to see the reset happening as expected but unable to erase the sector though it gives the successfully executes the function&amp;nbsp;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;FlashEraseSector();&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Is there any chance that the program itself resetting while executing&amp;nbsp; &amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;FlashEraseSector();&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/96493i973BDB401B83C18C/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I can able to see the things happen as expected (correctly), with Debug window. But not once programmed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;I also suspect the device, the samples we got were 2 years back &amp;amp; also not the production samples. Can I know how to check the same.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly Help in this regard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Raju&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2019 13:11:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Unable-to-Erase-Sector/m-p/1035100#M6570</guid>
      <dc:creator>bjrajendra</dc:creator>
      <dc:date>2019-12-11T13:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Erase Sector</title>
      <link>https://community.nxp.com/t5/S32K/Unable-to-Erase-Sector/m-p/1035101#M6571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Raju,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume you are using S32K144. &lt;BR /&gt;There are three masks 0N77P, ON47T, ON57U (only this one is a production mask), you can read it on the package.&lt;/P&gt;&lt;P&gt;If there is an error during the Erase Flash Sector command execution, you should see one of the errors listed in Table 36-45, RM rev.11. So, I would start with that.&lt;/P&gt;&lt;P&gt;Please make sure that the PFlash block is not read during the flash operation, it would&amp;nbsp;set FTFC Read Collision Error Flag (FSTAT_RDCOLERR).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR, Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2019 12:54:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Unable-to-Erase-Sector/m-p/1035101#M6571</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2019-12-12T12:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Erase Sector</title>
      <link>https://community.nxp.com/t5/S32K/Unable-to-Erase-Sector/m-p/1035102#M6572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your swift response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First doubt was cleared as we are using&amp;nbsp;FS32K144U&amp;nbsp;AVLH ON57U&amp;nbsp;CTAW1818A &amp;amp;&amp;nbsp;therefore we are production samples only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now comes the actual part. I'm dividing the task into 5 parts&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Disabling interrupts&lt;/P&gt;&lt;P&gt;2. CAN Response&lt;/P&gt;&lt;P&gt;3. Erase Sector&lt;/P&gt;&lt;P&gt;4. Success Message over CAN&lt;/P&gt;&lt;P&gt;5. Reset the Device&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I receive the CAN command, disable the interrupts, responding to CAN &amp;amp; finally erase the sector and send the success message over CAN then reset the device.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this I'm able to receive the message, able to disble to interrupts (Step 1), responding to CAN (Step 2), Erase function starts (Step 3) &amp;amp; the device resets and program starts again. I'm not able to&amp;nbsp;see&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;Success Message over CAN (Step 4)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore I suspect that there is a reset happening during erase command. I would like to know the possible cases for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also&amp;nbsp;is there any chance that&amp;nbsp;&lt;SPAN style="color: #ff0000;"&gt;__asm("cpsid i")&lt;/SPAN&gt;&amp;nbsp; command for disabling Interrupts won't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help in this regard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Raju.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2019 05:33:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Unable-to-Erase-Sector/m-p/1035102#M6572</guid>
      <dc:creator>bjrajendra</dc:creator>
      <dc:date>2019-12-13T05:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Erase Sector</title>
      <link>https://community.nxp.com/t5/S32K/Unable-to-Erase-Sector/m-p/1035103#M6573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raju,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There could be a reset during the erase command execution.&lt;BR /&gt;Please read the RCM_SRS flags after each reset.&lt;BR /&gt;This register includes read-only status flags to indicate the source of the most recent reset.&lt;BR /&gt;Instead of the the RCM_SRS_SW flag, there could be a LOCKUP.&lt;BR /&gt;The ’cpsid i’ instruction sets the PRIMASK special core register, you should be able to read it in the register view.&lt;BR /&gt;If you use S32 Design Studio, you can use the ENABLE_INTERRUPTS(), DISABLE_INTERRUPTS() macros (s32_core_cm4.h).&lt;BR /&gt;Please locate the function that launches the flash command and make sure that the function is not in PFlash but SRAM/DFlash and the execution stays there until the flash operation is complete.&lt;BR /&gt; &lt;BR /&gt;Thank you,&lt;BR /&gt;BR, Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2019 12:03:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Unable-to-Erase-Sector/m-p/1035103#M6573</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2019-12-16T12:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Erase Sector</title>
      <link>https://community.nxp.com/t5/S32K/Unable-to-Erase-Sector/m-p/1035104#M6574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Daniel for all the support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now everything started working and in fact, I didn't modify anything. And I'm not able to recreate the same situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll debug the same once the situation occurs again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raju&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2019 09:59:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Unable-to-Erase-Sector/m-p/1035104#M6574</guid>
      <dc:creator>bjrajendra</dc:creator>
      <dc:date>2019-12-18T09:59:22Z</dc:date>
    </item>
  </channel>
</rss>

