ISP Entry Methods in MCX N5xx EVK

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

ISP Entry Methods in MCX N5xx EVK

ソリューションへジャンプ
536件の閲覧回数
Avinpat123
Contributor I

Hi, I am using an N5xx EVK. I need to enter into ISP mode so that I can make use of the default UART for flashing my user application via blhost . I want to trigger ISP entry through a software method instead of using hardware pins

I tried Hardware method that is working fine (by pressing ISP button then reset board) but i need software method 

when we access via blhost command response was not there 

Avinpat123_0-1755671846901.png

 

Tried code follows

typedef void (*pBootloaderEntry)(void *arg);

 

#define BOOTLOADER_API_TREE_ADDR (0x1301fc00u)

#define BOOTLOADER_API_ENTRY ((pBootloaderEntry)(*(uint32_t *)(BOOTLOADER_API_TREE_ADDR)))

 

void EnterISP(void)

{

PRINTF("Jumping to ROM bootloader...\r\n");

 

__disable_irq();

 

// Jump into bootloader (ISP mode)

BOOTLOADER_API_ENTRY(0);

}

/*

* @brief Application entry point.

*/

int main(void)

{

/* Init board hardware. */

BOARD_InitBootPins();

BOARD_InitBootClocks();

BOARD_InitBootPeripherals();

 

#ifndef BOARD_INIT_DEBUG_CONSOLE_PERIPHERAL

/* Init FSL debug console. */

BOARD_InitDebugConsole();

#endif

 

PRINTF("Hello World2\r\n");

PRINTF("Send 'd' for firmware upgrade\r\n");

/* Enter an infinite loop, just incrementing a counter. */

while(1)

{

char ch = GETCHAR();

if (ch == 'd')

{

PRINTF("jump to bootloader...\r\n");

EnterISP();

}

}

return 0 ;

}

ラベル(1)
0 件の賞賛
返信
1 解決策
513件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Avinpat123 

To enter ISP mode, please use the runBootloader API.

Alice_Yang_0-1755679363032.png

Example:

In the application image boot process, regardless of whether the ISP pin is connected to the high level, the device will directly enter the ISP mode through the UART interface according to the parameter ISP Interface in arg.


#define ROM_API_TREE ((uint32_t*)0x1303fc00)

#define RUN_BOOTLOADER_API_TREE ((void (*)(void *)) ROM_API_TREE[0])

uint32_t arg = 0xEB120000; /*0xEB: represents Enter Boot; 0x12: represents enter ISP mode by UART only */

RUN_BOOTLOADER_API_TREE->runBootloader(&arg);


After the application image, which calls the above runBootloader API, has booted successfully, the device will only allow the UART interface to be connected to transfer the data with the host.

 

Thank you.

 

BR

Alice

 

 

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
514件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Avinpat123 

To enter ISP mode, please use the runBootloader API.

Alice_Yang_0-1755679363032.png

Example:

In the application image boot process, regardless of whether the ISP pin is connected to the high level, the device will directly enter the ISP mode through the UART interface according to the parameter ISP Interface in arg.


#define ROM_API_TREE ((uint32_t*)0x1303fc00)

#define RUN_BOOTLOADER_API_TREE ((void (*)(void *)) ROM_API_TREE[0])

uint32_t arg = 0xEB120000; /*0xEB: represents Enter Boot; 0x12: represents enter ISP mode by UART only */

RUN_BOOTLOADER_API_TREE->runBootloader(&arg);


After the application image, which calls the above runBootloader API, has booted successfully, the device will only allow the UART interface to be connected to transfer the data with the host.

 

Thank you.

 

BR

Alice

 

 

0 件の賞賛
返信
483件の閲覧回数
Avinpat123
Contributor I

Hi, Alice_yang thanks for the fast reply the solution you have provided that is working fine 
and final code solution is written below.

1. I have one more question the information you have provided for bootloader API can we know in which doc it was defined can you just share me a link for that one.

// **ISP ROM API ADDRESS FOR MCX N5XX EVK**

#define ROM_API_TREE ((uint32_t*)0x1303fc00)

#define RUN_BOOTLOADER_API_TREE ((void (*)(void *)) ROM_API_TREE[0])

 

/* TODO: insert other definitions and declarations here. */

 

void EnterISP(void)

{

PRINTF("Entering ISP mode via software trigger...\r\n");

 

// **CRITICAL: Use structured argument as per NXP Bootloader API specification**

uint32_t arg = 0xEB120000;

/*

* 0xEB12 0000 breakdown:// for ISP in UART interface only

* 0xEB11 0000 breakdown:// for ISP in USB HID interface only

* 0xEB = Enter Boot (Tag field [31:24])

* 1 = Enter ISP mode (Boot Mode field [23:20])

* 1 = USB HID Interface (ISP Interface field [19:16])

* 2 = UART interface (ISP Interface field [19:16])

* 0000 = Reserved/Image Index fields

*/

__disable_irq();

 

// Call NXP ROM bootloader API with correct argument

RUN_BOOTLOADER_API_TREE(&arg);

 

// Should never reach here

while(1);

}

 
0 件の賞賛
返信