• AVR Freaks

Helpful ReplyHot!Bootloader PIC18 MCC

Author
Enrique
New Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2012/04/17 07:19:35
  • Location: 0
  • Status: offline
2019/10/29 06:01:37 (permalink)
0

Bootloader PIC18 MCC

Hi. I’m new with MCC and bootloader. I followed the steps from DS40001779B document in https://www.microchip.com/promo/8-bit-bootloader
But, when I compile the project generated from MCC for PIC18F66K22, I have this error:
 
mcc_generated_files/pic18f_bootload.c:112:: error: (1349) initialization of absolute variable "_EE_Key_1" in RAM is not supported
mcc_generated_files/pic18f_bootload.c:113:: error: (1349) initialization of absolute variable "_EE_Key_2" in RAM is not supported

 
Why the code generated from MCC doesn’t work?
Thanks
#1
mbrowning
USNA79
  • Total Posts : 1584
  • Reward points : 0
  • Joined: 2005/03/16 14:32:56
  • Location: Melbourne, FL
  • Status: online
Re: Bootloader PIC18 MCC 2019/10/29 08:20:50 (permalink)
0
Why did you not tell us what MPLABX version, MCC version, and XC8 version and mode?
 
edit - I tried XC8 2.05 C99 mode with MCC 3.85.1, MPLABX 5.15 and saw no compile issues.
post edited by mbrowning - 2019/10/29 08:32:57
#2
Enrique
New Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2012/04/17 07:19:35
  • Location: 0
  • Status: offline
Re: Bootloader PIC18 MCC 2019/10/29 09:45:39 (permalink)
0
Hi, I compiled with MPLABX 5.25 - XC8 2.10 (C99) - MCC 3.85.1
In MCC I selected modules “Bootloader Generator”, “MEMORY” and “EUSART1” and no add any other code, only compile the MCC code auto generated. The PIC is 18F66K22
I’m attaching here the views of MCC:

Attached Image(s)

#3
mbrowning
USNA79
  • Total Posts : 1584
  • Reward points : 0
  • Joined: 2005/03/16 14:32:56
  • Location: Melbourne, FL
  • Status: online
Re: Bootloader PIC18 MCC 2019/10/29 11:44:52 (permalink)
0
I tried XC8 2.10 in both C90 and C99 modes and got the same error. Looking at the user manuals for versions 1.45 - 2.10, they all have this paragraph:
Absolute variables in RAM cannot be initialized when they are defined, and they are
not cleared by the runtime startup code. After defining absolute variables, assign them
an initial value at a suitable point in your main-line code, if required.

 
It seems that version 2.10 is the first one to actually enforce this in the source code. Whether previous versions actually initialize absolute variables I have no idea. I assumed they did, and I would think that if they didn't there would have been problems, but the manuals say not.
 
You could back up to 2.05 for the bootloader, or edit the .c file to fix the issue.
 
 
#4
dleess
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2019/04/26 11:39:08
  • Location: 0
  • Status: offline
Re: Bootloader PIC18 MCC 2019/10/29 11:58:26 (permalink) ☄ Helpfulby Vendettaval 2019/11/08 02:14:43
+1 (1)
Doing this got me around the issue for now.
uint8_t EE_Key_1 __at(0x0);
uint8_t EE_Key_2 __at(0x1);
 
I too am working on this boot loader today. With my own issues. 
Let me know if you hit the (944) data conflict at address 300000h issue.
post edited by dleess - 2019/10/29 12:04:12
#5
Danno
Super Member
  • Total Posts : 273
  • Reward points : 0
  • Joined: 2005/09/07 10:12:10
  • Status: offline
Re: Bootloader PIC18 MCC 2019/10/29 13:43:21 (permalink)
0
dleess  the data conflict is because there are different config bits in both the bootloader and project.  The easy way to address this is to only  have them in one place.
 
See chapter 5.1 of the bootloader generator's user's guide for all the steps to compile them out when building the combined part.  www.microchip.com/bootloader and follow the 8 bit links.
#6
Danno
Super Member
  • Total Posts : 273
  • Reward points : 0
  • Joined: 2005/09/07 10:12:10
  • Status: offline
Re: Bootloader PIC18 MCC 2019/10/29 13:53:47 (permalink)
0
Back to the original question.  This was due to a compiler change.  It worked up through V2.05, but broke in 2.10.   Thank you mbrowning for pointing out the restriction in the xc8 manual.  
 
The generated code will be updated with the next release.
#7
dleess
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2019/04/26 11:39:08
  • Location: 0
  • Status: offline
Re: Bootloader PIC18 MCC 2019/10/29 14:17:18 (permalink)
0
Danno Yes I followed the bootloader file and it had me add a #define around the config bits in the bootloader code and it removes that code but then the compiler detects that no config bits have been set and it automatically switches to using default values and still generates overlapping code. 
#8
Danno
Super Member
  • Total Posts : 273
  • Reward points : 0
  • Joined: 2005/09/07 10:12:10
  • Status: offline
Re: Bootloader PIC18 MCC 2019/10/29 16:42:26 (permalink) ☄ Helpfulby dleess 2019/10/30 13:49:51
+2 (2)
There's a switch to turn that off:
 
 

Attached Image(s)

#9
BL
Starting Member
  • Total Posts : 87
  • Reward points : 0
  • Joined: 2011/01/23 10:15:14
  • Location: 0
  • Status: offline
Re: Bootloader PIC18 MCC 2020/01/13 07:32:46 (permalink)
0
Hello,
 
I've a similar problem.
 
I've a project, that I haven't touvched for a year or more. Now I want compile that end suddenly the compiler says, he can't find the identifier "BOOTLOADER_INDICATOR" in the "pic18f_bootload.c". But, this is the firmware, not the bootloader. I don't integrated this pic18f_bootload.c in this project. The firmware know nothing of a bootlader. She looks in the first sequenz of the "void main" to a pin and is this low, she jumps to an address in the bootloader sector. Not more.
 
Where could the MCC or whoever involved this pic18f_bootload.c and can turn it back?


MPLABX5.30(in MPLABX4.01 it's the same)
XC1.34
#10
BL
Starting Member
  • Total Posts : 87
  • Reward points : 0
  • Joined: 2011/01/23 10:15:14
  • Location: 0
  • Status: offline
Re: Bootloader PIC18 MCC 2020/01/14 03:12:23 (permalink)
0
I have it.
In the project properties are under loading paths who don't belong there.
 
 

Attached Image(s)

#11
Jump to:
© 2020 APG vNext Commercial Version 4.5