Thank you for your reply。I follow your way to build binary image.All my data BAM has to return,but when the data transmission is completed, the microcontroller is not running.
MEMORY
{
init: org = 0x40000000, len = 0x00001000 //4k
exception_handlers: org = 0x40001000, len = 0x00001000
pseudo_rom: org = 0x40002000, len = 0x00001000
internal_ram: org = 0x40003000, len = 0x00001000
heap : org = 0x40004000, len = 0x00001000 // Heap start location
stack : org = 0x40005000, len = 0x00001000 // Start location for Stack
}
If i delete start.c this paragraph
li r16, 0
li r17, 0
li r18, 0
li r19, 0
li r20, 0
li r21, 0
li r22, 0
li r23, 0
li r24, 0
li r25, 0
li r26, 0
li r27, 0
li r28, 0
li r29, 0
li r30, 0
li r31, 0
//init internal_ram,heap,steak
lis r11,0x4000
ori r11,r11,0x3000 //Load strat address 0x4000_3000
li r12,0xc0 //12k/4 bytes/16 GPRs = 192 = 0xc0.
mtctr r12
init_SRAM_loop:
stmw r16,0(r11)
addi r11,r11,0x40 //increment the ram pointer by 64 bytes
bdnz init_SRAM_loop
//init exception_handlers
lis r11,0x4000
ori r11,r11,0x1000 //Load strat address 0x4000_1000
li r12,0x40 //4k/4 bytes/16 GPRs = 64 = 0x40.
mtctr r12
init_excep_loop:
stmw r16,0(r11)
addi r11,r11,0x40 //increment the ram pointer by 64 bytes
bdnz init_excep_loop
The program can be run by JTAG download, but can not be run through BAM download.
If I add this paragraph, through the BAM program can not run properly, through JTAG can not run properly.
I mainly want to FLASH through the RAM to operate。
Save me, i really do not know that.