成功!基于丹诺关于内存中的内存大小减半的建议。h,现在我有了引导加载程序。我将更新我的项目文件,以帮助任何其他遇到这个问题的人。我还附上了主机应用程序窗口的设置和控制台日志的截图。修改的细节对我的工作如下:1。在生成MCC Bootloader PIC代码后,更新Pix18FyBootload.C中的更新寄存器名称和引用,如SebKister在2016年11月发布的文章中所描述的:2。如丹诺所建议的,更新在内存中定义的y. h值如下:3。在PIC应用程序(我所附样本中的Clkel2BlnKy)的配置下,在XC8全局选项-GT;XC8链接器& GT;内存模型中,将ROM范围设置为0 FFFF,如附图截图所示。从这里,您应该能够编译并烧毁MCC Bootloader,编译PIC AP。PrPosits,然后使用统一的主机应用程序将PIC应用程序加载到PIC18FXXK40,并附带了屏幕截图中所示的设置。这种解决方案的主要后果是,如果您使用组合,您只能访问PIC18FXXK40中的Flash程序存储器的一半。MCC Bootloader + Microchip统一主机应用程序。在我的情况下,这对我的申请来说还远远不够。非常感谢塞贝克斯特和丹诺在这个问题上的帮助。在将来看到MCC Bootloader代码的工作是不需要修改的,并且统一的主机应用程序与较大的程序存储空间一起工作是很好的。
以上来自于百度翻译
以下为原文
Success! Based on Danno's recommendation about halving the memory sizes in memory.h, I now have the bootloader working.
I'm attaching my updated project files for the benefit of anyone else who comes across this issue. I'm also attaching a screenshot of the host application window with settings and console log.
Details of the modifications that worked for me are below:
1. After generating the MCC bootloader PIC code, update register names and references in pic18f_bootload.c as described by SebKister in his post from November 2016: http://www.microchip.com/forums/m960192.aspx
2. As suggested by Danno, update the #defines in memory.h to the values below:
#define WRITE_FLASH_BLOCKSIZE 64
#define ERASE_FLASH_BLOCKSIZE 64
#define END_FLASH 65536
3. In the configuration of PIC application project (clicker2_blinky in my attached sample) under XC8 global options -> XC8 linker -> Memory model, set ROM ranges to 0-FFFF as shown in the attached screenshot.
From here, you should be able to compile and burn the MCC bootloader, compile the PIC application, and then load the PIC application to the PIC18FxxK40 using the Unified Host Application with the settings shown in the attached screenshot.
The main consequence of this workaround is that you have access to only half of the flash program memory in a PIC18FxxK40 if you use the combination of MCC bootloader + Microchip Unified Host Application. In my case, this is still more than sufficient for my application.
Many thanks to SebKister and Danno for their help on this problem!
It would be nice in future to see the MCC bootloader code work as generated without needing modifications and the Unified Host Application work with larger program memory spaces.
Attached Image(s)
Attachment(s)
PIC18F67K40_20170629.zip (140.89 KB) - downloaded 95 times