<?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のトピックRe: How can I get bootloader example for S32K3XX</title>
    <link>https://community.nxp.com/t5/S32K/How-can-I-get-bootloader-example-for-S32K3XX/m-p/1621310#M21583</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello,Sir!&lt;/SPAN&gt;&lt;SPAN&gt;This&amp;nbsp; is my attachment，Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2023 03:00:37 GMT</pubDate>
    <dc:creator>lihuagang</dc:creator>
    <dc:date>2023-03-24T03:00:37Z</dc:date>
    <item>
      <title>How can I get bootloader example for S32K3XX</title>
      <link>https://community.nxp.com/t5/S32K/How-can-I-get-bootloader-example-for-S32K3XX/m-p/1576838#M19795</link>
      <description>&lt;P&gt;Hello NXP team,&lt;/P&gt;&lt;P&gt;we are developing bootloader for S32K314 and we'd like to know how to get bootloader example?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 04:53:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/How-can-I-get-bootloader-example-for-S32K3XX/m-p/1576838#M19795</guid>
      <dc:creator>zp001</dc:creator>
      <dc:date>2023-01-04T04:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get bootloader example for S32K3XX</title>
      <link>https://community.nxp.com/t5/S32K/How-can-I-get-bootloader-example-for-S32K3XX/m-p/1576853#M19797</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@zp001" target="_blank"&gt;Hi@zp001&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;please taka a look at this post,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S32K-Knowledge-Base/Unified-bootloader-Demo/ta-p/1423099" target="_self"&gt;https://community.nxp.com/t5/S32K-Knowledge-Base/Unified-bootloader-Demo/ta-p/1423099&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 05:43:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/How-can-I-get-bootloader-example-for-S32K3XX/m-p/1576853#M19797</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2023-01-04T05:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get bootloader example for S32K3XX</title>
      <link>https://community.nxp.com/t5/S32K/How-can-I-get-bootloader-example-for-S32K3XX/m-p/1621307#M21582</link>
      <description>&lt;P&gt;Hello,Sir!&lt;SPAN&gt;This&amp;nbsp; attachment is my s32k312 bootloader&amp;amp;app project,but it cannot run properly！Could you&amp;nbsp; help me take a look at how to modify this code，please！ Also, the Unified Bootloader Demo&amp;nbsp; is looks at&amp;nbsp; difficult. Can you provide me with a simpler example?&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/* bootloader_linker */
MEMORY 
{         
    int_flash               : ORIGIN = 0x00400000, LENGTH = 0x00010000    /* 2048K - 176K (sBAF + HSE)*/
    int_itcm                : ORIGIN = 0x00000000, LENGTH = 0x00008000    /* 32K */
    int_dtcm                : ORIGIN = 0x20000000, LENGTH = 0x00010000    /* 64K */
    int_sram                : ORIGIN = 0x20400000, LENGTH = 0x00006F00    /* 27 KB */
    int_sram_fls_rsv        : ORIGIN = 0x20406F00, LENGTH = 0x00000100    
    int_sram_stack_c0       : ORIGIN = 0x20407000, LENGTH = 0x00001000    
    int_sram_no_cacheable   : ORIGIN = 0x20408000, LENGTH = 0x00007F00    /* 32kb , needs to include int_results  */
    int_sram_results        : ORIGIN = 0x2040FF00, LENGTH = 0x00000100    
    int_sram_shareable      : ORIGIN = 0x20410000, LENGTH = 0x00008000    /* 32KB */
    ram_rsvd2               : ORIGIN = 0x20418000, LENGTH = 0             /* End of SRAM */
}

/*bootloader_main.c*/
/* ==========  define var ========== */
#define APP_START_ADDRESS	 (0x000410000 + 0x200) //app开始地址
/*===========  LOCAL FUNCTIONS =========*/
void Bootup_Application(const uint32_t app_StarAddress);
void init_ram(void);
void TestDelay(uint32 delay);

void TestDelay(uint32 delay)
{
    static volatile uint32 DelayTimer = 0;
    while (DelayTimer&amp;lt;delay)
    {
        DelayTimer++;
    }
    DelayTimer=0;
}



/**
* @brief        Main function of the example
* @details      Initializez the used drivers and uses the Icu
*               and Dio drivers to toggle a LED on a push button
*/
int main(void)
{
    uint8 count = 0U;


    /* Initialize all pins using the Port driver */
    Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);

    while (count++ &amp;lt; 5)
    {
        Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 1U);
        TestDelay(4800000);
        Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 0U);
        TestDelay(4800000);
    }

    /* 清空ECC */
    init_ram();

    /* 执行跳转 */
    Bootup_Application(APP_START_ADDRESS);

    return (0U);
}


#define	STDBYRAM_START		0x20400000
#define	STDBYRAM_END		0x20418000
#define STDBYRAM_SIZE		(STDBYRAM_END - STDBYRAM_START)

void init_ram(void)
{
	uint32_t	cnt;
	uint64_t	*pDest;

    cnt = (( uint32_t)(STDBYRAM_SIZE)) / 8U;
    pDest = (uint64_t *)(STDBYRAM_START);
    while (cnt--)
    {
		*pDest = (uint64_t)0x00;
		pDest++;
    }
}

/*
 * start_Bootup_Application
 * */
void Bootup_Application(const uint32_t app_StarAddress)
  {
	uint32_t appEntry, appStack;
  	static void (*jump_to_application)(void);

    /* 获取栈地址 */
    appStack = *((uint32_t *)(app_StarAddress));

    /* 获取app入口地址 */
    appEntry = *((uint32_t *)(app_StarAddress + 4));

  	/*把应用程序入口地址赋值给函数指针*/
  	jump_to_application = (void (*)(void))appEntry;

  	/* 重新定向中断向量表 */
  	S32_SCB-&amp;gt;VTOR = (uint32_t)app_StarAddress;

  	/* 关闭全局中断    ASM_KEYWORD("cpsid i");   */
  	__asm volatile ("cpsid i" : : : "memory");

  	/* 设置栈指针  */
  	__asm volatile ("MSR msp, %0\n" : : "r" (appStack) : "memory");
  	__asm volatile ("MSR psp, %0\n" : : "r" (appStack) : "memory");

  	/*跳转*/
  	jump_to_application();
	while (1)
	{
		Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 1U);	/* 运行到此处说明发生错误 */
	}
}

/* app_linker */
MEMORY 
{         
    int_flash               : ORIGIN = 0x00400000 + 0x00010000 + 0x200, LENGTH = 0x001D4000 - 0x00010000 - 0x200  /* 2048K - 176K (sBAF + HSE)*/
    int_itcm                : ORIGIN = 0x00000000, LENGTH = 0x00008000    /* 32K */
    int_dtcm                : ORIGIN = 0x20000000, LENGTH = 0x00010000    /* 64K */
    int_sram                : ORIGIN = 0x20400000, LENGTH = 0x00006F00    /* 27 KB */
    int_sram_fls_rsv        : ORIGIN = 0x20406F00, LENGTH = 0x00000100    
    int_sram_stack_c0       : ORIGIN = 0x20407000, LENGTH = 0x00001000    
    int_sram_no_cacheable   : ORIGIN = 0x20408000, LENGTH = 0x00007F00    /* 32kb , needs to include int_results  */
    int_sram_results        : ORIGIN = 0x2040FF00, LENGTH = 0x00000100    
    int_sram_shareable      : ORIGIN = 0x20410000, LENGTH = 0x00008000    /* 32KB */
    ram_rsvd2               : ORIGIN = 0x20418000, LENGTH = 0             /* End of SRAM */
}

/* app_main.c  */
void TestDelay(uint32 delay);
void TestDelay(uint32 delay)
{
    static volatile uint32 DelayTimer = 0;
    while (DelayTimer&amp;lt;delay)
    {
        DelayTimer++;
    }
    DelayTimer=0;
}

/**
* @brief        Main function of the example
* @details      Initializez the used drivers and uses the Icu
*               and Dio drivers to toggle a LED on a push button
*/
int main(void)
{
    /* Initialize all pins using the Port driver */
    Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);

    while (1)
    {
        Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 1U);
        TestDelay(4800000);
        Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 0U);
        TestDelay(4800000);
    }

    //Exit_Example(TRUE);
    return (0U);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 02:58:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/How-can-I-get-bootloader-example-for-S32K3XX/m-p/1621307#M21582</guid>
      <dc:creator>lihuagang</dc:creator>
      <dc:date>2023-03-24T02:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get bootloader example for S32K3XX</title>
      <link>https://community.nxp.com/t5/S32K/How-can-I-get-bootloader-example-for-S32K3XX/m-p/1621310#M21583</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello,Sir!&lt;/SPAN&gt;&lt;SPAN&gt;This&amp;nbsp; is my attachment，Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 03:00:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/How-can-I-get-bootloader-example-for-S32K3XX/m-p/1621310#M21583</guid>
      <dc:creator>lihuagang</dc:creator>
      <dc:date>2023-03-24T03:00:37Z</dc:date>
    </item>
  </channel>
</rss>

