• AVR Freaks

Hot!How to stop MCC from generating bootloader code?

Author
markm23
Starting Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/11/21 12:51:59
  • Location: 0
  • Status: offline
2019/11/21 15:09:34 (permalink)
0

How to stop MCC from generating bootloader code?

This is on PIC15354, with the latest versions of MPLAB IDE X, XC8, and MCC. I have the boot block disabled, but MCC generates bootload.h and pic16f1_bootload.c anyhow. I don't want these, I don't see any reason I need these, and there are errors in the c code, so without manual edits the program won't compile or run.
 
I found another thread about one of the errors: the definitions of EE_Key_1 and EE_Key_2 contain both absolute addresses like "__a(0x70)", and initializations like "= 0". The XC8 manual says not to do that, but apparently that wasn't enforced until XC8 v2.10. So we're just waiting for an update to one or the other tool. Meanwhile, you can delete the initializations from the declarations, or you can use the __near directive to put these variables in the common block instead of using absolute addresses for the same purpose.
 
But after I do that, in debug the program goes into the bootloader initialization function and never returns. This sets the Keys to 0, then changes STKPTR - did that change the stack pointer inside a function?!? Then there's some assembly code, that seems to jump into the middle of Write_Flash(), and the debugger gets lost at the next "return".
 
I could probably edit it to work, but unless someone can tell me a reason for having any bootloader code when there's no boot block and no plans for a field update, I'd rather just get rid of these files and change the ones that call them.
 
 
 
 
#1

7 Replies Related Threads

    Jim Nickerson
    User 452
    • Total Posts : 6655
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: How to stop MCC from generating bootloader code? 2019/11/26 08:16:26 (permalink)
    0
    My MCC does not create any Boot Loader code unless I ask for it.

    Attached Image(s)

    #2
    markm23
    Starting Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/11/21 12:51:59
    • Location: 0
    • Status: offline
    Re: How to stop MCC from generating bootloader code? 2019/11/26 14:51:17 (permalink)
    0
    Thanks for the response.
     
    What is happening with all the other peripheral devices in the PIC16F15354? (There are around 30.) When I started a project with MCC, it appeared that every peripheral was enabled by default, but disabling them generated a .h and a .c file for every one. This was my first experience with MCC or the XC8 compiler, so maybe I got something very wrong...
    #3
    du00000001
    Just Some Member
    • Total Posts : 3675
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: How to stop MCC from generating bootloader code? 2019/11/26 17:41:36 (permalink)
    0
    @markm23
    Either your MCC is different from any one I've seen - - - or you misinterpreted the display. Or . . . some other issue.
    For me, every PIC started with all peripherals disabled that can be disabled - requiring each one to be enabled individually.
    My only critics: code generation depends on the sequence in which the peripherals have been enabled - not optimal when building a project incrementally. I'd prefer to have this sorted - maybe alphanumerically.

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #4
    markm23
    Starting Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/11/21 12:51:59
    • Location: 0
    • Status: offline
    Re: How to stop MCC from generating bootloader code? 2019/11/26 17:43:46 (permalink)
    0
    I did get something very wrong - I was clicking on the resources for a peripheral to get something up with an "Enable" box to un-check. And that loaded all the drivers... The place to disable the unwanted peripherals appears to be in the registers for System.  So I started over with MCC from a blank project, and it went much smoother this time, with only the drivers I wanted loading.
     
    #5
    markm23
    Starting Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/11/21 12:51:59
    • Location: 0
    • Status: offline
    Re: How to stop MCC from generating bootloader code? 2019/11/26 18:18:36 (permalink)
    0
    MCC did start with all peripherals enabled, at least in the PMDx registers. I don't know if it's the IC or the version of MCC.
     
    I loaded the whole development system fresh when I started this project. My previous PIC projects were without MCC, in MPLAB IDE 8, with simpler IC's, and mostly in assembly language, so there has been quite a learning curve. I think I'm back on track now. Thanks for your posts, they did give me a hint as to what I was doing wrong. I think I'm back on track now.
    #6
    du00000001
    Just Some Member
    • Total Posts : 3675
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: How to stop MCC from generating bootloader code? 2019/11/27 02:01:55 (permalink)
    0
    :)
    Another (?) way to disable a peripheral is to just click the red minus sign in the configuration overview box.
    Never tried to enable a peripheral via the PMD configuration, although it somewhat seems consequential to have a peripheral enabled/disabled this way as well.
     
    Good progress and - - - have fun !

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #7
    cTucker
    New Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2014/04/14 13:51:49
    • Location: 0
    • Status: offline
    Re: How to stop MCC from generating bootloader code? 2020/05/22 17:44:42 (permalink)
    0
    Is the 8bit Bootloader Generator Library added under the Device Resources section within MCC configuration?
    Those files shouldn't be generated otherwise. You are correct; if the application doesn't intend to use a Bootloader; that space should be reserved for use by the application. 
     
    If so there should be an (x) in red next to that library. That should remove it from the MCC configuration. You can close MCC by clicking the ICON again; and save the configuration. I would then manually remove the files. I believe you might be able to 'generate' and MCC should remove them; but manual removal of the software library from device resources and then the source files is likely the most secure method.
     
    v2.3.1 of the library removes the = 0; You are correct that that came later into the C99 compliance through XC8. 
     
    #8
    Jump to:
    © 2020 APG vNext Commercial Version 4.5