<?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のトピックFlash erase</title>
    <link>https://community.nxp.com/t5/S32K/Flash-erase/m-p/2011019#M44092</link>
    <description>&lt;LI-CODE lang="c"&gt;/* Specify the memory areas */
MEMORY
{
  /* APP从300KB开始，且总的APP区域 700KB */
  m_interrupts          (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000400
  m_flash_config        (RX)  : ORIGIN = 0x00000400, LENGTH = 0x00000010
  m_text                (RX)  : ORIGIN = 0x00000410, LENGTH = 0x000AF000 - 0x00000410

  /* 标定参数区域从0x000AF000开始，且总的标定参数区域 64KB */
  m_calibration_rom     (RX)  : ORIGIN = 0x000AF000, LENGTH = 0x00010000

  /* SRAM_L */
  /* 从SRAM_L区域中划分标定参数区域 */
  m_data                (RW)  : ORIGIN = 0x1FFE0000, LENGTH = 0x00020000 - 0x00010000
  m_calibration_ram     (RW)  : ORIGIN = 0x1FFE0000 + 0x00020000 - 0x00010000, LENGTH = 0x00010000

  /* SRAM_U */
  m_data_2              (RW)  : ORIGIN = 0x20000000, LENGTH = 0x0001F000
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/* 定义标定参数ROM区 */
  .calibration_rom :
  {
      . = ALIGN(4);
      calibration_data_rom_start = .;   /* ROM区域起始地址 */
      *(.calibration_rom)               
      calibration_data_rom_end = .;     /* ROM区域结束地址 */
      . = ALIGN(4);
  } &amp;gt; m_calibration_rom

  /* 定义标定参数RAM区 */
  .calibration :
  {
      . = ALIGN(4);
      calibration_data_ram_start = .;     /* RAM区域起始地址 */
      *(.calibration)
      calibration_data_ram_end = .;       /* RAM区域结束地址 */
      . = ALIGN(4);
  } &amp;gt; m_calibration_ram AT &amp;gt; m_calibration_rom

  calibration_data_rom_end = calibration_data_rom_start + (calibration_data_ram_end - calibration_data_ram_start);&lt;/LI-CODE&gt;&lt;P&gt;测试代码&lt;/P&gt;&lt;LI-CODE lang="c"&gt;uint32_t test_addr = 0x000AF000;

    // S32K148的FLASH_DRV_EraseSector最小擦除扇区大小是 4KB
    status = FLASH_DRV_EraseSector(&amp;amp;g_flash_ssd_config, test_addr, 4096);

    // 验证擦除
    status = FLASH_DRV_VerifySection(&amp;amp;g_flash_ssd_config, test_addr, 4096 / 16, 1u);

    uint8_t data[8] = {0x07,0x77,0,0,0,0,0,0};
    // S32K148的FLASH_DRV_Program最小可写大小是8B
	status = FLASH_DRV_Program(&amp;amp;g_flash_ssd_config, test_addr, 8, data);
    // S32K148的FLASH_DRV_ProgramSection最小可写大小是1KB
    //flashResult = FLASH_DRV_ProgramSection(&amp;amp;g_flash_ssd_config, CANID_private_addr, 4096 / 16);

	uint32_t failAddr = 0;
    // 验证写数据
	status = FLASH_DRV_ProgramCheck(&amp;amp;g_flash_ssd_config, test_addr, 8, data, &amp;amp;failAddr, 1u);&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;如上，我想通过flash驱动擦除m_calibration_rom(0xAF000)区域，但是无法擦除。同样的擦除函数我可以擦除0xBF000区域（0xAF000 + 0x10000后的地址），请问各位大佬有何解决想法。我使用的MCU是S32K148。&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2024 11:21:51 GMT</pubDate>
    <dc:creator>wanghaitao</dc:creator>
    <dc:date>2024-12-10T11:21:51Z</dc:date>
    <item>
      <title>Flash erase</title>
      <link>https://community.nxp.com/t5/S32K/Flash-erase/m-p/2011019#M44092</link>
      <description>&lt;LI-CODE lang="c"&gt;/* Specify the memory areas */
MEMORY
{
  /* APP从300KB开始，且总的APP区域 700KB */
  m_interrupts          (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000400
  m_flash_config        (RX)  : ORIGIN = 0x00000400, LENGTH = 0x00000010
  m_text                (RX)  : ORIGIN = 0x00000410, LENGTH = 0x000AF000 - 0x00000410

  /* 标定参数区域从0x000AF000开始，且总的标定参数区域 64KB */
  m_calibration_rom     (RX)  : ORIGIN = 0x000AF000, LENGTH = 0x00010000

  /* SRAM_L */
  /* 从SRAM_L区域中划分标定参数区域 */
  m_data                (RW)  : ORIGIN = 0x1FFE0000, LENGTH = 0x00020000 - 0x00010000
  m_calibration_ram     (RW)  : ORIGIN = 0x1FFE0000 + 0x00020000 - 0x00010000, LENGTH = 0x00010000

  /* SRAM_U */
  m_data_2              (RW)  : ORIGIN = 0x20000000, LENGTH = 0x0001F000
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/* 定义标定参数ROM区 */
  .calibration_rom :
  {
      . = ALIGN(4);
      calibration_data_rom_start = .;   /* ROM区域起始地址 */
      *(.calibration_rom)               
      calibration_data_rom_end = .;     /* ROM区域结束地址 */
      . = ALIGN(4);
  } &amp;gt; m_calibration_rom

  /* 定义标定参数RAM区 */
  .calibration :
  {
      . = ALIGN(4);
      calibration_data_ram_start = .;     /* RAM区域起始地址 */
      *(.calibration)
      calibration_data_ram_end = .;       /* RAM区域结束地址 */
      . = ALIGN(4);
  } &amp;gt; m_calibration_ram AT &amp;gt; m_calibration_rom

  calibration_data_rom_end = calibration_data_rom_start + (calibration_data_ram_end - calibration_data_ram_start);&lt;/LI-CODE&gt;&lt;P&gt;测试代码&lt;/P&gt;&lt;LI-CODE lang="c"&gt;uint32_t test_addr = 0x000AF000;

    // S32K148的FLASH_DRV_EraseSector最小擦除扇区大小是 4KB
    status = FLASH_DRV_EraseSector(&amp;amp;g_flash_ssd_config, test_addr, 4096);

    // 验证擦除
    status = FLASH_DRV_VerifySection(&amp;amp;g_flash_ssd_config, test_addr, 4096 / 16, 1u);

    uint8_t data[8] = {0x07,0x77,0,0,0,0,0,0};
    // S32K148的FLASH_DRV_Program最小可写大小是8B
	status = FLASH_DRV_Program(&amp;amp;g_flash_ssd_config, test_addr, 8, data);
    // S32K148的FLASH_DRV_ProgramSection最小可写大小是1KB
    //flashResult = FLASH_DRV_ProgramSection(&amp;amp;g_flash_ssd_config, CANID_private_addr, 4096 / 16);

	uint32_t failAddr = 0;
    // 验证写数据
	status = FLASH_DRV_ProgramCheck(&amp;amp;g_flash_ssd_config, test_addr, 8, data, &amp;amp;failAddr, 1u);&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;如上，我想通过flash驱动擦除m_calibration_rom(0xAF000)区域，但是无法擦除。同样的擦除函数我可以擦除0xBF000区域（0xAF000 + 0x10000后的地址），请问各位大佬有何解决想法。我使用的MCU是S32K148。&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 11:21:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-erase/m-p/2011019#M44092</guid>
      <dc:creator>wanghaitao</dc:creator>
      <dc:date>2024-12-10T11:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Flash erase</title>
      <link>https://community.nxp.com/t5/S32K/Flash-erase/m-p/2011974#M44156</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/244428"&gt;@wanghaitao&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Can you read the error flags right after the FTFC command is finished (CCIF = 1)?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_0-1733916886360.png" style="width: 513px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/315382i6744B3E591FAE4EE/image-dimensions/513x305?v=v2" width="513" height="305" role="button" title="danielmartynek_0-1733916886360.png" alt="danielmartynek_0-1733916886360.png" /&gt;&lt;/span&gt;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 11:35:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-erase/m-p/2011974#M44156</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2024-12-11T11:35:31Z</dc:date>
    </item>
  </channel>
</rss>

