完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
在PSoC4中,我们必须使用仿真EEPROM组件来使用闪存部分作为EEPROM区域。PSOC4的EMEEEEPROM组件的一个限制是,它在闪存中自动地放置EEPROM空间。这个位置可能不同buildcycle变化。这可能会在Flash的安全保护过程中产生一个棘手的问题(通常用于您的固件的IP保护)。 因为你必须得到一个新的构建后分配的闪存区域的地址,并适当地更改Flash安全文件标志,以允许EMyEEPROM在其他受保护的闪存区域内工作。这是一个繁琐的任务,不直观aspsoc1 EEPOM组件。 一个解决方案——在其他论坛后建议是使用Flash EEPROM连接指令定义一个固定区域。例:试图通过我在全球部分定义一个变量存储在Flash模拟EEPROM数据,静态常量函数时,eepstrg [ 6 ] __attribute__((第(”。eepromdata”)))= { 0,0,0,0,0,0 };在这里,为确保变量将被分配在ROM区。部分指令将创建一个单独的章节的名称被分配。请注意,这是必须要初始化一些数据EEPROM区,为em_eeprom组件进行合理分配。下一步:打开项目的链接脚本文件(在工作区的探险家Source Tab生成的源cm0gcc。LD)在文件中添加以下行后,LD ROM部分(有一个建议,后段{………} >;ROM)。eepromdata 0x00007f80:{保持(*(。eepromdata))} >;ROM的地址0x00007f80选择因为它是闪光的最后一块可其他地址由您的固件代码没有使用。建设项目。你应该在ROM中的地区指定的地址验证仿真EEPROM空间的分配,由生成的地图文件搜索(在工作区浏览器下结果”选项卡,“项目名称”。地图文件)现在我们可以保护包括模拟EEPROM空间通过改变相应闪光区TE的旗帜在安全选项卡undercydwr Flash文件。这种方法有一个后退:每当应用程序重新生成(由于成分变化等)产生新的连接文件。需要编辑的文件,再LD。(只改变软件建立保存连接设置)我会感激任何帮助,1)有保护或自动添加链接脚本文件的方法吗?二)其他方法配置EEPROM区定位为缓解闪存的安全配置。最好的问候,Vinay 以上来自于百度翻译 以下为原文 Hello, In PSoC4 we have to use emulated EEPROM component to use flash portion as EEPROM area. One limitation of the Em_EEPROM component of PSoC4 is, it automatically places EEPROM space in flash. This location may changes with different build cycle. This may create an tricky issue during security protection of flash (usually employed for IP protection of your firmware). As you have to get the address of flash area allocated after a new build and change Flash Security file flags appropriately to allow Em_EEPROM to work within otherwise protected flash area. This is a tedious task and not intuitive as PSoC1 EEPOM component. One solution - as suggested in other forum post - is to define a fixed EEPROM area in flash using linker directive. An example tried by me: In global section define a variable to store emulated EEPROM data in flash as, static const uint8 eepStrg[6] __attribute__ ((section (".EEPROMDATA"))) = {0,0,0,0,0,0} ; Here, const ensures that varaible will be allocated in ROM area. section directive will creat a seperate section name to be allocated. Note, it is must to initialize the EEPROM area with some data, for Em_EEPROM component to be allocated properly. Next: open project's linker script file (under Workspace Explorer - Source Tab - Generated Source - cm0gcc.ld) in .ld file add following lines after ROM section (one suggested location, after SECTION { ... ... ... } >rom ) .EEPROMDATA 0x00007f80 : { KEEP (*(.EEPROMDATA)) } >rom Address 0x00007f80 is selected since it is last block of Flash - but can be other address not used by your firmware code. Build project. You should verify the allocation of emulated EEPROM space at the specified address in Flash ROM area, by searching the generated map file (in Workspace Explorer under Results tab, 'Project name'.map file) Now We can protect the Flash area excluding emulated EEPROM space by changing appropriate flag at Flash Security tab under cydwr file. This approach has one draw back: Whenever application is re-generated (due to change of component etc.) It generates new linker file. Needs editing the .ld file again. (Software only change and build preserves the linker settings) I will apreciate any help towards, 1) Is there a method to preserve or automatically add section in linker script file? 2) Any other method to allocate EEPROM area at specific location to ease flash security allocation. Best Regards, Vinay |
|
相关推荐
12个回答
|
|
这里有一个常见问题解答:HTTP://www. CyPress?COM/?ID=4和;RID=57109,这导致了您在这里的HTTP://wwwyCysP.com/?对于pSOC5LP/PSoC4,RID=91945(参见第30页)。
以上来自于百度翻译 以下为原文 There is a FAQ answer here: http://www.cypress.com/?id=4&rID=57109 , which leads to you here http://www.cypress.com/?rid=91945 for the PSoC5LP / PSoC4 (see page 30). |
|
|
|
HLI
谢谢指点AN89610。 我已经阅读an89610本身修改后的链接脚本文件的初步设想。 重新阅读an89610后(特别是在23页),我的另一个解决方案,复制生成的链接脚本文件,修改它,在需要添加自定义的EEPROM的地址段。重命名链接器文件。它存储在项目源的根文件夹添加到项目中。如在AN89610中提到的: “注意,链接器脚本文件是由 PSoC Creator在项目建设时间,并改变你 使这些文件可能被覆盖在未来建设。 你可以指示PSoC Creator使用一个自定义的脚本文件, 利用PSoC Creator的菜单项目的生成设置> >; 链接>;一般>;自定义链接脚本。 如果你使用一个自定义的链接脚本文件,是一个很好的实践 添加到项目(菜单项目>;现有项目…), 它保存在项目文件夹中。” 这解决了在编写链接脚本文件。 但我不是海湾合作委员会的专家。阅读文档和创建完全自定义的gcc链接脚本文件是不容易的。我会请有经验的人来验证我的解决方案,但它是这个项目的工作。 当做, 维奈 以上来自于百度翻译 以下为原文 HLI, Thanks for pointing AN89610. I have got the initial idea of modifying linker script file after reading AN89610 itself. After re-reading AN89610, (specially around page 23), My another work around solution is, copy generated linker script file, modify it to add custom EEPROM section at needed address. Rename the linker file. Store it in project source root folder and add it back to project. As mentioned in AN89610 : "Note Linker script files are automatically generated by PSoC Creator at project build time, and changes that you make to those files may be overwritten on the next build. You can instruct PSoC Creator to use a custom script file, using the PSoC Creator menu Project > Build Settings > Linker > General > Custom Linker Script. If you use a custom linker script file, it is a best practice to add it to the project (menu Project > Existing Item…) and save it in the project folder." This solves issue of over written linker script file. But I am not a GCC expert. And reading GCC documentation and creating fully custom linker script file is not easy. I would request experienced people to validate my solution, though it is working with this project. Regards, Vinay |
|
|
|
现在我明白我所犯的错误:(
我认为这样的解决方案非常整洁,只适用于MDK编译器,而不适用于GCC。在那里,你所看到的似乎是唯一的解决方案。 以上来自于百度翻译 以下为原文 Oh now I see the mistake I made :( The solution I thought was so neat only works for the MDK compiler, not for gcc. There the one you are looking at seems to be the only solution. |
|
|
|
哦,谷歌环顾四周后给了我一个更好的答案。它可以设置符号地址通过命令行,例如https://stackoverflow.com/questions/495262/linking-symbols-to-fixed-addresses-on-linux
所以你可以使用 外部结构foobar foobar;在你的代码,然后调用GCC GCC - Wl - defsym,foobar = 0x76543210文件。C或你使用所谓的符号文件,存储你需要把变量的地址(见链接)。两者都应该在不修改链接器文件的情况下工作。 以上来自于百度翻译 以下为原文 Oh, Google gave me a better answer after looking around. Its possible to set symbol addresses via the command line, see e.g. https://stackoverflow.com/questions/495262/linking-symbols-to-fixed-addresses-on-linux So you can use e.g. extern struct FooBar foobar; in your code, the then call gcc with gcc -Wl,--defsym,foobar=0x76543210 file.c Or you use a so-called symbol file, storing the addresses of the variables you need placed (see the same link). Both should work without modifying the linker file. |
|
|
|
HLI
谢谢你,给了一个很好的提示。 我会尝试并发布我的结果来完成解决方案。 当做, Vinay 以上来自于百度翻译 以下为原文 HLI, Thanks, for giving a nice tip. I will try it out and post my result to complete the solution. Regards, Vinay |
|
|
|
你好,
--DeSym将SysMBOL定义为指定的地址值。 但链接不分配的快闪地点的地址。 截面命令运行良好。 例子如下: -WL,-截面启动=EEPROMEDATA=0x00 00 7F80 我重复定义em_eeprom配置在用户指定的位置在闪存与修改方案 链接器脚本文件如下: 1)在全球部分定义一个变量存储在Flash模拟EEPROM数据, static const函数时,eepstrg [ 6 ] __attribute__((第(”。eepromdata”)))= { 0,0,0,0,0,0 }; 在这里,为确保变量将被分配在ROM区。 部分指令将创建一个单独的章节的名称被分配。 请注意,这是必须要初始化一些数据EEPROM区,为em_eeprom组件进行合理分配。 2)在命令行上指定自定义链接标志 -WL,-截面启动=EEPROMEDATA=0x00 00 7F80 (地址0x00007f80选择因为它是闪光的最后一块可其他地址由您的固件代码没有使用。 ) 去项目>;建立设置>;ARM GCC 10.x.x.x - >;连接>;命令行- >;自定义旗帜- >;加- Wl,第— St==EEPROMEDATA=0x00 00 7F80 你可以验证。eepromdata部分分配在项目的地图文件0x7f70闪光的位置。 同时也附上一个示例项目。 可以逐句通过代码使用miniprog3在cy8ckit-049-42xx 希望这可能是有用的对知识产权保护的Flash的同时保持em_eeprom地区单独使用Flash unproteced块 安全文件。 当做, 维奈 E.M. 167.5 K 以上来自于百度翻译 以下为原文 Hello, --defsym defines sysmbol as specified address value. But linker does not allocate the eeprom flash locations at that address. --section commands works well. example as: -Wl,--section-start=.EEPROMDATA=0x00007f80 I am repeating the solution of defining Em_EEPROM allocation at user specified location on flash memory with out modifying linker script file as below: 1) In global section define a variable to store emulated EEPROM data in flash as, static const uint8 eepStrg[6] __attribute__ ((section (".EEPROMDATA"))) = {0,0,0,0,0,0} ; Here, const ensures that variable will be allocated in ROM area. section directive will create a separate section name to be allocated. Note, it is must to initialize the EEPROM area with some data, for Em_EEPROM component to be allocated properly. 2) specify custom linker flag on command line as -Wl,--section-start=.EEPROMDATA=0x00007f80 (Address 0x00007f80 is selected since it is last block of Flash - but can be other address not used by your firmware code. ) Go to Project->Build Settings->ARM GCC x.x.x->Linker->Command Line->Custom Flags->add -Wl,--section- start=.EEPROMDATA=0x00007f80 You can verify .EEPROMDATA section allocated at 0x7f70 flash location in project's map file. Also attaching a sample project for the same. You can step through the code using MiniProg3 on a CY8CKit-049-42xx Hope this may be useful towards IP protecting flash while keeping Em_EEPROM area seperate as unproteced block using Flash Security file. Regards, Vinay |
|
|
|
很高兴你能这么做。谢谢你的回复!
以上来自于百度翻译 以下为原文 Glad you got this working. And thanks for reporting back! |
|
|
|
你好
有人能给我解释一下EMEEPROM吗?所有的条款都很好地工作,直到我打开和回复我的开发工具包。我保存的数据随后丢失,但是数据表状态 “仿真EEPROM组件应在: 数据需要在功率周期内保存,并且目标设备没有。 专用EEPROM存储器。 但是我在每一个电源周期中都丢失了所有的数据。 请帮忙 谢谢 以上来自于百度翻译 以下为原文 Hello Can someone please explain the EM_EEPROM to me. All the exemples work well untill I unpleg and replug my dev kit. The data I saved is then lost , yet the datasheet states "The Emulated EEPROM component should be used when: Data needs to be preserved across power cycles, and the target device does not have dedicated EEPROM memory." but I loose all my data at each power cycle. Help please Thanks |
|
|
|
一些问题
1)你使用什么开发工具? 2)你如何为DeVKIT供电? 3)如何调试,使用什么接口? 你不是在重新编程这个部分,而是希望数据能静止。 居住?像构建/程序/调试周期? 一些考虑 CyPress公司 CyPress公司 CyPress公司 问候,Dana。 以上来自于百度翻译 以下为原文 Some questions - 1) What dev kit are you using ? 2) How are you powering the devkit ? 3) How are you debugging, what interface are you using ? You are not reprogramming the part and expecting the data to still reside ? Like a build / program / debug cycle ? Some considerations - www.cypress.com/ www.cypress.com/ www.cypress.com/ Regards, Dana. |
|
|
|
有人能给我解释一下EMEEPROM吗?所有的条款都很好地工作,直到我打开和回复我的开发工具包。然后,我保存的数据gt;& gt;数据表状态
在这里你可以找到一些例子: 以上来自于百度翻译 以下为原文 >> Can someone please explain the EM_EEPROM to me. All the exemples work well untill I unpleg and replug my dev kit. The >> data I saved is then lost , yet the datasheet states Here you can found some examples: www.psoc-community.de/viewtopic.php Reiner |
|
|
|
@它
你能发布你的实际完成的项目,以便我们都能看看你的所有设置吗?要做到这一点,使用C造饰者和GT;文件-GT;创建工作区束(最小)并附加结果文件。鲍勃 以上来自于百度翻译 以下为原文 @it Can you post your actual complete project, so that we all can have a look at all of your settings? To do so, use Creator->File->Create Workspace Bundle (minimal) and attach the resulting file. Bob |
|
|
|
问题解决了,谢谢大家的指点。我忘了,当你调试它,重新编程整个设备,如Dana暗示。
新的PSoC和热爱它至今。 以上来自于百度翻译 以下为原文 Problem solved, Thanks all for your pointers. I forgot that when you debug it reprograms the whole device as hinted by Dana. new to PSOC and loving it so far. |
|
|
|
只有小组成员才能发言,加入小组>>
748个成员聚集在这个小组
加入小组2051 浏览 1 评论
1805 浏览 1 评论
3615 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1742 浏览 6 评论
1496 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
474浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
329浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
396浏览 2评论
337浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
768浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-3 00:24 , Processed in 1.059407 second(s), Total 99, Slave 82 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号