<?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>MCUXpresso SDKのトピックKinetis SDK examples - Design Patterns</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/Kinetis-SDK-examples-Design-Patterns/m-p/1233573#M3074</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm curious to know about the design pattern used in the Kinetis SDK examples so that I can customize the code easily. For example in the bootloader code, all the interfaces defined by structures, implementations are mapped in various .c files (memory.c, bl_tree_root.c, property_kinetis.c) and then called in bl_main.c&lt;BR /&gt;Where can I find more information about design patterns used in Kinetis SDK examples and any best practices for NXP Kinetis MCUs?&lt;/P&gt;&lt;P&gt;example -&lt;/P&gt;&lt;P&gt;In bl_context.c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;bootloader_context_t g_bootloaderContext = {.memoryInterface = &amp;amp;g_memoryInterface,
                                            .memoryMap = g_memoryMap,
#if BL_FEATURE_EXPAND_MEMORY
                                            .externalMemoryMap = g_externalMemoryMap,
#endif // BL_FEATURE_EXPAND_MEMORY
                                            .allPeripherals = g_peripherals,
                                            .activePeripheral = NULL, // Filled in at run time.
                                            .propertyInterface = &amp;amp;g_propertyInterface,
                                            .commandInterface = &amp;amp;g_commandInterface,
#if !BL_FEATURE_HAS_NO_INTERNAL_FLASH
                                            .flashDriverInterface = &amp;amp;g_flashDriverInterface,
#if !BL_DEVICE_IS_LPC_SERIES
                                            .allFlashState = &amp;amp;g_flashState,
                                            .allFlashCacheState = &amp;amp;g_flashcacheState,
#if BL_FEATURE_SUPPORT_DFLASH
                                            .dflashDriverInterface = &amp;amp;g_dflashDriverInterface,
                                            .dFlashState = &amp;amp;g_dflashState,
#endif // BL_FEATURE_SUPPORT_DFLASH
                                            
#else
                                            .allFlashState = g_flashState,
#endif // !BL_DEVICE_IS_LPC_SERIES
#endif // #if !BL_FEATURE_HAS_NO_INTERNAL_FLASH
#if AES_SECURITY_SUPPORTED
                                            .aesInterface = &amp;amp;g_aesInterface,
#endif

};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In bl_main.c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;   // Init the active peripheral.
    if (g_bootloaderContext.activePeripheral-&amp;gt;byteInterface &amp;amp;&amp;amp;
        g_bootloaderContext.activePeripheral-&amp;gt;byteInterface-&amp;gt;init)
    {
        g_bootloaderContext.activePeripheral-&amp;gt;byteInterface-&amp;gt;init(g_bootloaderContext.activePeripheral);
    }
    if (g_bootloaderContext.activePeripheral-&amp;gt;packetInterface &amp;amp;&amp;amp;
        g_bootloaderContext.activePeripheral-&amp;gt;packetInterface-&amp;gt;init)
    {
        g_bootloaderContext.activePeripheral-&amp;gt;packetInterface-&amp;gt;init(g_bootloaderContext.activePeripheral);
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Feb 2021 10:56:29 GMT</pubDate>
    <dc:creator>thilankadamith</dc:creator>
    <dc:date>2021-02-19T10:56:29Z</dc:date>
    <item>
      <title>Kinetis SDK examples - Design Patterns</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Kinetis-SDK-examples-Design-Patterns/m-p/1233573#M3074</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm curious to know about the design pattern used in the Kinetis SDK examples so that I can customize the code easily. For example in the bootloader code, all the interfaces defined by structures, implementations are mapped in various .c files (memory.c, bl_tree_root.c, property_kinetis.c) and then called in bl_main.c&lt;BR /&gt;Where can I find more information about design patterns used in Kinetis SDK examples and any best practices for NXP Kinetis MCUs?&lt;/P&gt;&lt;P&gt;example -&lt;/P&gt;&lt;P&gt;In bl_context.c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;bootloader_context_t g_bootloaderContext = {.memoryInterface = &amp;amp;g_memoryInterface,
                                            .memoryMap = g_memoryMap,
#if BL_FEATURE_EXPAND_MEMORY
                                            .externalMemoryMap = g_externalMemoryMap,
#endif // BL_FEATURE_EXPAND_MEMORY
                                            .allPeripherals = g_peripherals,
                                            .activePeripheral = NULL, // Filled in at run time.
                                            .propertyInterface = &amp;amp;g_propertyInterface,
                                            .commandInterface = &amp;amp;g_commandInterface,
#if !BL_FEATURE_HAS_NO_INTERNAL_FLASH
                                            .flashDriverInterface = &amp;amp;g_flashDriverInterface,
#if !BL_DEVICE_IS_LPC_SERIES
                                            .allFlashState = &amp;amp;g_flashState,
                                            .allFlashCacheState = &amp;amp;g_flashcacheState,
#if BL_FEATURE_SUPPORT_DFLASH
                                            .dflashDriverInterface = &amp;amp;g_dflashDriverInterface,
                                            .dFlashState = &amp;amp;g_dflashState,
#endif // BL_FEATURE_SUPPORT_DFLASH
                                            
#else
                                            .allFlashState = g_flashState,
#endif // !BL_DEVICE_IS_LPC_SERIES
#endif // #if !BL_FEATURE_HAS_NO_INTERNAL_FLASH
#if AES_SECURITY_SUPPORTED
                                            .aesInterface = &amp;amp;g_aesInterface,
#endif

};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In bl_main.c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;   // Init the active peripheral.
    if (g_bootloaderContext.activePeripheral-&amp;gt;byteInterface &amp;amp;&amp;amp;
        g_bootloaderContext.activePeripheral-&amp;gt;byteInterface-&amp;gt;init)
    {
        g_bootloaderContext.activePeripheral-&amp;gt;byteInterface-&amp;gt;init(g_bootloaderContext.activePeripheral);
    }
    if (g_bootloaderContext.activePeripheral-&amp;gt;packetInterface &amp;amp;&amp;amp;
        g_bootloaderContext.activePeripheral-&amp;gt;packetInterface-&amp;gt;init)
    {
        g_bootloaderContext.activePeripheral-&amp;gt;packetInterface-&amp;gt;init(g_bootloaderContext.activePeripheral);
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2021 10:56:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Kinetis-SDK-examples-Design-Patterns/m-p/1233573#M3074</guid>
      <dc:creator>thilankadamith</dc:creator>
      <dc:date>2021-02-19T10:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis SDK examples - Design Patterns</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/Kinetis-SDK-examples-Design-Patterns/m-p/1234592#M3077</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;&lt;BR /&gt;This information can be found on the SDK documentation. You can download this at this page: &lt;A href="https://mcuxpresso.nxp.com/en/welcome" target="_blank"&gt;https://mcuxpresso.nxp.com/en/welcome&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Let me know if this is helpful, if you have more questions do not hesitate to ask me.&lt;BR /&gt;Best regards,&lt;BR /&gt;Omar&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 21:26:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/Kinetis-SDK-examples-Design-Patterns/m-p/1234592#M3077</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2021-02-22T21:26:53Z</dc:date>
    </item>
  </channel>
</rss>

