<?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 9s12XET256  bootloader/ Reporting a Bug in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12XET256-bootloader-Reporting-a-Bug/m-p/1721221#M19437</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;This post is for reporting a bug in the application note AN4258: Serial Bootloader for S12(X)&lt;/P&gt;&lt;P&gt;&amp;nbsp;In the main file and in the function for erasing flash we have the following code for S12XE 256k:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//S12XE 256k flash&lt;BR /&gt;case MASK_0M53J: //Falling to next case&lt;BR /&gt;case MASK_1M53J_2M53J:&lt;BR /&gt;//erase whole P-Flash block 0 except bootloader area&lt;BR /&gt;if(Error = PFlash_EraseSectorBySector(0x7E0000UL, 0x7FEFDFUL))&lt;BR /&gt;return(Error);&lt;BR /&gt;//and erase all remaining blocks&lt;BR /&gt;if(Error = PFlash_EraseBlock(0x7A0000UL))&lt;BR /&gt;return(Error);&lt;BR /&gt;if(Error = PFlash_EraseBlock(0x780000UL))&lt;BR /&gt;return(Error);&lt;BR /&gt;return(noErr);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to the above code, it tries to erase the flash at address 0x7A0000, but according to data sheet for 9s12 microcontroller page37, under the table 1-4, it has said.&lt;/P&gt;&lt;P&gt;"The 256K memory map is split into a 128K block from 0x78_0000 to 0x79_FFFF and a 128K block from 0x7E_0000 to 0x7F_FFFF".&lt;/P&gt;&lt;P&gt;So there is no 0x7A0000 block in microcontroller with&amp;nbsp;256K flash to erase and because of this, the program stock in this part of the code. Therefore, the true code for erasing is:&lt;/P&gt;&lt;P&gt;//erase whole P-Flash block 0 except bootloader area&lt;BR /&gt;if(Error = PFlash_EraseSectorBySector(0x7E0000UL, 0x7FEFDFUL))&lt;BR /&gt;return(Error);&lt;BR /&gt;DDRP_DDRP1 = 1;&lt;BR /&gt;//and erase all remaining blocks&lt;BR /&gt;//if(Error = PFlash_EraseBlock(0x7A0000UL))&lt;BR /&gt;if(Error = PFlash_EraseBlock(0x790000UL))&lt;BR /&gt;return(Error);&lt;BR /&gt;DDRP_DDRP2 = 1;&lt;BR /&gt;if(Error = PFlash_EraseBlock(0x780000UL))&lt;BR /&gt;return(Error);&lt;BR /&gt;DDRP_DDRP3 = 1;&lt;BR /&gt;return(noErr);&lt;/P&gt;&lt;P&gt;I attached the picture of the related page in datasheet an also the code of erase function in serial bootloader.&lt;/P&gt;&lt;P&gt;Please give me your opinion in this regard.&lt;/P&gt;&lt;P&gt;Sincerely Mohammad&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2023 13:18:37 GMT</pubDate>
    <dc:creator>Embedded-Lover</dc:creator>
    <dc:date>2023-09-12T13:18:37Z</dc:date>
    <item>
      <title>9s12XET256  bootloader/ Reporting a Bug</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12XET256-bootloader-Reporting-a-Bug/m-p/1721221#M19437</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;This post is for reporting a bug in the application note AN4258: Serial Bootloader for S12(X)&lt;/P&gt;&lt;P&gt;&amp;nbsp;In the main file and in the function for erasing flash we have the following code for S12XE 256k:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//S12XE 256k flash&lt;BR /&gt;case MASK_0M53J: //Falling to next case&lt;BR /&gt;case MASK_1M53J_2M53J:&lt;BR /&gt;//erase whole P-Flash block 0 except bootloader area&lt;BR /&gt;if(Error = PFlash_EraseSectorBySector(0x7E0000UL, 0x7FEFDFUL))&lt;BR /&gt;return(Error);&lt;BR /&gt;//and erase all remaining blocks&lt;BR /&gt;if(Error = PFlash_EraseBlock(0x7A0000UL))&lt;BR /&gt;return(Error);&lt;BR /&gt;if(Error = PFlash_EraseBlock(0x780000UL))&lt;BR /&gt;return(Error);&lt;BR /&gt;return(noErr);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to the above code, it tries to erase the flash at address 0x7A0000, but according to data sheet for 9s12 microcontroller page37, under the table 1-4, it has said.&lt;/P&gt;&lt;P&gt;"The 256K memory map is split into a 128K block from 0x78_0000 to 0x79_FFFF and a 128K block from 0x7E_0000 to 0x7F_FFFF".&lt;/P&gt;&lt;P&gt;So there is no 0x7A0000 block in microcontroller with&amp;nbsp;256K flash to erase and because of this, the program stock in this part of the code. Therefore, the true code for erasing is:&lt;/P&gt;&lt;P&gt;//erase whole P-Flash block 0 except bootloader area&lt;BR /&gt;if(Error = PFlash_EraseSectorBySector(0x7E0000UL, 0x7FEFDFUL))&lt;BR /&gt;return(Error);&lt;BR /&gt;DDRP_DDRP1 = 1;&lt;BR /&gt;//and erase all remaining blocks&lt;BR /&gt;//if(Error = PFlash_EraseBlock(0x7A0000UL))&lt;BR /&gt;if(Error = PFlash_EraseBlock(0x790000UL))&lt;BR /&gt;return(Error);&lt;BR /&gt;DDRP_DDRP2 = 1;&lt;BR /&gt;if(Error = PFlash_EraseBlock(0x780000UL))&lt;BR /&gt;return(Error);&lt;BR /&gt;DDRP_DDRP3 = 1;&lt;BR /&gt;return(noErr);&lt;/P&gt;&lt;P&gt;I attached the picture of the related page in datasheet an also the code of erase function in serial bootloader.&lt;/P&gt;&lt;P&gt;Please give me your opinion in this regard.&lt;/P&gt;&lt;P&gt;Sincerely Mohammad&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 13:18:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12XET256-bootloader-Reporting-a-Bug/m-p/1721221#M19437</guid>
      <dc:creator>Embedded-Lover</dc:creator>
      <dc:date>2023-09-12T13:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: 9s12XET256  bootloader/ Reporting a Bug</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12XET256-bootloader-Reporting-a-Bug/m-p/1721932#M19440</link>
      <description>&lt;P&gt;Hello Mohammad,&lt;/P&gt;
&lt;P&gt;You are right, thanks for poiting it out.&lt;/P&gt;
&lt;P&gt;I just reported it to the owners of the application note.&lt;/P&gt;
&lt;P&gt;I can't guarantee the SW will be updated anytime soon though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 09:47:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12XET256-bootloader-Reporting-a-Bug/m-p/1721932#M19440</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2023-09-13T09:47:23Z</dc:date>
    </item>
  </channel>
</rss>

