完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
这可能是一个愚蠢的问题,但是我正在检查我对引导加载程序的操作的理解(在我的例子中是UART/SCORE)。引导加载程序有一套将被编译到应用程序中,然后被下载到PIC32的γ-PrabMAR-COMFIG语句。然后启动这个设备,我假定它从ROM中的设备配置寄存器中获取它的定义(例如振荡器)。引导加载程序然后加载应用程序,该应用程序将有自己的一组“γ-PrimaMaqFIG语句”内置到ROM中。由引导加载程序设置?引导加载程序是否更改了设备配置寄存器?如果是这样,并且设置与引导加载程序所使用的设置不同,那么引导加载程序在下一次断电/下一次调用时如何工作(不管它是否被加载到加载模式或运行模式)。如果不是,引导加载程序设备配置寄存器值是否被保留,如果用户需要不同的振荡器配置,那么用户是否必须改变这些值?这很好,但我想知道我是否必须这么做。另一种选择是确保两套寄存器集在语用上对齐。但会感谢一些帮助!多谢,VJM
以上来自于百度翻译 以下为原文 This is probably a silly question, but I am checking my understanding of the operation of a boot loader (in my case UART/serial). The boot loader application has its set of #pragma config statements that will be compiled into the application, and then downloaded to the PIC32. This device is then started, and I presume that it takes its definitions (e.g. oscillator) from the device config registers in ROM. The boot loader then loads the application, which will have its own set of #pragma config statements built in, into ROM. Do these values then overwrite the definitions set by the boot loader? Does the boot loader change the device config registers? If so, and the settings are different to the ones used by the boot loader, how does the boot loader work when it is next invoked on a subsequent power down/up (regardless of whether it is asked to go into load or run mode)? If not, are the boot loader device config register values retained, and does the user then have to change these if he wants e.g. a different oscillator configuration? This is fine, but I would like to know if I have to do this. The alternative would be ensure that both register sets are aligned in the pragmas. I am probably missing something obvious... But would appreciate some help! Many thanks, VJM |
|
相关推荐
19个回答
|
|
|
Bootloader可以从应用程序HEX加载新的配置词,这取决于您。我相信MCC Bootloader允许它和统一的主机,但是加载配置词不是默认的。必须单击复选框才能启用。如果使用可加载的特性将Bootloader包含在应用程序中,则两组配置字必须相同,否则会出错。
以上来自于百度翻译 以下为原文 The bootloader can load new config words from the application hex - it’s up to you. I believe the MCC bootloader allows it and the unified host also, but loading config words is not default. You have to click a checkbox to enable. If you use the loadable feature to include the bootloader with the application, both sets of config words must be the same or you get an error. |
|
|
|
|
|
谢谢——我使用的是“原始”引导加载程序,详见AN1388,因为我不使用和声。因此,我不知道这个选项。您的注释非常有用,我同意配置词需要相同,或者引导加载程序不能在下一次启动时运行它的串行行(在我的例子中)。我怀疑配置词在“旧”引导加载程序中没有更新,因为我从来没有遇到任何问题,而且只是最近我尝试改变应用程序中的振荡器设置而不考虑它——因此问题!(设置没有改变…)我会查看LD文件中的链接命令(虽然我在这方面不是专家),看看我是否明白正在发生什么……多谢,VJM。
以上来自于百度翻译 以下为原文 Thank you - I am using the 'raw' boot loader as detailed in AN1388, as I do not use Harmony. Accordingly, I was not aware of this option. Your comment is very helpful; I agree that the config words need to be the same or the boot loader would not be able to run its serial line (in my case) on next start up. I suspect that the config words are not updated in the 'older' boot loader, as I have never had any problems, and it is only recently that I have tried to change the oscillator settings in the application without thinking it through - hence the question! (The settings did not change...) I will look through the linker commands in the .ld file (though I am no expert in this area) to see if I understand what is going on... Many thanks, VJM |
|
|
|
|
|
我不太熟悉PIC32,但我猜想引导加载的这个方面不会有太大的改变。
以上来自于百度翻译 以下为原文 I’m not really familiar with pic32 but I would guess that this aspect of bootloading doesn’t change much |
|
|
|
|
|
我相信你是对的,它与我的思想联系在一起,虽然我不是专家!我只需要看看我能不能弄清楚链接器是如何管理这个的…纯粹出于好奇心
以上来自于百度翻译 以下为原文 I am sure you are right - it ties in with my thinking, though I am no expert! I just need to see if I can figure out how the linker manages this... out of sheer curiosity. VJM |
|
|
|
|
|
正如AN1388 PDF所说的,它希望在引导加载程序和应用程序中配置比特是相同的。在PIC32中改变配置比特需要一个功率周期。
以上来自于百度翻译 以下为原文 As the AN1388 pdf states it expects the config bits to be the same in the bootloader and the application. In the PIC32 changing the config bits requires a power cycle. Attached Image(s) |
|
|
|
|
|
谢谢您!我没有发现这(我的错误),当然,我应该检查了应用笔记时,我想到了。我唯一的借口是,我只使用一小部分的能力(因此专注于AN的特定部分),虽然这是一个微弱的声明。我知道功率循环的要求,但似乎没有什么区别-我现在明白了。VJM
以上来自于百度翻译 以下为原文 Thank you! I had not spotted this (my fault); I should, of course, have checked the app note when the thought occurred to me. My only excuse is that I am only using a small section of the capability (and hence focus on specific sections of the AN), though this is a feeble statement. I was aware of the power cycle requirement, but it seemed to make no difference - which I now understand. This resolves the issue! VJM |
|
|
|
|
|
Bootloader的PC端试图通过限制目的地址来防止写入错误的空间。作为实际的事情,改变配置位需要改变引导加载程序。
以上来自于百度翻译 以下为原文 The PC end of the bootloader tries to help prevent writing to the wrong space by limiting the destination address. As a practical matter changing the config bits requires changing the bootloader. in Hex.cpp ..... case DATA_RECORD: //Record Type 00, data record. HexRecordSt.Address = (((HexRec[1] << 8) & 0x0000FF00) | (HexRec[2] & 0x000000FF)) & (0x0000FFFF); HexRecordSt.Address = HexRecordSt.Address + HexRecordSt.ExtLinAddress + HexRecordSt.ExtSegAddress; ProgAddress = PA_TO_KVA0(HexRecordSt.Address); if(ProgAddress < BOOT_SECTOR_BEGIN) // Make sure we are not writing boot sector. { if(HexRecordSt.MaxAddress < (ProgAddress + HexRecordSt.RecDataLen)) ... |
|
|
|
|
|
HI,Bootloader和应用程序必须使用相同的配置必须使用相同的配置寄存器设置。Bootloader可以,在我看来,应该忽略在应用程序.HEX文件中的配置寄存器值。当引导加载程序被外部程序员编程为Flash时,所有Flash都是FIR。引导到所有的0xFFFFFFF,也就是配置寄存器,Bootloader应该有Bootloader和所有应用程序使用的配置设置。Bootloader可以将配置字中的单个位从1更改为0,但我认为应该避免这一点,特别是FO。Bootloader还应该检查应用程序映像的地址,这样引导加载程序不会重写自身。注意,如果PIC32 MX设备中的配置位在运行时发生变化,那么PIC将重置,因此Bootloader必须是REST。RTD。迈西尔
以上来自于百度翻译 以下为原文 Hi, Bootloader and Application must use the same configuration must use the same configuration register settings. Bootloader may and in my opinion, should Ignore configuration register values in Application .hex file. When the Bootloader is programmed into Flash by external programmer, all flash is first erased to all 0xFFFFFFFF, also configuration registers, bootloader should then have configuration settings to be used by bootloader and all applications. It may be possible for bootloader to change individual bits in configuration words from 1 to 0, but I think this should be avoided, especially for devices expected to be used for application development. Bootloader should also check addresses of application image, such that bootloader do not overwrite itself. Note that if Configuration bits in PIC32MX device is changed while running, then the PIC will Reset, so bootloader will have to be restarted. Mysil |
|
|
|
|
|
吉姆,非常感谢-这节省了我的时间,因为我不能看到任何东西在PIC结束…我只是试图改善代码,因为我似乎已经在UART设置约束,这是造成我的问题……VJM
以上来自于百度翻译 以下为原文 Jim, Many thanks - this has saved me time, as I could not see anything at the PIC end... I am just trying to improve the code as the version I have seems constrained in UART setup, which is causing me problems... VJM |
|
|
|
|
|
我同意Mysil。更改配置位会导致重置,并且电源周期退出配置不匹配异常。
以上来自于百度翻译 以下为原文 I agree with Mysil. Changing the config bits causes a reset, and a power cycle to exit the configuration mismatch exception. |
|
|
|
|
|
亲爱的Mysil,谢谢你。这是一个非常有益的交流。我想我已经意识到在运行时改变配置位将导致重置;我的意图是改变振荡器(OSCCon或等效)比特,如果我需要改变工作频率的话,我认为除了WAI之外,这可以没有显著的影响。TIN用于振荡器/PLL结算。据我所知,ROM中的设备配置寄存器不易更改,只在初创时使用。
以上来自于百度翻译 以下为原文 Dear Mysil, Thank you. This has been a very helpful interchange. I think that I had realised that changing the configuration bits while running would result in a reset; my intention would be to change the oscillator (OSCCON or equivalent) bits if I need to change operating frequency - I think that this can be done with no significant implications, other than waiting for the oscillator/PLL to settle. As I understand it, the device config registers in ROM cannot easily be changed, and are only used at start-up. VJM |
|
|
|
|
|
您可以通过启用时钟切换(FRM 42.3.7.1)来实现这一点。
以上来自于百度翻译 以下为原文 You can do this by enabling clock switching (FRM 42.3.7.1). |
|
|
|
|
|
谢谢-我会想出办法的!我没有看到时钟切换的任何细节,但我知道它存在。我通常使用PrimaMac配置设置,但现在可能需要更改,因为我依赖于一个串行引导加载程序进行字段更新。我认为我对配置寄存器使用方式的评论是有效的:它们只在启动时调用以建立系统,然后可以忽略。
以上来自于百度翻译 以下为原文 Thank you - I will figure it out! I have not looked at clock switching in any detail, but I am aware that it exists. I have normally used the pragma config settings, but may now have to change, as I rely on a serial boot loader for field updates. I think that my comment on the way that the config registers are used is valid: they are only invoked on start-up to set up the system, and can then be ignored. VJM |
|
|
|
|
|
您必须在引导加载程序中设置配置寄存器。这是在将引导程序编程/闪烁到设备中时完成的。一旦设备开始改变配置比特,就会导致配置不匹配异常,需要一个电源周期退出,配置比特也不会改变。作为唯一的解决方案。
以上来自于百度翻译 以下为原文 You must set the config registers in the bootloader. This is done while programming/flashing the bootloader into the device. Once the device has started changing the config bits results in a configuration mismatch exception requiring a power cycle to exit and the config bits have not changed. timijk has the only solution for you. |
|
|
|
|
|
谢谢-我的观点,显然是坏的,正是你所说的,我相信。设备配置寄存器实际上只是在那里启动配置;他们被复制到适当的工作寄存器,例如OSCCon,在启动,然后这些可以***纵。没有真正的理由去接近设备配置寄存器(它们在文档中被标记为R/P,而不是R/W);它们通过初始的系统编程来控制,这是通过“Xy-Prima-COMFIG”指令,在引导加载程序的情况下,前面提到过的约束。F改变了相关的工作寄存器,Timijk有助于振荡器的引导。我很感激你在我前面,但是这可能会帮助其他人。如果你不同意上面的评估,请告诉我。我希望我不是小题大做!VJM
以上来自于百度翻译 以下为原文 Thank you - the point I was making, obviously badly, is exactly what you have said, I believe. The device config registers are really only there for start-up configuration; they are copied into the appropriate working registers e.g. OSCCON, on start-up, and these can then be manipulated. There is no real reason to go near the device config registers (they are labelled as R/P, not r/w in the documentation); they are controlled by the initial system programming via '#pragma config' directives, with the constraints mentioned before in the case of a boot loader. There are various ways of changing the relevant working registers, and timijk has helpfully provided a steer for the oscillator. I appreciate that you are way ahead of me, but this might help others. Let me know if you disagree with the assessment above. I hope I am not making a mountain out of a molehill! VJM |
|
|
|
|
|
然而,我看到了一个令人不安的问题。我相信在串行引导加载程序和应用程序中,我有相同的“Trac-Pracm配置”语句(早期的响应表明,不管怎样,我认为,这是不相关的,看看Windows代码)。我发现当我下载主应用程序时,当我指示引导加载程序应用程序运行应用程序时,我会在串行行上得到垃圾(好像它在不同的波特率),直到我的电源周期,当一切都很好的时候。在“运行应用程序”模式下启动引导程序的系统是很好的。我注意到关于功率循环的早期评论,但是我不相信我正在以任何方式改变配置词。有什么建议或评论吗?当我工作在40兆赫时,我没有这个问题,它只发生在我切换到60 MHZ.VJM时。
以上来自于百度翻译 以下为原文 I am, however, seeing an issue that is disturbing. I believe that I have the same '#pragma config' statements in the serial boot loader and the application (an earlier response indicates that this should be irrelevant anyway, I think, looking at the Windows code). I find that when I download the main application, I get garbage on the serial line (as if it was at a different baud rate) when I instruct the boot loader application to run the application, until I power cycle, when every thing is fine. Starting the system with the boot loader in 'run application' mode is fine.. I note the earlier comment about power cycling, but I do not believe that I am changing the config words in any way. Any advice or comment? I did not have this problem when I worked at 40 MHz; it has only occurred when I switch to 60 MHz. VJM |
|
|
|
|
|
波特率差?捕获逻辑分析仪上的串行线路并查看波特率。
以上来自于百度翻译 以下为原文 Bad baud rate ? Capture the serial line on a logic analyzer and look at the baud rate. |
|
|
|
|
|
吉姆,你可能是对的,但为什么在动力循环之前或之后会有所不同呢?这是一个相同的代码;实际的波特率接近我使用的57600波特。唯一的区别是,Windows程序指示引导加载程序在第一种情况下激活应用程序,而不是引导加载程序检测位和动作的状态。在硬复位(电源周期)之后进行应用。我想,引导加载程序将执行相同的操作,即跳转到给定的地址以启动应用程序。也许工作寄存器不是由引导加载程序加载的,但它们必须是……它与设备配置有一个问题,但我很难解释这使我满意。我将仔细检查PrimaMead和这个区域中的引导加载器代码。
以上来自于百度翻译 以下为原文 Jim, You are probably right, but why would it be different before/after a power cycle? It is the same code; the reported actual baud rate is close enough to the 57600 baud that I use. The only difference that I can tell is that the windows programme instructs the boot loader to activate the application in the first case, rather than the boot loader detecting the state of a bit and activating the application after a hard reset (power cycle). I would have thought that the boot loader would perform the same actions i.e. jump to a given address to start the application. Perhaps the working registers are not loaded by the boot loader, but they must be... It smacks of an issue with the device config, but I am struggling to explain this to my satisfaction. I will double check the pragma settings, and the boot loader code in this area. VJM |
|
|
|
|
|
我可以确认这些语法是相同的,并且引导加载程序在两种情况下都使用相同的“JopptoApp”调用。我仍然迷惑……VJM。
以上来自于百度翻译 以下为原文 I can confirm that the pragmas are the same, and that the boot loader uses the same 'jumptoapp' call in both cases. I remain mystified... VJM |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1121浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
872浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-1 18:47 , Processed in 1.112111 second(s), Total 106, Slave 89 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
501