• AVR Freaks

Hot!MCC Bootloader (Bootloader Generator) - Device Not Resetting

Author
BrianA
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2019/10/24 11:01:53
  • Location: 0
  • Status: offline
2020/02/21 12:22:59 (permalink)
0

MCC Bootloader (Bootloader Generator) - Device Not Resetting

Hi,
 
This is my first post here. I will be doing my best to explain my problem, and I will also be attaching any related code and pictures.
 
I am currently working on a project, and one of the main parts of this electronics project is a bootloader for  the microcontreller I'm using, as to be able to program the device via UART. The MCU is a PIC18F67K40, and I used MCC to generate the bootloader. The bootloader project uses the EUSART1 module and a baud rate of 9600bps. It is compiling successfully, without any errors, and I was able to program/download the bootloader onto my custom-made board (PIC18F67K40 with a 20MHz crystal oscillator) (using PICkit 3). When generating the bootloader project, I followed the 'Microchip Bootloader Generator User's Guide' attached below.
 
Apart from the bootloader project, I have also created a very simple project to toggle the state of one output pin. This is the application program that I am trying to program the device with via UART (i.e. I am loading this project's .hex file in the Unified Bootloader Host Application).
 
The host application's console shows some 'Failure Hints'; however, it seems as if/console shows that:
  • Bootloader version is read successfully
  • Erase is successful
  • Flash is being programmed
  • Checksum is matching
But when the unified bootloader host application tries resetting the device, the device fails to respond to the command.
 
I spent days trying to figure out what might be wrong and this bootloader is a very important part of the project, so I thought it would be best to ask here, maybe someone had already encountered this problem, or has an idea what might be causing it. Any help would be greatly appreciated.
 
I included a Google Drive link for:
  • The zipped folders containing the bootloader project bootloader_uart1.X, and the simple application program blinky.X
  • The PDF document I followed to generate the bootloader project using MCC - Microchip Bootloader Generator User's Guide
  • A picture of the unified bootloader host application window
  • A picture of the port settings of the host application
  • A picture of the host application console showing what was successful and the problem (device reset failing)
https://drive.google.com/open?id=1OnNWgjlRQr-tAJeZ1g5eisNXi4_9ede-
Sorry, I tried attaching everything to this post but the project files exceeded the 500KB limit. Please do tell me if there's another option which is better for you.
The pictures were attached to this post as well.
 
Other useful information:
  • I'm using MPLAB X IDE v5.05, and compiler XC8 v2.10 
  • Unified Bootloader Host Application v1.15.1
  • OS: Windows 10 Home, 64-bit
  • Connection: USB UART module TX, RX connected to RX1 (RC7), TX1 (RC6) pins of PIC18F67K40
I thank you in advance for your help!
 
Regards,
Brian
 
 
post edited by BrianA - 2020/02/21 12:30:02

Attached Image(s)

#1

10 Replies Related Threads

    Danno
    Super Member
    • Total Posts : 281
    • Reward points : 0
    • Joined: 2005/09/07 10:12:10
    • Status: online
    Re: MCC Bootloader (Bootloader Generator) - Device Not Resetting 2020/02/21 14:36:02 (permalink)
    +1 (1)
    Project blinky needs to be offset to begin at 0x2000.  See Figure 5-5 in the User's guide.
     
    ETA:  The Console window shows that the bootload process worked.  The last line shows the bootload is no longer running.
    post edited by Danno - 2020/02/21 14:48:46
    #2
    BrianA
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/10/24 11:01:53
    • Location: 0
    • Status: offline
    Re: MCC Bootloader (Bootloader Generator) - Device Not Resetting 2020/02/21 15:49:14 (permalink)
    0
    Hi Danno,
     
    Thank you very much for your reply. I have read some of your posts when working on certain projects. I set the offset of the blinky project to 0x2000; I missed that part of the user's guide. Unfortunately, after trying to program the device using the host application again, I still got the same result.
     
    Is the rest of Chapter 5 of the User's guide also important, or is it needed when going for production?
     
    I uploaded the updated project file and pictures showing the offset and the host application (https://drive.google.com/drive/u/0/folders/1OnNWgjlRQr-tAJeZ1g5eisNXi4_9ede-).
     
    Thank you for your help.
     
    Regards,
    Brian

    Attached Image(s)

    #3
    BrianA
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/10/24 11:01:53
    • Location: 0
    • Status: offline
    Re: MCC Bootloader (Bootloader Generator) - Device Not Resetting 2020/02/24 15:54:30 (permalink)
    0
    Hi Danno,
     
    I have been trying to solve the issue but haven't succeeded yet. Could it be that incorrect EEPROM Offset, EEPROM Memory Size, Config Offset, and/or Config Memory Size values in the unified bootloader host application (marked on the picture attached) are causing the problem, or is it more probable that I have something wrong in the bootloader or test project? Your help would be greatly appreciated :)
     
    Thanks,
    Brian

    Attached Image(s)

    #4
    Danno
    Super Member
    • Total Posts : 281
    • Reward points : 0
    • Joined: 2005/09/07 10:12:10
    • Status: online
    Re: MCC Bootloader (Bootloader Generator) - Device Not Resetting 2020/02/26 14:55:47 (permalink)
    0
    The memory sizes & offsets look correct.
    #5
    BrianA
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/10/24 11:01:53
    • Location: 0
    • Status: offline
    Re: MCC Bootloader (Bootloader Generator) - Device Not Resetting 2020/02/29 15:22:22 (permalink)
    0
    Hi Danno, thanks again. I have tried generating the bootloader and the application program again, just in case I was skipping something, however, I am still getting the same result. Is there something you would suggest trying please? The bootloader is a very important part of the project I'm working on so somehow the problem has to be solved.
     
    Thanks in advance,
    Brian
    #6
    Danno
    Super Member
    • Total Posts : 281
    • Reward points : 0
    • Joined: 2005/09/07 10:12:10
    • Status: online
    Re: MCC Bootloader (Bootloader Generator) - Device Not Resetting 2020/03/02 15:33:58 (permalink)
    +1 (1)
    There is a lot of stuff to get right.  All the best information we have is in the manual.   Looking back at the console log, it looks like it worked correctly.
     
    Have you read back the program memory (using a programmer) to see if blinkey is written to memory?
    #7
    BrianA
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/10/24 11:01:53
    • Location: 0
    • Status: offline
    Re: MCC Bootloader (Bootloader Generator) - Device Not Resetting 2020/03/05 08:41:34 (permalink)
    0
    Hi Danno, thank you for your message.
     
    I read the program memory of the microcontroller using the PICkit 3 programmer and MPLAB X v5.05's "Read Device Memory to File" and got the result shown in the file attached (memory.zip). I then compared this program memory to the HEX file of the blinky program I am trying to download onto the microcontroller, but the memory does not seen to match with the HEX file - However, something is still being written to the program memory at that address. I have placed the two side by side (at the respective address) and attached the image below (MemoryRead.png).
     
    Thank you very much for your help!
     
    Regards,
    Brian

    Attached Image(s)

    #8
    BrianA
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/10/24 11:01:53
    • Location: 0
    • Status: offline
    Re: MCC Bootloader (Bootloader Generator) - Device Not Resetting 2020/03/11 11:58:56 (permalink)
    0
    Hi,
     
    Hope you're doing well. After seeing the program memory read (I'm referring to the image I attached to my previous reply), do you have an idea what might be causing the problem? I tried generating the bootloader again, and checked the projects' properties however I'm still getting the same problem.
     
    Thanks,
    Brian
    #9
    cTucker
    New Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2014/04/14 13:51:49
    • Location: 0
    • Status: offline
    Re: MCC Bootloader (Bootloader Generator) - Device Not Resetting 2020/05/22 16:15:12 (permalink)
    +1 (1)
    This issue should be resolved in the newest uploads. 
    Try using v2.3.1 of the MCC library; and v1.16.1 in the Unified Bootloader Host.
     
    Prior to v 2.3.1 of the MCC library the Bootloader would do a soft reset right upon receiving the command.
    The updated generated code should now respond prior to doing the soft reset. 
     
    The Host was expecting a response, and timeout after ~sec. The Bootloading command chain was actually successful. It would still need to pass status checks to not be held in the Bootloader after the chain execution. 
     
    Using the project you attached to the gDrive; I didn't see any issues. Running the projects in the simulator; I combined your Blinky with the Bootloader and the Hex file combined no issue. I was able to see the debugger move through Bootloader do the check against the 0x2000 location; find a value of 0xEF3F which was the goto for the Blinky code. So I'm not sure if you are actually having an issue; or if it was just the bug in the log text/behavior. 
     
    In your Blinky Code you can alter the ROM reservation to 2000-FFFF; the offset you applied should also cover that; but this ROM reservation is saying the app code in theory can be build over the Bootloader code space.
     
    You can likely reduce the Bootloader required space to 0x800 instead of 0x2000; or that might have been some Bootloader behavior code you removed prior to upload. The app code looks like it got pushed to the top just before the FFFF space; but it was pretty small. 
     
     
    post edited by cTucker - 2020/05/22 16:21:55
    #10
    BrianA
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/10/24 11:01:53
    • Location: 0
    • Status: offline
    Re: MCC Bootloader (Bootloader Generator) - Device Not Resetting 2020/05/23 13:04:10 (permalink)
    0
    Hi cTucker,
     
    Thank you very much for your message! :) I will try again with the newest versions as suggested, and will tell you how it goes.
     
    Thanks again,
    Brian :)
    #11
    Jump to:
    © 2020 APG vNext Commercial Version 4.5