Howdy,<br> I'm a beginner of embedded system. I'm working on a board of Walnut PPC405GP which use PPCBOOT <a href="http://1.1.2.">1.1.2.</a><br>One day I tried to write some data into unused area of the flash: <br>
<br>>> fli<br>Bank # 1: AMD AM29F040 (512 Kbit, uniform sector size)<br> Size: 512 KB in 8 Sectors<br> Sector Start Addresses:<br> FFF80000 RO FFF90000 RO FFFA0000 RO FFFB0000 FFFC0000 <br> FFFD0000 FFFE0000 FFFF0000 <br>
<br>I use the last sector:<br>>> md ffff0000<br>ffff0000: 00000000 00000000 00000000 00000000 ................<br>ffff0010: 00000000 00000000 00000000 00000000 ................<br>ffff0020: 00000000 00000000 00000000 00000000 ................<br>
ffff0030: 00000000 00000000 00000000 00000000 ................<br>ffff0040: 00000000 00000000 00000000 00000000 ................<br>ffff0050: 00000000 00000000 00000000 00000000 ................<br>ffff0060: 00000000 00000000 00000000 00000000 ................<br>
ffff0070: 00000000 00000000 00000000 00000000 ................<br>ffff0080: 00000000 00000000 00000000 00000000 ................<br>ffff0090: 00000000 00000000 00000000 00000000 ................<br>ffff00a0: 00000000 00000000 00000000 00000000 ................<br>
ffff00b0: 00000000 00000000 00000000 00000000 ................<br>ffff00c0: 00000000 00000000 00000000 00000000 ................<br>ffff00d0: 00000000 00000000 00000000 00000000 ................<br>ffff00e0: 00000000 00000000 00000000 00000000 ................<br>
ffff00f0: 00000000 00000000 00000000 00000000 ................<br><br>>> protected off ffff0000 ffffffff<br>Un-Protected 1 sectors<br>>> erase ffff0000 ffffffff<br>Erase Flash from 0xffff0000 to 0xffffffff <br>
Erasing sector ffff0000<br>. done<br>Erased 1 sectors<br><br>!! Now I tried to copy a small file data to this area by using tftp.<br>>> tftp ffff0000 data_file<br>405GP Eth Status:<br> data len error 0<br> rx frames 0<br>
rx 0<br> rx_prot_err 0<br> int_err 0<br> tx_err_log:<br> [0] 0<br> [1] 0<br> [2] 0<br> [3] 0<br> [4] 0<br> [5] 0<br> [6] 0<br> [7] 0<br> [8] 0<br> [9] 0<br> rx_err_log:<br>
[0] 0<br> [1] 0<br> [2] 0<br> [3] 0<br> [4] 0<br> [5] 0<br> [6] 0<br> [7] 0<br> [8] 0<br> [9] 0<br><br>ENET Speed is 100 Mbps - FULL duplex connection<br>*** ERROR: `ipaddr' not set<br>
Well, set the target addr first, then:<br><br>>> dhcp<br>405GP Eth Status:<br> data len error 0<br> rx frames 0<br> rx 0<br> rx_prot_err 0<br> int_err 0<br> tx_err_log:<br> [0] 0<br> [1] 0<br> [2] 0<br>
[3] 0<br> [4] 0<br> [5] 0<br> [6] 0<br> [7] 0<br> [8] 0<br> [9] 0<br> rx_err_log:<br> [0] 0<br> [1] 0<br> [2] 0<br> [3] 0<br> [4] 0<br> [5] 0<br> [6] 0<br>
[7] 0<br> [8] 0<br> [9] 0<br><br>ENET Speed is 100 Mbps - FULL duplex connection<br>BOOTP broadcast 1<br>DHCPHandler: got packet: (src=67, dst=68, len=548) state: 3<br>Filtering pkt = 0<br>DHCPHandler: got DHCP packet: (src=67, dst=68, len=548) state: 3<br>
DHCP: state=SELECTING bp_file: "uImage"<br>TRANSITIONING TO REQUESTING STATE<br>Bootfile: uImage<br>DhcpSendRequestPkt: Sending DHCPREQUEST<br>Transmitting DHCPREQUEST packet: len = 308<br>DHCPHandler: got packet: (src=67, dst=68, len=548) state: 4<br>
Filtering pkt = 0<br>DHCPHandler: got DHCP packet: (src=67, dst=68, len=548) state: 4<br>DHCP State: REQUESTING<br>Bootfile: uImage<br>DHCP client bound to address <a href="http://192.168.1.201">192.168.1.201</a><br>ARP broadcast 1<br>
Got good ARP - start TFTP<br>TFTP from server <a href="http://192.168.1.200">192.168.1.200</a>; our IP address is <a href="http://192.168.1.201">192.168.1.201</a><br>Filename 'uImage'.<br>Load address: 0xffff0000<br>
Loading: *##############NIP: 00000200 XER: 00000000 LR: 67E12A71 REGS: 01faea48 TRAP: 0700 DAR: 00080000<br>MSR: 00000000 EE: 0 PR: 0 FP: 0 ME: 0 IR/DR: 00<br><br>GPR00: 00000001 01FAEB38 40000000 01FAEB48 80000000 00000002 01FB016D 01C80764 <br>
GPR08: 01FF5060 01FF5074 FFFFFFFF 01FF54B4 00000000 7C6BFE6C 01FF4400 02050000 <br>GPR16: E45EA284 DC212086 02CACA22 F3844306 00001000 01FAEB38 00000000 67E12A71 <br>GPR24: 76585F5E 00000001 00000000 01FAEF8C 00000004 00000000 01FF44CC 01FF52A4 <br>
** Illegal Instruction **<br>Call backtrace: <br>Program Check Exception<br><br> ========================<br>You can see my mistake...>_< A big uImage file is copied to flash, rather than data_file.<br>After that, the Walnut board cannot boot anymore... I wonder why. The data is simply copied to<br>
the unused sector, while other sectors are under protection. It should be safe even if I made mistakes.<br><br>Thank you very much.<br>---<br>ShenLei<br><br><br><br>