View previous topic :: View next topic |
Author |
Message |
Mikzi
Joined: 18 Jun 2014 Posts: 5
|
Data conflict when unifying hex files |
Posted: Tue Feb 10, 2015 1:26 am |
|
|
Hi all,
I’m trying to unify two hex files in MPLAB X but run into a "data conflict at address 300004h". I'm using the PIC18F45K50 and according to the datasheet address 300004h (config3L) is unimplemented so it should be all zeroes. The address does not show up in the PIC memory view window under Configuration bits, so I've been unable to tell which of the two projects modifies this region to cause the conflict.
The first project is Microchip's USB HID bootloader, the "pic18_non_j" version. I've modified the configuration bits to match the second project, but the code is otherwise unchanged. The first project is compiled with XC8 and the hex file is then added as a loadable to the second project which is compiled with CCS 5.0.
I'm using the internal oscillator of the 45K50. The first lines of code in my main project look like this:
Code: | #include "18F45K50.h"
#device ADC=10
#fuses INTRC, WDT, PROTECT
#use delay(internal=48MHz)
// Changes required for bootloader
#define CODE_START 0x1000
#build(reset=CODE_START, interrupt=CODE_START+0x08)
#org 0, CODE_START-1 {} |
Do you have any ideas how I can remove the data conflict? Thanks! |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9269 Location: Greensville,Ontario
|
|
Posted: Tue Feb 10, 2015 6:23 am |
|
|
Quick answer with a note...
OK, I don't use Mplab X, uchips HID, XC or ccs v5 ..but..
I have a very hard time thinking you can just 'merge' the bootloader and a ccs c code.
I'm pretty sure CCS has a USB bootloader,other will KNOW, but it sounds improbable you can create code in two different C's using two different compilers and simply 'merge'.
Though I haven't looked , unimplemented cells in a PIC usually are 1's not 0's and if not used why do you think a program can put something there?
The easy,workable solution is to go 100% CCS C. Be aware that version 5 had it's 'quirks' in the early numbers....
Jay |
|
|
Mikzi
Joined: 18 Jun 2014 Posts: 5
|
|
Posted: Tue Feb 10, 2015 6:41 am |
|
|
Thanks for your answer, Jay. CCS includes an USB virtual comport bootloader in the example folder, but I need an USB HID bootloader for this project.
Microchip's USB HID bootloader is working fine, but it would be a major convenience if I could merge its hex file with my CCS project. |
|
|
Mikzi
Joined: 18 Jun 2014 Posts: 5
|
|
Posted: Wed Feb 11, 2015 2:44 pm |
|
|
Success! I was able to merge the XC8 bootloader with my CCS project by removing all the config data from the bootloader project. For this to work I needed to remove the #pragma configs and also uncheck the XC8 linker setting "Program the device with default config words". |
|
|
|