<?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 example for s32k116</title>
    <link>https://community.nxp.com/t5/S32K/Flash-example-for-s32k116/m-p/2014928#M44312</link>
    <description>&lt;P&gt;Hi NXP ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;In ld file i need to define section as below,&lt;/P&gt;&lt;P&gt;MEMORY&lt;BR /&gt;{&lt;BR /&gt;/* Flash */&lt;BR /&gt;m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x000000C0&lt;BR /&gt;m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010&lt;BR /&gt;m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0001F7E0&lt;BR /&gt;m_layout1&amp;nbsp; (RX) : ORIGIN = 0x0001FBF0, LENGTH = 0x00000400&lt;BR /&gt;m_layout2&amp;nbsp; (RX) : ORIGIN = 0x0001FFF0, LENGTH = 0x00000000&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after which I started using flashdriver.c and .h file .&lt;/P&gt;&lt;P&gt;FLASH_DRV_Init()&lt;/P&gt;&lt;P&gt;/* For erase */&lt;/P&gt;&lt;P&gt;ret = FLASH_DRV_EraseSector(&amp;amp;flashSSDConfig, u32Address, BLOCK_SIZE);&lt;BR /&gt;DEV_ASSERT(STATUS_SUCCESS == ret);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Write data which are of 4 bytes minimum */&lt;BR /&gt;ret = FLASH_DRV_Program(&amp;amp;flashSSDConfig, u32Address, MAL_MEM_FLASH_SECTOR_SIZE, u16Data);&lt;BR /&gt;DEV_ASSERT(STATUS_SUCCESS == ret);&lt;/P&gt;&lt;P&gt;/* read */&lt;/P&gt;&lt;P&gt;memcpy(store&amp;nbsp; , linkarray, size );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my code it will work only few time and not consistent with memcpy.&lt;/P&gt;&lt;P&gt;what will be the way to write properly , what are all we need to do config intially ?&lt;/P&gt;&lt;P&gt;Do we have any read function other than memcpy ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help with better example for this usage ?&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2024 05:57:58 GMT</pubDate>
    <dc:creator>AbhiMR</dc:creator>
    <dc:date>2024-12-17T05:57:58Z</dc:date>
    <item>
      <title>Flash example for s32k116</title>
      <link>https://community.nxp.com/t5/S32K/Flash-example-for-s32k116/m-p/2014928#M44312</link>
      <description>&lt;P&gt;Hi NXP ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;In ld file i need to define section as below,&lt;/P&gt;&lt;P&gt;MEMORY&lt;BR /&gt;{&lt;BR /&gt;/* Flash */&lt;BR /&gt;m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x000000C0&lt;BR /&gt;m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010&lt;BR /&gt;m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0001F7E0&lt;BR /&gt;m_layout1&amp;nbsp; (RX) : ORIGIN = 0x0001FBF0, LENGTH = 0x00000400&lt;BR /&gt;m_layout2&amp;nbsp; (RX) : ORIGIN = 0x0001FFF0, LENGTH = 0x00000000&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after which I started using flashdriver.c and .h file .&lt;/P&gt;&lt;P&gt;FLASH_DRV_Init()&lt;/P&gt;&lt;P&gt;/* For erase */&lt;/P&gt;&lt;P&gt;ret = FLASH_DRV_EraseSector(&amp;amp;flashSSDConfig, u32Address, BLOCK_SIZE);&lt;BR /&gt;DEV_ASSERT(STATUS_SUCCESS == ret);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Write data which are of 4 bytes minimum */&lt;BR /&gt;ret = FLASH_DRV_Program(&amp;amp;flashSSDConfig, u32Address, MAL_MEM_FLASH_SECTOR_SIZE, u16Data);&lt;BR /&gt;DEV_ASSERT(STATUS_SUCCESS == ret);&lt;/P&gt;&lt;P&gt;/* read */&lt;/P&gt;&lt;P&gt;memcpy(store&amp;nbsp; , linkarray, size );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my code it will work only few time and not consistent with memcpy.&lt;/P&gt;&lt;P&gt;what will be the way to write properly , what are all we need to do config intially ?&lt;/P&gt;&lt;P&gt;Do we have any read function other than memcpy ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help with better example for this usage ?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 05:57:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-example-for-s32k116/m-p/2014928#M44312</guid>
      <dc:creator>AbhiMR</dc:creator>
      <dc:date>2024-12-17T05:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Flash example for s32k116</title>
      <link>https://community.nxp.com/t5/S32K/Flash-example-for-s32k116/m-p/2015388#M44342</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/242862"&gt;@AbhiMR&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I'm not sure I understand the issue here.&lt;/P&gt;
&lt;P&gt;You can refer to the S32K1xx RTD drivers.&lt;/P&gt;
&lt;P&gt;There is &lt;STRONG&gt;Ftfc_Mem_InFls_Ip_Read()&lt;/STRONG&gt; in &lt;STRONG&gt;Ftfc_Mem_InFls_Ip.c&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The flash can be read through a pointer, simply like this:&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;  for(uint32_t i = 0; i &amp;lt; size; i++){
    read_buffer[i] = *((volatile uint8_t *)(address + i));
  }&lt;/LI-CODE&gt;
&lt;P&gt;Check the memory with the debugger after each write.&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, 17 Dec 2024 14:49:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-example-for-s32k116/m-p/2015388#M44342</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2024-12-17T14:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Flash example for s32k116</title>
      <link>https://community.nxp.com/t5/S32K/Flash-example-for-s32k116/m-p/2017228#M44430</link>
      <description>extern const flash_user_config_t Flash_InitConfig0;&lt;BR /&gt;/* Flash user configuration 0 */&lt;BR /&gt;const flash_user_config_t Flash_InitConfig =&lt;BR /&gt;{&lt;BR /&gt;/*.PFlashBase = 0x0001FBF0U,&lt;BR /&gt;.PFlashSize = 0x0001FBF0U,&lt;BR /&gt;.DFlashBase = 0x1FFFFC00U,&lt;BR /&gt;.EERAMBase = 0x20000000U,&lt;BR /&gt;.CallBack = NULL_CALLBACK&lt;BR /&gt;*/&lt;BR /&gt;.PFlashBase = 0,&lt;BR /&gt;.PFlashSize = 0x20000U,&lt;BR /&gt;.DFlashBase = 0x0001FFF0U,&lt;BR /&gt;.EERAMBase = 0x20000000U,&lt;BR /&gt;.CallBack = NULL_CALLBACK&lt;BR /&gt;};&lt;BR /&gt;How to configure this? I f I change, erase will fail. Can you please provide me an example I can be able to read write above designed layout. Or how i can customise and use in s32k116 please let me know?&lt;BR /&gt;&lt;BR /&gt;Basically i need to do read, write and earse operation on this&lt;BR /&gt;m_layout1 (RX) : ORIGIN = 0x0001FBF0, LENGTH = 0x00000400&lt;BR /&gt;m_layout2 (RX) : ORIGIN = 0x0001FFF0, LENGTH = 0x00000000</description>
      <pubDate>Thu, 19 Dec 2024 13:02:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-example-for-s32k116/m-p/2017228#M44430</guid>
      <dc:creator>AbhiMR</dc:creator>
      <dc:date>2024-12-19T13:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Flash example for s32k116</title>
      <link>https://community.nxp.com/t5/S32K/Flash-example-for-s32k116/m-p/2017240#M44433</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/242862"&gt;@AbhiMR&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Where did you get the Flash_InitConfig and the flashdriver.c and .h files? It does not mach the S32K116 memory map (S32K1xx_Memory_Map.xlsx attached to the Reference Manual).&lt;/P&gt;
&lt;P&gt;Please use either the S32DS 3.4 IDE with the SDK drivers, or preferably the S32DS3.5 IDE with the&amp;nbsp; RTD drivers.&lt;/P&gt;
&lt;P&gt;There is a GUI that allows you to configure the structures such as Flash_InitConfig.&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>Thu, 19 Dec 2024 13:24:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-example-for-s32k116/m-p/2017240#M44433</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2024-12-19T13:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Flash example for s32k116</title>
      <link>https://community.nxp.com/t5/S32K/Flash-example-for-s32k116/m-p/2017336#M44438</link>
      <description>&lt;P&gt;/* * Copyright 2020 NXP * All rights reserved. * * NXP Confidential. This software is owned or controlled by NXP and may only be * used strictly in accordance with the applicable license terms. By expressly * accepting such terms or by downloading, installing, activating and/or otherwise * using the software, you are agreeing that you have read, and that you agree to * comply with and are bound by, such license terms. If you do not agree to be * bound by the applicable license terms, then you may not retain, install, * activate or otherwise use the software. The production use license in * Section 2.3 is expressly granted for this software. */ /* ################################################################### ** Filename : main.c ** Project : flash_partitioning_s32k116 ** Processor : s32k116 ** Abstract : ** Main module. ** This module contains user's application code. ** Settings : ** Contents : ** No public methods ** ** ###################################################################*/ /*! ** @file main.c ** @brief ** Main module. ** This module contains user's application code. */ /*! ** @addtogroup main_module main module documentation ** @{ */ /* MODULE main */ /* Including necessary configuration files. */ #include "sdk_project_config.h" #include "interrupt_manager.h" volatile int exit_code = 0; /* User includes */ /* Declare a FLASH config struct which initialized by FlashInit, and will be used by all flash operations */ flash_ssd_config_t flashSSDConfig; /* Data source for program operation */ #define BUFFER_SIZE 0x100u /* Size of data source */ uint8_t sourceBuffer[BUFFER_SIZE]; /* Function declarations */ void CCIF_Handler(void); /* If target is flash, insert this macro to locate callback function into RAM */ START_FUNCTION_DECLARATION_RAMSECTION void CCIF_Callback(void) END_FUNCTION_DECLARATION_RAMSECTION /*! \brief The main function for the project. \details The startup initialization sequence is the following: * - startup asm routine * - main() */ int main(void) { /* Write your local variable definition here */ status_t ret; /* Store the driver APIs return code */ uint32_t address; uint32_t size; uint32_t failAddr; uint32_t i; flash_callback_t pCallBack; #if (FEATURE_FLS_HAS_PROGRAM_PHRASE_CMD == 1u) #ifndef FLASH_TARGET uint8_t unsecure_key[FTFx_PHRASE_SIZE] = {0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFEu, 0xFFu, 0xFFu, 0xFFu}; #endif #else /* FEATURE_FLASH_HAS_PROGRAM_LONGWORD_CMD */ uint8_t unsecure_key[FTFx_LONGWORD_SIZE] = {0xFEu, 0xFFu, 0xFFu, 0xFFu}; #endif /* FEATURE_FLS_HAS_PROGRAM_PHRASE_CMD */ /* Write your code here */ /* Initialize and configure clocks * - see clock manager component for details */ CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT); CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT); /* Init source data */ for (i = 0u; i &amp;lt; BUFFER_SIZE; i++) { sourceBuffer[i] = i; } /* Disable cache to ensure that all flash operations will take effect instantly, * this is device dependent */ #ifndef FLASH_TARGET #ifdef S32K11x_SERIES MSCM-&amp;gt;OCMDR[0u] |= MSCM_OCMDR_OCM1(0x3u); MSCM-&amp;gt;OCMDR[1u] |= MSCM_OCMDR_OCM1(0x3u); #endif /* S32K11x_SERIES */ #endif /* FLASH_TARGET */ /* Install interrupt for Flash Command Complete event */ INT_SYS_InstallHandler(FTFC_IRQn, CCIF_Handler, (isr_t*) 0); INT_SYS_EnableIRQ(FTFC_IRQn); /* Enable global interrupt */ INT_SYS_EnableIRQGlobal(); /* Always initialize the driver before calling other functions */ ret = FLASH_DRV_Init(&amp;amp;Flash_InitConfig0, &amp;amp;flashSSDConfig); DEV_ASSERT(STATUS_SUCCESS == ret); /* Erase a sector in DFlash */ address = flashSSDConfig.DFlashBase; size = FEATURE_FLS_DF_BLOCK_SECTOR_SIZE; ret = FLASH_DRV_EraseSector(&amp;amp;flashSSDConfig, address, size); DEV_ASSERT(STATUS_SUCCESS == ret); /* Verify the erase operation at margin level value of 1, user read */ ret = FLASH_DRV_VerifySection(&amp;amp;flashSSDConfig, address, size / FTFx_PHRASE_SIZE, 1u); DEV_ASSERT(STATUS_SUCCESS == ret); /* Write some data to the erased DFlash sector */ address = flashSSDConfig.DFlashBase; size = BUFFER_SIZE; ret = FLASH_DRV_Program(&amp;amp;flashSSDConfig, address, size, sourceBuffer); DEV_ASSERT(STATUS_SUCCESS == ret); /* Verify the program operation at margin level value of 1, user margin */ ret = FLASH_DRV_ProgramCheck(&amp;amp;flashSSDConfig, address, size, sourceBuffer, &amp;amp;failAddr, 1u); DEV_ASSERT(STATUS_SUCCESS == ret); /* Remove warning for unused variable */ (void)ret; for(;;) { if(exit_code != 0) { break; } } return exit_code; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its hitting Device assert.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this I want to explore how to use dflash&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 16:26:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-example-for-s32k116/m-p/2017336#M44438</guid>
      <dc:creator>AbhiMR</dc:creator>
      <dc:date>2024-12-19T16:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Flash example for s32k116</title>
      <link>https://community.nxp.com/t5/S32K/Flash-example-for-s32k116/m-p/2018575#M44537</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/242862"&gt;@AbhiMR&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;If you generated the SDK code in S32DS 3.4 with SDK 4.0.3 installed, you would get this structure&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;/* Flash user configuration 0 */
const flash_user_config_t Flash_InitConfig0 =
{
.PFlashBase = 0x0U,
.PFlashSize = 0x20000U,
.DFlashBase = 0x10000000U,
.EERAMBase = 0x14000000U,
.CallBack = NULL_CALLBACK
};&lt;/LI-CODE&gt;
&lt;P&gt;in .../board/peripherals_flash_FTFC.c&lt;/P&gt;
&lt;P&gt;Not this:&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;const flash_user_config_t Flash_InitConfig =
{
/*.PFlashBase = 0x0001FBF0U,
.PFlashSize = 0x0001FBF0U,
.DFlashBase = 0x1FFFFC00U,
.EERAMBase = 0x20000000U,
.CallBack = NULL_CALLBACK
*/
.PFlashBase = 0,
.PFlashSize = 0x20000U,
.DFlashBase = 0x0001FFF0U,
.EERAMBase = 0x20000000U,
.CallBack = NULL_CALLBACK
};&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Install S32DS 3.4&lt;/LI&gt;
&lt;LI&gt;Install SDK 4.0.3&lt;/LI&gt;
&lt;LI&gt;Create flash_partitioning_s32k116 from example&lt;/LI&gt;
&lt;LI&gt;Generate the SDK configuration:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_1-1734953451248.png" style="width: 566px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/317071i33790B800D73E016/image-dimensions/566x281?v=v2" width="566" height="281" role="button" title="danielmartynek_1-1734953451248.png" alt="danielmartynek_1-1734953451248.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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 11:34:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-example-for-s32k116/m-p/2018575#M44537</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2024-12-23T11:34:30Z</dc:date>
    </item>
  </channel>
</rss>

