It is currently Sun Oct 26, 2014 4:36 am



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: SOLVED — Using MPIDE with chipKIT PGM
PostPosted: Mon May 19, 2014 11:56 am 
Offline
Site Admin

Joined: Sat Jul 16, 2011 10:19 am
Posts: 280
I'd like to use the chipKIT PGM to upload and debug sketches developed with MPIDE. The procedure exposed here is quite complicated as it involves MPLabX.

MPIDE includes link scripts for the chipKIT with no boot-loader.

Image

I've edited the boards.txt file adapting this post (Oct 13, 2011)

Code:
############################################################
uno_pic32_dbg.name=chipKIT UNO32 - MPLAB Debug

# new items
uno_pic32_dbg.group=chipKIT
uno_pic32_dbg.platform=pic32
uno_pic32_dbg.board=_BOARD_UNO_
uno_pic32_dbg.board.define=
uno_pic32_dbg.compiler.define=
uno_pic32_dbg.ccflags=ffff
uno_pic32_dbg.ldscript=chipKIT-application-32MX320F128-nobootloader.ld
# end of new items

# Use a high -Gnum for devices that have less than 64K of data memory
# For -G1024, objects 1024 bytes or smaller will be accessed by
# gp-relative addressing
uno_pic32_dbg.compiler.c.flags=-O0::-c::-mno-smart-io::-w::-ffunction-sections::-fdata-sections::-G1024::-g::-mdebugger::-Wcast-align::-fno-short-double
uno_pic32_dbg.compiler.cpp.flags=-O0::-c::-mno-smart-io::-w::-fno-exceptions::-ffunction-sections::-fdata-sections::-G1024::-g::-mdebugger::-Wcast-align::-fno-short-double

uno_pic32_dbg.upload.protocol=stk500v2
uno_pic32_dbg.upload.maximum_size=126976
uno_pic32_dbg.upload.speed=115200

uno_pic32_dbg.bootloader.low_fuses=0xff
uno_pic32_dbg.bootloader.high_fuses=0xdd
uno_pic32_dbg.bootloader.extended_fuses=0x00
uno_pic32_dbg.bootloader.path=not-supported
uno_pic32_dbg.bootloader.file=not-supported
uno_pic32_dbg.bootloader.unlock_bits=0x3F
uno_pic32_dbg.bootloader.lock_bits=0x0F

uno_pic32_dbg.build.mcu=32MX320F128H
uno_pic32_dbg.build.f_cpu=80000000L
uno_pic32_dbg.build.core=pic32
uno_pic32_dbg.build.variant=Uno32
#uno_pic32_dbg.upload.using=


Compilation runs fine but link fails with the following message:

Code:
/Applications/Mpide.app/Contents/Resources/Java/hardware/pic32/compiler/pic32-tools/bin/../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/bin/ld: address 0x9d001010 of Blink.cpp.elf section `.reset' is not within region `kseg1_boot_mem'
/Applications/Mpide.app/Contents/Resources/Java/hardware/pic32/compiler/pic32-tools/bin/../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/bin/ld: address 0x9d001010 of Blink.cpp.elf section `.reset' is not within region `kseg1_boot_mem'
/Applications/Mpide.app/Contents/Resources/Java/hardware/pic32/compiler/pic32-tools/bin/../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/bin/ld: section .startup loaded at [9d001000,9d0011df] overlaps section .reset loaded at [9d001000,9d00100f]
collect2: ld returned 1 exit status


Any clue of what's going wrong?


Top
 Profile  
 
 Post subject: Re: Help! Using MPIDE with chipKIT PGM
PostPosted: Mon May 19, 2014 6:16 pm 
Offline
User avatar

Joined: Wed Nov 09, 2011 7:51 pm
Posts: 1211
Location: UK
Looks like the linker script is wrong.

It has:
Code:
_RESET_ADDR             = ORIGIN(kseg0_program_mem);

and yet reset is placed in:
Code:
 
  /* Boot Sections */
  .reset _RESET_ADDR :
  {
    KEEP(*(.reset))
  } > kseg1_boot_mem

but kseg1_boot_mem is at
Code:
  kseg1_boot_mem             : ORIGIN = 0xBFC00000, LENGTH = 0x490


I think _RESET_ADDR should be ORIGIN(kseg1_boot_mem)...

_________________
Why not visit my eBay shop? http://stores.ebay.co.uk/Majenko-Technologies
Universal IDE: http://uecide.org


Top
 Profile  
 
 Post subject: Re: Help! Using MPIDE with chipKIT PGM
PostPosted: Mon May 19, 2014 7:48 pm 
Offline
Site Admin

Joined: Sat Jul 16, 2011 10:19 am
Posts: 280
Thank you for your answer.

As posted before, I've just adapted the boards.txt file but kept the .ld files from https://github.com/chipKIT32/chipKIT32- ... ores/pic32.

I'm going to open a ticket at https://github.com/chipKIT32/chipKIT32- ... state=open, so everyone can enjoy the solution.


Top
 Profile  
 
 Post subject: Re: Help! Using MPIDE with chipKIT PGM
PostPosted: Mon May 19, 2014 8:06 pm 
Offline
Site Admin

Joined: Sat Jul 16, 2011 10:19 am
Posts: 280
Ticket created at https://github.com/chipKIT32/chipKIT32-MAX/issues/458


Top
 Profile  
 
 Post subject: SOLVED — Using MPIDE with chipKIT PGM
PostPosted: Wed May 21, 2014 3:51 pm 
Offline
Site Admin

Joined: Sat Jul 16, 2011 10:19 am
Posts: 280
Thank you for your answer. It works!

Code:
_RESET_ADDR             = ORIGIN(kseg1_boot_mem);


See pull request at http://github.com/chipKIT32/chipKIT32-MAX/pull/459


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Theme designed by stylerbb.net © 2008
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All times are UTC [ DST ]