使用 USB 引导加载程序时如何设置 ARM 用户应用程序起始地址? [英] How to set ARM user app start address when using USB bootloader?

查看:33
本文介绍了使用 USB 引导加载程序时如何设置 ARM 用户应用程序起始地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚刚拿起其中一个 ARM Cortex-M3 LPC1768 mini来自 eBay 的板.它基本上是一个分线板.

Just picked up one of these ARM Cortex-M3 LPC1768 mini boards from eBay. It's basically a breakout board.

但是,根据随附的小文档,我确定它具有类似于 NXP LPC1700 辅助 USB 引导加载程序 (AN10866) 应用说明.

However, based on what little documentation came with it, I've determined that it has a USB bootloader similar to that described by NXP's LPC1700 secondary USB bootloader (AN10866) app note.

两个文档(应用笔记和板子文档)都表明用户程序将被构建为起始地址为 0x2000.因为 USB 引导加载程序已经在 0x0 并且占用了 8K.

Both docs (the app note and board docs) indicate that user programs are to be built such that their starting address is 0x2000. Because the USB bootloader is already at 0x0 and takes up 8K.

两个文档还显示了如何在 Keil uVision 中执行此操作的屏幕截图(请参阅应用说明的第 14 页),但我计划使用 GNU 工具链(Yagarto + Eclipse + OpenOCD).

Both docs also show screenshots (see page 14 of app note) on how to do this within Keil uVision, however I'm planning on using a GNU toolchain (Yagarto + Eclipse + OpenOCD).

如何在使用 GNU 工具链编译时指定 起始地址 0x2000 以便它可以与 USB 引导加载程序正常工作?

How do I specify a starting address of 0x2000 when compiling with a GNU toolchain so that it will work properly with the USB bootloader?

推荐答案

我有很多基于 arm 的例子:

I have lots of arm based examples:

https://github.com/dwelch67

查找或创建您自己的链接器脚本.它可能会说 ORIGIN = 0x00000000 将 rom 更改为 0x2000,例如:

Find or create your own linker script. where it might have said ORIGIN = 0x00000000 for the rom change that to 0x2000, something like this for example:

MEMORY
{
   rom : ORIGIN = 0x00002000, LENGTH = 0x6000
   ram : ORIGIN = 0x40000000, LENGTH = 0x2000
}
SECTIONS
{
   .text : { *(.text*) } > rom
   .bss  : { *(.bss*) } > ram
}

你可能想要/需要一个带有

you might want/need a .data with

   .data  : { *(.data*) } > ram AT >rom

或者类似的东西.取决于您的程序和启动代码等等.

or something like that. depends on your programs and boot code and all that.

如果您已经有一个为 0x00000000 构建的工作系统,那么找到正在使用的链接器脚本并复制它并将其更改为 0x2000 并指定该链接器脚本.

If you already have a working system that builds for 0x00000000 then find the linkerscript being used and make a copy of it and change it to 0x2000 and specify that linker script.

这篇关于使用 USB 引导加载程序时如何设置 ARM 用户应用程序起始地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆