The boot loader via Ethernet

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

The boot loader via Ethernet

跳至解决方案
2,247 次查看
小勇邹
Contributor II


I run the boot loader example according to the document "AN4367".The boot loader example is based on FNET stack.

The PC pings the MCU successfully.The MCU always shows that "TFTP Error: Code 0 "Connection failed" when running the command "tftp".

I use the tool "wireshark" to capture the Ethernet data. The tool does not find the "tftp" request that is based on UDP protocol.

Can you help me find out the problem?

Remark:

1,RMII mode is selected in the TWR-K60N512.

标签 (1)
0 项奖励
1 解答
1,748 次查看
butok
NXP Employee
NXP Employee

Most probably, it is caused by a firewall/antivirus on your PC, which you are using as the TFTP server. Just disable it.

在原帖中查看解决方案

0 项奖励
9 回复数
1,748 次查看
小勇邹
Contributor II

Thank you very much.Yes,it is caused by the firewall/antivirus on my PC.

0 项奖励
1,749 次查看
butok
NXP Employee
NXP Employee

Most probably, it is caused by a firewall/antivirus on your PC, which you are using as the TFTP server. Just disable it.

0 项奖励
1,748 次查看
logancheng
Contributor I

Hi Andrey:

I have been using FNET for firmware update and it works very well with tftp client (from tftpd32.jounin.net) mentioned in the documentation.

But when I tried to use Windows 7's tftp client tool, the update process could not be completed successfully. The erasing was successful,

but after erasing no more messages were displayed and the erasing repeated several times and then stopped.

My question: Does FNET support Windows 7's tftp client tool for data transfer?


Best regards!


Logan Cheng

0 项奖励
1,748 次查看
butok
NXP Employee
NXP Employee

I still use Tftpd32 tool on Windows 7. Not perfect, but works.

Did not check it with Windows native tFTP tool (you may take it as not supported).

0 项奖励
1,748 次查看
小勇邹
Contributor II

Dear Andrey,

I have modified the FNET2.6.5 and only use the tftp server
function to download the firmware.

All the printf functions and serial command functions are
disabled.

I want to add watch dog function to FNET2.6.5.

I set the period of watch dog as 100ms.

I refresh the watch dog in the functions:

1,fapp_main;

2,fnet_flash_erase;

3,fnet_flash_write_low;

4,fnet_memcpy.

Where also should I refresh the watch dog for the
fnet_stack source code(especially for the Ethernet protocol stack source
code)?

Best regards.

Robin Zou.

0 项奖励
1,748 次查看
butok
NXP Employee
NXP Employee

>>Where also should I refresh the watch dog for the

I would added it to fnet_timer_ticks_inc() - occurs every FNET timer period (100ms by default).

0 项奖励
1,748 次查看
小勇邹
Contributor II

Dear Andrey,

I make the boot loader example run in the TWR-K60N512.

The boot loader can download the image in the project fnet\fnet_demos\shell_boot.ewp .

The application firmware runs normally after downloading.

I replace the image with the one(in the attachment) in the demo project “TWR-K60N512_Quick_Start_Demo” that is provided by Freescale in the TWR-K60N512.

The application firmware cannot run normally after downloading. And the boot loader firmware resets again and again.

I modify the source code in the boot loader firmware.

Replace “(( void()() )FNET_CPU_INSTRUCTION_ADDR(address))(); / Jump. */” with

“JumpToUserApplication(((unsigned long)0xC000), ((unsigned long)( 0xC000 +4)));”

void JumpToUserApplication(unsigned long userSP, unsigned long userStartup)

{

// set up stack pointer

__asm("msr msp, r0");

__asm("msr psp, r0");

// Jump to PC (r1)

__asm("mov pc, r1");

}

The application firmware can run normally after downloading after I modify the boot loader firmware.

I do not know what is the reason.

Can you help me find out it?

Best regards.

Robin Zou.

Robin-XiaoYong Zou

ABB Xiamen Low Voltage Equipment Company Limited

BU LPLS E&D China

No. 12-20,3rd Chuang Xin Road Xiamen SEZ,Fujian 361006 P.R.China

CN

Phone: +86 592 5767877

Telefax: +86 592 6038110

Mobile: +86 181-5089-3720

email: robin-xiaoyong.zou@cn.abb.com<mailto:robin-xiaoyong.zou@cn.abb.com>

0 项奖励
1,748 次查看
小勇邹
Contributor II

Dear Andrey,

I make the boot loader example run in the .

The application firmware can not run normally after downloading.And the boot loader firmware resets again and again.

I modify the source code in the boot loader firmware.

Replace “(( void()() )FNET_CPU_INSTRUCTION_ADDR(address))(); / Jump. */” with

“JumpToUserApplication(((unsigned long)0xC000), ((unsigned long)( 0xC000 +4)));”

void JumpToUserApplication(unsigned long userSP, unsigned long userStartup)

{

// set up stack pointer

__asm("msr msp, r0");

__asm("msr psp, r0");

// Jump to PC (r1)

__asm("mov pc, r1");

}

The application firmware can run normally after downloading after I modify the boot loader firmware.

I do not know what is the reason.

Can you help me find out it?

Best regards.

Robin Zou.

Robin-XiaoYong Zou

ABB Xiamen Low Voltage Equipment Company Limited

BU LPLS E&D China

No. 12-20,3rd Chuang Xin Road Xiamen SEZ,Fujian 361006 P.R.China

CN

Phone: +86 592 5767877

Telefax: +86 592 6038110

Mobile: +86 181-5089-3720

email: robin-xiaoyong.zou@cn.abb.com<mailto:robin-xiaoyong.zou@cn.abb.com>

0 项奖励
1,748 次查看
小勇邹
Contributor II

Hello Andrey,

The firmware is downloaded successfully.But there is an error when writing the flash.

TFTP downloading 'TWR-K60N512_Quick_Start_Demo.srec' (srec) from 192.168.1.1: /
Writing 16 bytes to 0x000414D0 failed!

TFTP Error: Code 512 "D5F8A800401CC5F8A800002000905B468C
S2140414D03A0001212000FFF74BFA002488E0A068B8
S2140414E008280AD2A868401CA860A86D401CA865F5
S2140414F06068616809688847D2E0BAF90400C0BA2F
S214041500BAF90610C9BAD5F8C07000E0BF68002F53
S2140415101DD03A8D80B28242F8D17A8D89B28A4241
S214041520F4D1B868002802D0F868B968C860B8680A
S214041530F968086017F11000FEF719FDFFF7ADF91A
S214041540796A401A786200213800F0F7D4FA4FE03E
S214041550D0460120A7681C2F4AD31AF10809083F71
S21404156099F80910042915D199F8001011F00F0103
S214041570890011*".

What is the problem?

0 项奖励