0

MPLAB 使用 procdefs.ld 作为加载程序配置文件:

/*************************************************************************
 * Processor-specific object file.  Contains SFR definitions.
 *************************************************************************/
INPUT("processor.o")

/*************************************************************************
 * For interrupt vector handling
 *************************************************************************/
PROVIDE(_vector_spacing = 0x00000001);
_ebase_address  = 0x9D00F000;

/*************************************************************************
 * Memory Address Equates
 *************************************************************************/
_RESET_ADDR              = 0x9D00E000;
_BEV_EXCPT_ADDR          = 0x9D00E380;
_DBG_EXCPT_ADDR          = 0x9D00E480;
_DBG_CODE_ADDR           = 0xBFC02000;
_GEN_EXCPT_ADDR          = _ebase_address + 0x180;

/*************************************************************************
 * Memory Regions
 *
 * Memory regions without attributes cannot be used for orphaned sections.
 * Only sections specifically assigned to these regions can be allocated
 * into these regions.
 *************************************************************************/
MEMORY
{
  kseg0_program_mem    (rx)  : ORIGIN = 0x9D011000, LENGTH = 0x7A000    /* main */
  kseg0_boot_mem             : ORIGIN = 0x9D00E490, LENGTH = 0x7F0      /* startup code */
  exception_mem              : ORIGIN = 0x9D00F000, LENGTH = 0x1000
  kseg1_boot_mem             : ORIGIN = 0x9D00E000, LENGTH = 0x490
  debug_exec_mem             : ORIGIN = 0xBFC02000, LENGTH = 0xFF0
  config3                    : ORIGIN = 0xBFC02FF0, LENGTH = 0x4
  config2                    : ORIGIN = 0xBFC02FF4, LENGTH = 0x4
  config1                    : ORIGIN = 0xBFC02FF8, LENGTH = 0x4
  config0                    : ORIGIN = 0xBFC02FFC, LENGTH = 0x4
  kseg1_data_mem       (w!x) : ORIGIN = 0xA0000000, LENGTH = 0x20000
  sfrs                       : ORIGIN = 0xBF800000, LENGTH = 0x100000
}

但是当我尝试在 MPLABX 中使用同一个文件时,我得到了多个错误:

"C:\Program Files (x86)\Microchip\MPLAB C32 Suite\bin\pic32-gcc.exe"   -mprocessor=32MX695F512L  -o dist/default/production/NuWavDSDjr.X.production.elf build/default/production/_ext/2049610667/init.o build/default/production/_ext/2049610667/ir_rx.o build/default/production/_ext/2049610667/timer.o build/default/production/_ext/2049610667/uart.o build/default/production/_ext/2049610667/BLinterface.o build/default/production/_ext/2049610667/uart2.o build/default/production/_ext/65885567/FSIO.o build/default/production/_ext/1295770447/Delay.o build/default/production/_ext/1295770447/Helpers.o build/default/production/_ext/1295770447/Reboot.o build/default/production/_ext/1295770447/Tick.o build/default/production/_ext/1295770447/SPIEEPROM.o build/default/production/_ext/1295770447/SPIFlash.o build/default/production/_ext/1295770447/SPIRAM.o build/default/production/_ext/713068069/usb_host.o build/default/production/_ext/1726182412/usb_host_msd.o build/default/production/_ext/1726182412/usb_host_msd_scsi.o build/default/production/_ext/1472/USB.o build/default/production/_ext/1472/main.o build/default/production/_ext/1472/settings.o build/default/production/_ext/1472/exceptions.o build/default/production/_ext/1472/trigger.o build/default/production/_ext/1472/boot_load_hex.o build/default/production/_ext/1472/usb_config.o build/default/production/_ext/1472/a2dPP.o build/default/production/_ext/1472/logoPP.o build/default/production/_ext/1504692182/PowerPlay_Infrared.o build/default/production/_ext/1504692182/PowerPlay_Main.o build/default/production/_ext/1504692182/PowerPlay_Unit.o build/default/production/_ext/1472/SSD1309.o build/default/production/_ext/1472/mpc4802.o build/default/production/_ext/1472/AmpCtl.o build/default/production/_ext/1472/Xmos.o build/default/production/_ext/1472/Led.o build/default/production/_ext/1472/Relay.o build/default/production/_ext/1472/XMOS_flash.o build/default/production/_ext/1472/MENU.o build/default/production/_ext/1472/CPLD.o build/default/production/_ext/1472/XMOS_pgm.o build/default/production/_ext/1472/Knob.o build/default/production/_ext/1472/FPGA.o build/default/production/_ext/1472/DSD_DAC.o build/default/production/_ext/1472/queue.o build/default/production/_ext/1472/Si5338.o build/default/production/_ext/1472/i2c.o   ..\..\Microchip\Crypto\AES_PIC32MX.a    -Wl,--defsym=__MPLAB_BUILD=1,--script="..\procdefs.ld",--defsym=_min_heap_size=16000,--defsym=_min_stack_size=2048,-L"..",-L".",-Map="dist/default/production/NuWavDSDjr.X.production.map"
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib/crt0.o: In function `_no_nmi':
crt0.S:(.startup+0x20): undefined reference to `_stack'
crt0.S:(.startup+0x24): undefined reference to `_stack'
crt0.S:(.startup+0x28): undefined reference to `_gp'
crt0.S:(.startup+0x2c): undefined reference to `_gp'
crt0.S:(.startup+0x5c): undefined reference to `_bss_begin'
crt0.S:(.startup+0x60): undefined reference to `_bss_begin'
crt0.S:(.startup+0x64): undefined reference to `_bss_end'
crt0.S:(.startup+0x68): undefined reference to `_bss_end'
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib/crt0.o: In function `_bss_check':
crt0.S:(.startup+0x94): undefined reference to `_data_image_begin'
crt0.S:(.startup+0x98): undefined reference to `_data_image_begin'
crt0.S:(.startup+0x9c): undefined reference to `_data_begin'
crt0.S:(.startup+0xa0): undefined reference to `_data_begin'
crt0.S:(.startup+0xa4): undefined reference to `_data_end'
crt0.S:(.startup+0xa8): undefined reference to `_data_end'
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib/crt0.o: In function `_init_check':
crt0.S:(.startup+0xd0): undefined reference to `_ramfunc_length'
crt0.S:(.startup+0xd4): undefined reference to `_ramfunc_length'
crt0.S:(.startup+0xe0): undefined reference to `_ramfunc_image_begin'
crt0.S:(.startup+0xe4): undefined reference to `_ramfunc_image_begin'
crt0.S:(.startup+0xe8): undefined reference to `_ramfunc_begin'
crt0.S:(.startup+0xec): undefined reference to `_ramfunc_begin'
crt0.S:(.startup+0xf0): undefined reference to `_ramfunc_end'
crt0.S:(.startup+0xf4): undefined reference to `_ramfunc_end'
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib/crt0.o: In function `_ramfunc_check':
crt0.S:(.startup+0x114): undefined reference to `_bmxdkpba_address'
crt0.S:(.startup+0x118): undefined reference to `_bmxdkpba_address'
crt0.S:(.startup+0x128): undefined reference to `_bmxdudba_address'
crt0.S:(.startup+0x12c): undefined reference to `_bmxdudba_address'
crt0.S:(.startup+0x13c): undefined reference to `_bmxdupba_address'
crt0.S:(.startup+0x140): undefined reference to `_bmxdupba_address'
C:\Program Files (x86)\Microchip\MPLAB C32 Suite\bin\..\lib\gcc\pic32mx\3.4.4\..\..\..\..\pic32mx\bin\ld.exe: small-data section exceeds 64KB; lower small-data size limit (see option -G)
build/default/production/_ext/2049610667/ir_rx.o: In function `IR_RX_Init':
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:116: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:117: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:118: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:119: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:120: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:121: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:122: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:123: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:124: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:125: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:141: additional relocation overflows omitted from the output
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib\libc.a(sbrk.o): In function `_stub_sbd_memlayout':
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._stub_sbd_memlayout+0x4): undefined reference to `_heap'
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._stub_sbd_memlayout+0x10): undefined reference to `_heap'
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib\libc.a(sbrk.o): In function `_sbrk_init':
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._sbrk_init+0x38): undefined reference to `_end'
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._sbrk_init+0xf4): undefined reference to `_end'
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._sbrk_init+0x3c): undefined reference to `_end'
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._sbrk_init+0xbc): undefined reference to `_end'
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._sbrk_init+0xc4): undefined reference to `_end'
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib\libc.a(sbrk.o):/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._sbrk_init+0x108): more undefined references to `_end' follow
make[2]: *** [dist/default/production/NuWavDSDjr.X.production.hex] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
nbproject/Makefile-default.mk:648: recipe for target 'dist/default/production/NuWavDSDjr.X.production.hex' failed
make[2]: Leaving directory 'C:/projects/073 NuWavDSDjr-FPGAtest/NuWavDSDjr/NuWavDSDjr.X'
nbproject/Makefile-default.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/projects/073 NuWavDSDjr-FPGAtest/NuWavDSDjr/NuWavDSDjr.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed

BUILD FAILED (exit value 2, total time: 25s)

如何为 MPLABX 定义加载程序配置文件?mplabx 需要做哪些改变?

4

1 回答 1

0

我建议更改为当前版本的 xc32 v1.40,C32 相当旧。在我的目录“C:\Program Files (x86)\Microchip\xc32\v1.40\examples\xc32_examples\custom_ld_file”的盒子上是一个带有自定义 .ld 文件示例的示例项目,其中的注释可能会有所帮助。如果您无法/不愿意更改为 xc32,我建议您继续使用 MpLAB IDE 和 C32 即可。X 的包含路径完全不同。

于 2016-02-10T17:40:43.613 回答