Microchip
直播中

廖宇婷

7年用户 201经验值
私信 关注
[问答]

引导地址和引导加载程序问题

你好,我最近开始学习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)

罗玉婧

2019-6-13 08:30:05
所有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.
举报

张虎豹

2019-6-13 09:00:40
你好,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.
举报

冉屹芳

2019-6-13 09:14:31
嘿,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.
举报

李衍安

2019-6-13 09:32:17
在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
举报

更多回帖

发帖
×
20
完善资料,
赚取积分