完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,我最近开始学习MIPS体系结构,我首先学到的是引导地址被固定在0xbfc00000(引导闪存)。然而,当我开始查看一些PIC32,即它的链接器脚本时,我发现启动代码通常放在0x9d001000(程序闪存)处。我发现的信息很少,但是我理解PIC程序员在启动闪存中放了一个引导加载程序,它执行一些初始化,然后跳到程序闪存中,对吧?我希望完全控制软件并自己编写引导代码,因为我不知道默认引导加载程序执行哪些初始化。这是可能的吗?我的假设是正确的还是完全偏离目标?提前感谢
以上来自于百度翻译 以下为原文 Hello, I recently started to study the MIPS architecture and one of the first things I learnt was that the boot address was fixed at 0xbfc00000 (boot flash). However when I started looking at some PIC32, namely its linker scripts, I saw that the startup code is usually placed at 0x9d001000 (program flash). I found very little information, but I understand that the PIC programmer puts a bootloader in the boot flash that performs some initialization and jumps to the program flash right? I'd like to be in complete control of the software and write that boot code myself, since I don't know which initializations the default bootloader performs. Is this possible? Am I correct in my assumptions or completely off target? Thanks in advance |
|
相关推荐
11个回答
|
|
所有PIC32设备在0x1FC000启动一定数量的闪存,并且Flash的主体从0x1D10000开始。这些是Flash程序员需要的总线上的物理地址,但是核心使用虚拟地址。KSGE1被取消,是核心开始执行的地方。KSGE0被认为是缓存的,因此地址是0x9d00亿。是的,您可以编写单独的引导加载程序。主要问题是您需要使用多少引导闪存(3K、12K或160K),以便您知道是否必须使用程序闪存。在MPLLABHarmony中有引导加载程序,我建议把它们作为您自己的起点。去年八月,我在我们的MASTERs会议上教了引导加载程序。如果你能用你的电子邮件地址给我发私人信息,我会把幻灯片发给你。
以上来自于百度翻译 以下为原文 All PIC32 devices put some amount of Flash starting at 0x1fc00000, and the main body of Flash starting at 0x1d000000. These are the physical addresses on the bus, which the flash programmer requires, but the core uses virtual address. KSEG1 is uncached, and is where the core starts execution. KSEG0 is considered cached, and so the address is 0x9d000000. Yes, you can write a separate bootloader. The main question will be how much boot flash you have to work with (3K, 12K, or 160K) so you know whether you're going to have to use some program flash with it. There are bootloaders in MPLAB Harmony, and I would suggest looking at them as a starting point for your own. I taught a bootloader course at our MASTERs conference this past August. If you can send me a private message with your email address, I'll send you my slides. |
|
|
|
你好,Joseph,正如你提到的,0xbfc00000是引导(设备重置)地址,并且是针对MIPS架构固定的。将引导加载程序代码保存在引导闪存或程序闪存中是可选的。如果引导加载程序适合于引导闪存,则将其保存在引导闪存中,否则将其保存在程序闪存中。这只是不同而已。ce在内存位置,应该通过引导加载程序的链接器脚本正确地链接它。您可以按照应用程序说明AN1388进行操作,AN1388为初学者提供了良好的信息和演示。
以上来自于百度翻译 以下为原文 Hi Joseph, As you mentioned, 0xbfc00000 is the boot(device reset) address and is fixed for MIPS architecture. Keeping bootloader code in boot flash or program flash is optional. If a bootloader fits into bootflash memory, keep it in boot flash other wise keep it in program flash. It's is just a difference in memory location, that should be linked properly by linker script of your bootloader. You can follow application note AN1388, which has good information and demos for beginners. |
|
|
|
嘿,Totem,谢谢你的回答。但我还没有完全明白。设备复位地址在启动闪光灯,对不对?如果将引导加载程序放在程序Flash中,将在重置时运行什么?我会读的。再次感谢您。
以上来自于百度翻译 以下为原文 Hey Totem, Thank you for your answer. But I still don't completely get it. The device reset address is in the boot flash right? If you place the bootloader in program flash, what will run at reset? I will read that AN. Thank you once again. |
|
|
|
在PIC32 MX575 F512L中,我们有512K闪存+12K引导闪存,但是由于我的引导加载程序代码大于12K,所以我们使用了6K的512K闪存来引导引导代码。但是如何将12 K引导闪存作为程序存储器重用。这是可能的
以上来自于百度翻译 以下为原文 In pic32mx575f512l we have 512k flash + 12k boot flash, But since my bootloader code is more than 12k , we used 60k of 512k flash for bootloader code. but how can i reuse 12 k boot flash as program memory. it' possible |
|
|
|
@josephmartin这里将要发生的事情是,我敢打赌您没有使用定制的启动代码,所以这个(Microchip默认的启动代码CRT0.S...)和资本S)将被放入BFM(即在启动闪存内存0x1fc000)。这将执行,然后分支到你的“主”函数。是否通过你使用的链接器脚本来指定BFM中的C代码来决定代码的去向。有时,你会编译并发现你的C代码将不适合…因此,您将其放入PFM(程序快闪存储器)中。这里的故事寓意就像图腾所说的。PIC32 PC从0x1FC00000(用于约定的物理地址)开始,运行启动代码,然后分支到“main”,由您决定将其放置在何处(BFM或PFM)。@sreenathreddy4a1如果您想重用未编程的BFM代码,则由您决定……写入这个区域与PFM一样简单,只要注意不要超出界限,并检查API返回值是否写入flash就可以知道它是成功的。如果你想在这里执行可执行代码,简单…移动您的PC通过功能指针(等同于日常地址)或类似的东西。你必须做链接练习,在闪光灯的特定区域放置特定的例程。这只是记忆…有东西在那里,PC可以把它装入MCU,它将执行它获取的指令。
以上来自于百度翻译 以下为原文 @josephmartin What is going on here is that I will bet that you are not using custom startup code, so this (Microchip default startup code CRT0.S... and capital S at that) will be placed into BFM (i.e. 0x1FC00000 in Boot Flash Memory). This will execute and then branch to your 'main' function. Whether or not via your linker script you are using specifies to keep the C code in BFM dictates where your code goes. Sometimes, you will compile and find out that your C code will not fit... Therefore, you place it into PFM (program flash memory). Moral of the story here is exactly as Totem said. PIC32 PC starts at 0x1FC00000 (physical address for convention), runs startup code, then branches to 'main' that YOU decide where this is placed (BFM or PFM). @sreenathreddy4a1 If you want to reuse BFM code that is not programmed, that is up to you... It is as simple to write to this region as PFM, just be careful you don't go out of bounds AND check your API return values for writing to flash to know it was successful. If you want executable code here, simple... move your PC there via function pointer (equated to address of routine) or something of the sort. You have to do linking exercises to place specific routines in particular regions of flash. It's only memory... Something is there, the PC can load it into the MCU and it will execute the instructions it fetches. |
|
|
|
@josephmartinBFM也是可执行内存,因为它正在执行引导加载程序代码,如果PFM用于引导加载程序代码,为什么我们不能将BFM用于用户代码。@doubtAll可执行代码必须位于一个内存区域。如果它必须位于一个内存区域,在观察AN13中的图1之后88文档中,引导加载程序代码被分成两个内存区域。-->中断向量表(IVT)和C启动代码放在引导Flash中,引导加载程序的其余部分放在程序Flash中。它们如何链接执行,正如您所说可能是连接PC已经在引导加载程序代码或一些正在处理它可能是内部操作系统。
以上来自于百度翻译 以下为原文 @josephmartin BFM is also the executable memory as it is executing boot loader code, if PFM is used for boot loader code why can't we use BFM for user code. @doubt All the executable code has to be sit at one memory region. If it has to be sit at one memory region , after observing the figure 1 in AN1388 document , boot loader code has divided and made to sit in two memory regions. --> The Interrupt Vector Table (IVT) and the C start-up code are placed in boot Flash, and the remaining portion of the bootloader is placed inside the program Flash. How both are linked to execute , and As you said may be the linking PC has done in boot loader code or some one is handling it may be the internal OS. |
|
|
|
@cgiordan如果我理解您的意思,在跳转到我的代码之前,有一些初始化代码会运行,而这些初始代码是放在引导闪存中的代码。我不希望在我的代码之前执行任何代码,甚至不允许在我的代码之外执行任何代码。我想编写用于c运行时系统和处理器初始化的程序集代码,并将其置于执行之初。我的代码稍后将跳转到主函数或任何我想要的。我该怎么做呢?
以上来自于百度翻译 以下为原文 @cgiordan If I understand what you are telling me, there is some initialization code that runs before jumping to my code, and this initial code is the code placed in boot flash. I don't want any code to execute before my code, or even, any code besides mine to run. I want to write the assembly code for c runtime system and processor initialization and place it at the very start of execution. My code will later jump to the main function or whatever I want. How can I do this? |
|
|
|
RTFMX在XC32用户指南中的具体查找
以上来自于百度翻译 以下为原文 RTFM Specifically in the XC32 Users Guide look for |
|
|
|
嗨,josephmartin。除了Jim已经解释过的,在MPLLABIDE中,在链接器设置中还有一个复选框:“不要链接启动代码”您会想要这个,以避免任何与您自己的库代码冲突。
以上来自于百度翻译 以下为原文 Hi, josephmartin. In addition to what Jim have explained, in the MPLAB IDE, there is a checkbox somewhere in linker settings: 'Do not link startup code' You will want this, to avoid any library code conflicting with your own. Regards, Mysil |
|
|
|
|
|
|
|
我还建议您将引导加载程序和应用程序代码保持在不同的非重叠块中。您迟早会希望使用bootloader.1更改引导加载程序。创建在数组中包含新引导加载程序的应用程序,或者将新引导加载程序存储在片外存储器中。擦除引导加载程序FLAST3。编写新的BooDoule4程序。注意,引导加载程序不会重新运行/重新加载引导加载程序UpDATE5。重新启动PIC,新的引导加载程序运行并加载应用程序。
以上来自于百度翻译 以下为原文 I would also suggest you might want to keep the bootloader and application code in separate non overlapping blocks. Sooner or later you will want to change the bootloader using the bootloader. 1. create an application that contains the new bootloader in an array or store the new bootloader in the off chip storage. 2. erase the bootloader flash 3. program the new bootloader 4. take care that the bootloader will not rerun/reload the bootloader updater 5. restart the pic and the new bootloader runs and loads the application. |
|
|
|
只有小组成员才能发言,加入小组>>
5160 浏览 9 评论
1998 浏览 8 评论
1927 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3170 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2225 浏览 5 评论
727浏览 1评论
612浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
501浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
626浏览 0评论
524浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 07:03 , Processed in 1.433000 second(s), Total 96, Slave 79 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号