• 发文章

  • 发资料

  • 发帖

  • 提问

  • 发视频

创作活动
0
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
返回

电子发烧友 电子发烧友

  • 全文搜索
    • 全文搜索
    • 标题搜索
  • 全部时间
    • 全部时间
    • 1小时内
    • 1天内
    • 1周内
    • 1个月内
  • 默认排序
    • 默认排序
    • 按时间排序
  • 全部板块
    • 全部板块
大家还在搜
  • 单片机 电子琴程序,矩阵按键扫描处理

    DPTR,#7FFFHCLR P3.4MOVXA,@DPTRMOV 37H,ACPL AJZKSK1LCALLDELAYMOVXA,@DPTRXRL A,37HJZKS1KSK

    2014-05-16 11:11

  • 独立十六进制时没有启动呢?

    嗨,我的Bootloader显示了一个Struts行为(至少对我来说)。我有一个引导加载程序和一个应用程序。当我使用统一的十六进制,由MPLABX创建时,一切都运行良好。引导加载程序启动、检查其条件并启动应用程序(基本上通过调用_RESET_ADDR中的地址)。在下一次重新启动时,将触发引导加载程序加载新的应用程序十六进制(不是统一十六进制,而是单个应用程序十六进制)并对闪存进行编程。它试图启动应用程序,但失败并进入重新启动循环。请注意,应用程序本身没有改变!这就是奇怪的部分:为什么应用程序在带有统一十六进制时启动时没有问题,而在闪烁“独立十六进制”时没有启动呢?两者应该有相同的内容,不是吗?到目前为止,我实际上是通过将EBASE地址放在KSG00SuffyTyMeM中来实现应用程序的工作。现在我需要理解为什么这样工作。有人能解释一下为什么ebase地址需要位于kseg0_._mem内部吗?我认为KSt00Studio MEM基本上是C程序。我也在这个论坛上看到,eBASE可以从任何地方开始从和谐1.08。在大多数示例中(如在AN1388中),ebase是0x9d000000,而kseg0_._mem在此之后开始。*统一过程做什么?它可能会改变地址而不这样说。*当前配置是否正确(安全使用)?或者这只是巧合吗?我使用的是PIC32 MZ2048 EFM114。引导加载程序本身松散地基于Harmony加载程序,但是完全不同(但是它使用NVM.c来编程应用程序)。我确信十六进制的字节被正确地写到闪存中。这是我的bootloader.ld(引导加载程序被放置在引导内存中)和(不工作)application.ld:这是可以工作的application.ld(引导加载程序没有改变):

    2020-03-19 10:38

  • 链接器脚本修改已经工作的项目

    大家好!我正在编程一个PIC32 MK0512GPE064,我已经有两个工作项目:BooLoad应用程序在MPLAB X i中创建了两个项目,作为“32位MPLAB和谐项目”。有了和谐,我没有选择“Bootloader库”选项。我只是把这两个项目编程为普通项目。在Bootloader中,我已经包含了一个跳转到应用程序,它应该被放置在一个定义的地址。现在,我想修改默认链接器脚本,以便将源代码分开,并将应用程序代码放置在一个定义的地址。这个想法如下:自己定义的内存区域大小应用休眠的可用内存储备0x1000数据区域3 0x1000数据区域2 0x1000 DAT区域1 0x1000引导加载程序0x400 0i将引导引导程序代码放在引导闪存区域,以避免引导程序可以被应用程序覆盖,但这不是必须的。两个项目的T和我保存在扩展名为“.LD”的文件中。我已经将文件添加到相应的项目中,并且我修改了以下内容来尝试执行上述任务(同时尝试在Bootloader和应用程序中设置程序Flash KSGE0)。在Bootloader内存中修改的行{/*******************,将KSG00SuffyTyMem的长度设置为0x4000,因为*是引导加载程序的保留长度。如果引导加载程序的大小超过这个长度,它将引发一个错误。***************************************************************************************************************************************************************************************************************************************************************************************************************:Orth= 0x9D90000,长度=0x8000×*/KSt00SudioMym(Rx):Orth= 0x9D00亿,长度=0x4000在应用程序/*中提供的修改行。000000);*/Provices(*eBaseAdvase= 0x9D000 A000);/*KSG00ProjyMeX(RX):Orth= 0x9D90000,长度=0x8000×*/KSe00ProjyMeX(Rx):Orth= 0x9D000 A000,长度=0x7600i,未提及两个项目的配置位相同。折叠工程作为可装载工程。如果我执行调试会话,引导加载程序工作,即使在引导程序跳转之后,我也可以在应用程序中进行调试。但是,在某一行上,它会再次意外地跳转到引导加载程序,并在某个函数上永远等待。如果我尝试编程PIC,我会得到以下错误:“创建统一的HEX文件”(944)地址XXXXXX之间的数据冲突在…/Appultual.HEX和…/BooLoad .HiXi怀疑另一个内存区域应该在闪存上移动,但是我已经尝试过没有成功地完成它。非常感谢您的帮助,谢谢您。 以上来自于百度翻译 以下为原文 Hello everyone! I am programming a PIC32MK0512GPE064 and I have already two working projects:bootloaderapplicationIn MPLAB X I created both projects as "32-bit MPLAB Harmony Project". With Harmony, I did not choose the option "Bootloader Library". I just programmed both projects as normal ones. At the bootloader, I have already included a jump to the application, which should be placed at a defined address. Now, I would like to modify the default linker script in order to separate both source codes and to place the application code at a defined address. The idea is the following: OWN DEFINED MEMORY REGIONSIZEapplicationrest of the available memoryreserve0x1000data region 30x1000data region 20x1000data region 10x1000bootloader 0x4000 I would like to place the bootloader code at the Boot Flash Area, in order to avoid that the bootloader can be overwritten by the application, but this is not a must. I used -verbose to see the default linker script of both projectsand I saved it at files with extension ".ld". I have added the files to the corresponding projects and I have modified the following to try to do the mentioned task (while trying to place bootloader and application at programm flash kseg0). Modified lines at the bootloaderMEMORY{/*************************************************************** * The length of kseg0_program_mem will be set to 0x4000, because * that is reserved length for the bootloader. It will throw * an error if the bootloader size exceedes this length. ****************************************************************/ /*kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x80000*/ kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x4000 Modified lines at the application/*PROVIDE(_ebase_address = 0x9D000000);*/PROVIDE(_ebase_address = 0x9D00A000); /*kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x80000*/ kseg0_program_mem (rx) : ORIGIN = 0x9D00A000, LENGTH = 0x76000 I have not mentioned that the configuration bits of both projects are identical. Then I add the bootloader project at the application project as a loadable project. If I execute a debug session, the bootloader works and I can debug even at the application after the jump from the bootloader. However, at a certain line, It makes an unexpected jump to the bootloader again and waits forever at a certain function. If I try to program the PIC, I get the following error: "Creating unified hex file"(944) data conflict at address XXXXXX between .../application.hex and .../bootloader.hex I suspect that another memory regions should be shifted at the flash memory, but I have already tried to do it without success. I would appreciate your help very much. Thank you in advance.

    2018-11-20 15:20

  • Pic32 MZ Linker不能读取任何PIC端口

    的重置.0x220 544复位处理程序。BEVYEXPT 0xBFC3380 0x10 16 BEV异常总KSK1Y-BOOTHOMEM使用:0x230 560 560 0x480

    2019-03-28 13:09

  • XC32链接器错误,用于尝试在绝对地址上分配持久数据

    IDE版本:MPLA4.0编译器XC32 GCC版本V1.44背景信息/上下文:我的Bootloader应用程序在一个绝对RAM地址中使用一个持久的数据标志,“BootSuMeDEYStand”,这是由引导加载程序和运行时程序已知的,当运行时应用程序被触发接受固件升级时,将分配一个唯一的标志值,然后做一个软盘(),其中引导装载器将读取标志值并进入固件升级模式。因此,我需要指示编译器和链接器允许绝对地址和持久内存属性。158提供以下示例,用于在绝对地址指定命名数据区段:INTO FO AyAtditTyx((节(MyStage)),地址(0xA000)),此外,编译器指南显示在第34页上,如何用下面的例子分配持久数据:int TBUDX x属性表最后,XC32汇编程序、链接器和实用工具用户指南在第59页上标识了持久数据对象的节名“坚持”,并且自定义链接器脚本的持久部分如下:.Currase:{ItasyListDe=;.*(.Currest.Actult.*)*(.PBSS.PBSS.*)= AlcIn(4);yTrimeEngult=;} & kSG1L1DATA.MeSO,我将所有上述信息应用到我的单个持久数据项UIT32 BooToMoDeIOM状态中,在定义为0xA000 00 4的持久数据区域中,大小为4字节,正好适合我的数据,如下:在我的自定义链接器脚本中:+=4;*(.Currest.Actult.*)*(.PBSS.PBSS.*)。=对齐(4);有人能对此提出建议/见解/建议吗?谢谢,马卡姆 以上来自于百度翻译 以下为原文 IDE version: MPLAB 4.0Compiler xc32-gcc version v1.44 Background Info/Context:My bootloader app is using a persistent data flag, 'boot_mode_status' in an absolute RAM address, known by both the bootloader and the run time program, that when the run time app is triggered to accept a firmware upgrade, will assign a unique flag value and then do a SoftReset(), wherein the bootloader will read the flag value and enter a firmware upgrade mode. So, I need to instruct the compiler and linker to allow for BOTH an absolute address and persistent memory attributes.The XC32 Compiler User's Guide, on page 158 provides the following example for designating a named data section at an absolute address:int foo __attribute__((section("mysection"),address(0xA0000004))); Furthermore, the Compiler guide shows on page 34, how to allocate persistent data with the below example:int tblIdx __attribute__ ((persistent)); Finally, the XC32 Assembler, Linker and Utilities User's Guide identifies on page 59 the section name, 'persist' for persistent data objects.And, the Custom Linker script has the persistent section as follows: .persist : { _persist_begin = .; *(.persist .persist.*) *(.pbss .pbss.*) . = ALIGN(4) ; _persist_end = .; } >kseg1_data_memSo I applied all of the above information to my single persistent data item, UINT32 boot_mode_status, in the persistent data region I defined to start at 0xA0000004, with a size of 4 bytes, just big enough for my data, as below:====================================================================In my custom linker script:.persist 0xa0000004 : { _persist_begin = .; . += 4; *(.persist .persist.*) *(.pbss .pbss.*) . = ALIGN(4) ; _persist_end = .; } >kseg1_data_mem In my C file:UINT32 boot_mode_status __attribute__((section(".persist")));=============================================================The result, was the below link error, “Error: Attributes for section '.persist' conflict with implied attributes” Can anyone lend instruction/insight/advise on this? Thanks,Markham

    2018-12-28 15:45

  • 怎么从应用程序更新Bootloader?

    我的应用程序的完全相同的源文件,只有我做的更改是使用NVBWP相关函数来禁用BFM WP的附加函数,将区域的地址更改为擦除/编程。主引导加载程序链接器:-KSK1Y-BootmiMe:Ont

    2019-04-09 10:22

  • 清除PI32MZ中的RAM

    我的任务是清除(设置为0)所有的RAM中的PIC32 MZ2048 EFH1。XC32编译器已经清除了多少RAM。全局和静态。只是堆和堆栈吗?2。使用Ion OnReStE.()看起来这是可能的。但是它不能使用RAM。需要避免其他领域吗?堆栈?或者这里真的需要ASM吗? 以上来自于百度翻译 以下为原文 I am Tasked with clearing ( set to 0) All the RAM in a PIC32MZ2048EFH1. How Much of the RAM does the XC32 compiler already clear.Globals and Statics.Is it Just The Heap and the Stack?2. Using _on_reset() looks like it would be a possibility. _on_bootstrap() too late* I assume a careful C function could work.but it could not use RAM.would it need to avoid other areas?The Stack?* Or is ASM really needed here?

    2018-12-03 11:29

  • PIC32MX Bootloader混淆

    我正在尝试让HootBootloader加载我的其他应用程序。我使用的是产品版本:MPLAB X IDE V4.15Java:1.8 0144;Java热点(TM)64位服务器VM 25.144-B01RunTime:Java(TM)SE运行时环境1.80y144-B01Stase:Windows 10版本10在AMD64上运行;CP1252;EnUUS(MPLAB)和和声版本V2Y05Y01I,用PIC32 MX795F512L PI运行。M在ExpReab16BoADI已经使用Orthor生成了Bootloader。我使用GPIO交换机(交换机3)PIN来检测引导加载程序的改变,并且LED闪烁显示我在Bootloader中,这里都很好。生成的BTLYMX.LD文件有以下的值SyrSeTeEdAdDR=0xBFC000;EVA ExpPTIAdDR=(0xbfc00+0x380);不可用于孤儿节。*仅分配给这些区域的部分可以分配到这些区域中。************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************C01000,长度=0x100/*中断向量表*/CONT3:Orth= 0xBFC02FF0,长度=0xBFC02FF4,长度=0x4配置1:Orthe= 0xBFC02FF8,长度=0x4配置0:Orth= 0xBFC02FFC,长度=0x4KSSE1B-BooToMeM:原点=0xbfc000,长度=0x300/*c启动代码*/KSEG1XDATAYMEM(W)!X):Oracle=0xA000 000,长度=0x2万SFRS:Orthe= 0xBF8000,长度=0x100000 Debug gExpReMeM:原点=0xBFC02000,长度=0xFF0配置FRS:Orthe= 0xBFC02FF0,长度=0x10},现在我将通过OrthyOpHelpHyVuluMyV.PDF文件(以下)中找到的指令。这似乎我需要改变长度= 0x2AF0-gt;0x3000以上的KSG00Sudio MyMeMe,但在步骤4)我真的很困惑。Bootloader SypLyFig .h(下)对于APPYFLASH BaseX地址(0x9d00)具有以下值。这是否意味着我将AppHFLASH BASEXY地址从0x9900MAMP改为(0x9FC00 500 +0x3000)?我该怎么办?那么,在步骤5中,我应该如何为我的应用程序做EBASE值呢?Bootloader Stuly.CONFIG.H.*定义APPYFLASH BaseX地址(0x9d00),定义应用程序开始执行*//*规则的AppHyFLASH Endox地址(0x9dMAM+0x8000 - 1)/*地址:将APPYFLASH BASEXY地址设置为应用程序链接器脚本*/y*定义的AppReStayADDR值TyAdvor(AppMyFraseBaseX地址)定义了BooTouleSerialPixy定义BTLYwitter BSPwitwits3,定义BooLoad Server Flash OrthPrigelyAddioOrthyApHelpHyMulnEnv.PDF.这部分描述了将用户应用程序放入所需程序闪存区域的过程。必须确保用户应用程序的内存区域与为引导加载程序保留的内存区域不重叠。MHC生成的引导加载程序应被视为您的产品引导程序的起点。因此,添加新的特性可能会导致引导加载程序超过引导加载程序链接器脚本中所需的大小。此外,在Apps/Bootloader /Basic文件夹中提供的引导加载程序被配置为-O1编译器优化。它不是Bootloader的最小可能大小,打开O-ORMIPs16/MyMIPS代码选项将减少引导加载程序的大小。如果引导加载程序的大小发生变化,则应执行以下步骤来调整引导加载程序和应用程序,以便使两者都适合并充分利用设备内存。1。为引导加载程序在程序Flash中确定新的结束地址。这可以通过使用MPLAB XIDE生成的.map文件和相应的编译器,或者使用MPLAB X IDE。2的ELFVIEWER插件来完成。把地址转到最近的页面边界。对于具有1K页面大小的设备,地址必须在0x400边界上结束。对于具有4K页面大小的设备,地址必须在0x1000边界上结束。3。在Bootloader中,更改以下文件:在PIC32 MX设备的BTXYMX.LD中,将KSeG0x程序Mem的长度更改为PIC32 C设备的BTLYCZ.LD中的新边界,将闪存区域长度值更改为新边界。在StasySCOFIG.h中,更改APPYFLASH BASEXY地址的值,以匹配预先确定的虚拟地址。在应用程序中,更改链接器脚本AppYMX.LD如下:将更改的AbaseX地址更改为新的边界,再加上足够的页以获得在4K(0x1000)边界上的地址开始的异常。这是为了将其对齐在MIPS核心所需的边界上。新的边界预先确定:将KSG00SUPLE程序MEM的起始值更改为新边界。重新编译Bootloader和应用程序以及测试操作。 以上来自于百度翻译 以下为原文 I am in the process of trying to get the Harmony bootloader to load my other application. I am using Product Version: MPLAB X IDE v4.15Java: 1.8.0_144; Java HotSpot(TM) 64-Bit Server VM 25.144-b01Runtime: Java(TM) SE Runtime Environment 1.8.0_144-b01System: Windows 10 version 10.0 running on amd64; Cp1252; en_US (mplab)And Harmony version v2_05_01 I am running this with PIC32MX795F512L PIM on Explorer16 BoardI have generated the bootloader using harmony. I am using a GPIO Switch (Switch 3) pin to detect the bootloader change and LED is flashing telling me that I am in the bootloader and all is well here. The generated btl_mx.ld file has the following values _RESET_ADDR = 0xBFC00000;_BEV_EXCPT_ADDR = (0xBFC00000 + 0x380);_DBG_EXCPT_ADDR = (0xBFC00000 + 0x480);_DBG_CODE_ADDR = 0xBFC02000;_DBG_CODE_SIZE = 0xFF0;_GEN_EXCPT_ADDR = _ebase_address + 0x180;/************************************************************************* * Memory Regions * * Memory regions without attributes cannot be used for orphaned sections. * Only sections specifically assigned to these regions can be allocated * into these regions. *************************************************************************/MEMORY{ kseg0_program_mem (rx) : ORIGIN = 0x9FC00500, LENGTH = 0x2AF0 /* All C Files will be located here */ kseg0_boot_mem : ORIGIN = 0x9FC00020, LENGTH = 0x0 /* This memory region is dummy */ exception_mem : ORIGIN = 0x9FC01000, LENGTH = 0x1000 /* Interrupt vector table */ config3 : ORIGIN = 0xBFC02FF0, LENGTH = 0x4 config2 : ORIGIN = 0xBFC02FF4, LENGTH = 0x4 config1 : ORIGIN = 0xBFC02FF8, LENGTH = 0x4 config0 : ORIGIN = 0xBFC02FFC, LENGTH = 0x4 kseg1_boot_mem : ORIGIN = 0xBFC00000, LENGTH = 0x300 /* C Startup code */ kseg1_data_mem (w!x) : ORIGIN = 0xA0000000, LENGTH = 0x20000 sfrs : ORIGIN = 0xBF800000, LENGTH = 0x100000 debug_exec_mem : ORIGIN = 0xBFC02000, LENGTH = 0xFF0 configsfrs : ORIGIN = 0xBFC02FF0, LENGTH = 0x10}Now I am going through the instructions found in harmony_help_volumne_V.pdf file(Below).So from Step 3 below, this it seems that I need to change the LENGTH = 0x2AF0 ->0x3000 above for kseg0_program_memBut in step 4) I am really confused. The bootloader system_config.h (below) has the following value for APP_FLASH_BASE_ADDRESS (0x9D000000).Does this mean that I change APP_FLASH_BASE_ADDRESS from 0x9D000000 to (0x9FC00500+0x3000)? What should I do here?Then what should I do for my Applications _ebase value in step 5? bootloader system_config.h #define APP_FLASH_BASE_ADDRESS (0x9D000000)#define APP_FLASH_END_ADDRESS (0x9D000000 + 0x80000 - 1)/* Address of the Flash from where the application starts executing *//* Rule: Set APP_FLASH_BASE_ADDRESS to _RESET_ADDR value of application linker script*/#define APP_RESET_ADDRESS (APP_FLASH_BASE_ADDRESS)#define BOOTLOADER_LEGACY#define BTL_SWITCH BSP_SWITCH_3#define BOOTLOADER_FLASH_TRIGGER_ADDRESS 0 harmony_help_volumne_V.pdfThis section describes the procedure to place a user application into a desired program Flash memory region. It must be ensured that the userapplication’s memory region does not overlap with the memory region reserved for the Bootloader.The Bootloader generated by MHC should be considered a starting point for your product’s Bootloader. As such, adding new features may causethe Bootloader to exceed the size intended in the Bootloader linker script. In addition, the Bootloaders provided in the apps/bootloader/basicfolder are configured to the –O1 compiler optimization. It is not the smallest possible size for the Bootloader, and turning on the –Os orMIPS16/microMIPS code options will reduce the size of the Bootloader.If the size of the Bootloader changes, the following steps should be performed to adjust both the Bootloader and the application in order to makesure that both fit and make best use of the device memory.1. Determine the new ending address in Program Flash for the Bootloader. This can be done by using either the .map file generated by MPLAB XIDE with the respective Compiler, or by using the ELFViewer plug-in for MPLAB X IDE.2. Round the address up to the nearest page boundary. For devices with 1K page sizes, the address must end on a 0x400 boundary. For deviceswith 4K page sizes, the address must end on a 0x1000 boundary.3. Within the Bootloader, change the following files:• In btx_mx.ld for PIC32MX devices, change the length of kseg0_program_mem to the new boundary• in btl_cz.ld for PIC32 C devices, change the Flash memory region LENGTH value to the new boundary4. In system_config.h, change the value for APP_FLASH_BASE_ADDRESS to match the virtual address determined previously5. Within the application, change the linker script, app_mx.ld, as follows:• Change _ebase_address to the new boundary, plus enough pages to get the exceptions to start at an address on a 4K (0x1000) boundary.This is to align it on the boundary required by the MIPS core.• Change _RESET_ADDR to the new boundary previously determined• Change the ORIGIN value for kseg0_program_mem to the new boundary6. Recompile both the Bootloader and the application, as well as test operations.

    2018-10-11 08:37

  • bootloader链接错误:无法分配部分

    大家好。我试着用SD-Car配置一个和声Bootloader程序。在生成代码后,我得到了很多“链接错误:不能分配部分”。我使用PIC32 MX470F512H和和声1.09。在PDF“MPLAB®和声帮助-引导加载程序库”中找不到任何信息。我猜我是HAV。最初的Bootloader回调寄存器?有什么想法吗? 以上来自于百度翻译 以下为原文 Hi everybody.I tried to configure a Harmony bootloader program with a SD-card.After generate the code, I get a lot of "Link Error: Could not allocate section".I use a PIC32MX470F512H and Harmony 1.09.I couldn'tfind any information in the pdf "MPLAB® Harmony Help -Bootloader Library".I guess I have to initial first the bootloader callback register ?Any ideaa ?

    2019-04-24 06:29

  • Harmony V2.05 Bootloader链接器脚本不起作用

    和谐V2.05.01MHC V2.05.02MPLABX V4.05PIC32 MX530F128H由MHC生成的Bootloader的链接脚本有问题..脚本使程序在任何中断启用时崩溃,我认为MX会更容易,但我想不会。 以上来自于百度翻译 以下为原文 Harmony V2.05.01MHCV2.05.02MplabX V4.05PIC32MX530F128H The Linker script for the Bootloader generated by MHC has issues..The script cause the Program to crash when any interrupts are enabled. I thought the MX would be easier, But I guess not.

    2018-11-14 16:21