This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工程已经添加了库 rts32earm9.lib ,并设置堆栈大小都是0x1000
printf() 函数始终无法输出
添加了 #include <stdio.h>,也没有使用DSP/BIOS
把文件贴出来看看:
CMD文件
-e _boot
IRAMStart = 0x80000000;
IRAMSize = 0x00020000;
DDRStart = 0xc0000000;
DDRSize = 0x04000000;
DRAMStart = 0x80000000;
_DRAMSize = 0x00020000;
STACKStart = IRAMStart + IRAMSize;
_NAND_EMIFStart = 0x62000000;
_NOR_EMIFStart = 0x60000000;
MEMORY
{
ARM_INTERNAL_RAM (RWXI): origin = 0x80000000 length = 0x0001FFFF
SDRAM (RWXI): org=0xc0000000 length = 0x02000000
}
SECTIONS
{
.boot: load = 0x80000000
.text: load > ARM_INTERNAL_RAM
.data: load > ARM_INTERNAL_RAM
.bss: load > ARM_INTERNAL_RAM
}
入口文件:
extern void boot( void ) __attribute__((naked,section(".boot")));
void boot(void)
{
asm(" .global STACKStart");
asm(" .global _stack");
asm(" .global main");
asm(" NOP");
asm(" MRS r0, cpsr");
asm(" BIC r0, r0, #0x1F"); // CLEAR MODES
asm(" ORR r0, r0, #0x13"); // SET SUPERVISOR mode
asm(" ORR r0, r0, #0xC0"); // Disable FIQ and IRQ
asm(" MSR cpsr, r0");
asm(" NOP");
// Set the IVT to low memory, leave MMU & caches disabled
asm(" MRC p15,#0,r0,c1,c0,#0");
asm(" BIC r0,r0,#0x00002300");
asm(" BIC r0,r0,#0x00000087");
asm(" ORR r0,r0,#0x00000002");
asm(" ORR r0,r0,#0x00001000");
asm(" MCR p15,#0,r0,c1,c0,#0");
asm(" NOP");
// Setup the stack pointer
asm(" LDR sp,_stack");
asm(" SUB sp,sp,#4");
asm(" BIC sp, sp, #7");
// Call to main entry point
main();
asm("_stack:");
asm(" .word STACKStart");
}
请指点一下到底哪里有问题?