完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
嗨,我写闪存的问题有问题。我有“写闪存行”例程,与微DSPIC33 F512MU810一起工作,但是用微DSPIC33 F512GM710号固件继续进入“陷阱错误”,你能帮助我吗?感恩节
以上来自于百度翻译 以下为原文 Hi. I've a problem problem with writing to flash memory. I have the "writeFLASHrow" routine that works with the micro dsPIC33f512MU810, but with the micro dsPIC33f512GM710 no. Firmware continues to go into "trap error" can you help me? Thanks Renato Attachment(s) writeFLASHrow.txt (0.70 KB) - downloaded 45 times |
|
相关推荐
14个回答
|
|
|
Xeah,有不同之处……我建议看一下各自的数据表- Flash编程。特别是行的大小在不同的家庭之间,有时甚至是导数(取决于整个闪光灯大小)。更不用说解锁/启用编程的过程。
以上来自于百度翻译 以下为原文 Xeah, there are differences ... I suggest to have a look into the respective data sheets - section Flash programming. Especially row size differs between families and sometimes even derivatives (depending on overall flash size). Not to mention the procedure to unlock / enable programming. |
|
|
|
|
|
在论坛上发现的代码,下面的微DSPIC33 F512EL512GM710i是闪存写代码数据0x30(ASCII中的“0”)的地址0x02A000的代码集,我从UART接收到60个字符的字符串,我需要将它从闪存存储在地址0x02A000 0i重置。闪存与EraseFlash()有关;这是OK。但是WreFlash行()例程不起作用。闪存参数);NVMADR=(偏移量;0xF800);NVMCON=0x400 3;/ /擦除页闪存(6);/ /禁用6 CICILIOBuuTyTnIn写(NVM)(0);UTI1616T偏移;偏移量=0;NVMSRCADRL=& RAMPATHORE(0);NVMADSRUDRU=0;NVMADRU=α-Bug TurnIn TBLIPGE(&闪存参数);/FLASH参数=0x02A000地址偏移=α-BuuxTiNT-TBLOPENCE(&;闪存参数);NVMADR=(偏移量和0xFC00);NVMCON=0x400 2;// COMANDO每SCRIVEENUA里加在Flash,SuxBuffTyNo.DISI(6);/ /禁用6 CICIL//Y-BuiTynIn Wr.WVME();NVMKEY=0x55;NVMKEY=0xAA;NVMCONBITWS=1;ASM(“NOP”);ASM(“NOP”);而(NVMCONBITS。WR);返回0;} /***********************
以上来自于百度翻译 以下为原文 Hi wrote the code as found on the forum for the micro dspic33f512el512gm710 I Below is the code I at the address 0x02a000 of the flash memory write code data 0x30 ("0" in ascii) I receive a string of 60 characters from the uart and I need to store it from the flash memory at address 0x02a000 I reset the flash memory concerned eraseFLASH (); and this is ok. But the writeFLASHrow () routine; does not work. I do not know what to do. thanks Renato //***************************** uint8_t eraseFLASH(void) { uint16_t offset; NVMADRU = __builtin_tblpage(&FLASHparameters); offset = __builtin_tbloffset(&FLASHparameters); NVMADR = (offset & 0xF800); NVMCON = 0x4003; // erase a page FLASH __builtin_disi(6); // disable interrupt per 6 cicli __builtin_write_NVM(); return 0; } //********************************************* //******************************************** uint8_t writeFLASHrow(void) { uint16_t offset; offset = 0; NVMSRCADRL = & RAMparameters [0]; NVMSRCADRH = 0; NVMADRU = __builtin_tblpage(&FLASHparameters); //FLASHparameters=0X02A000 address offset = __builtin_tbloffset(&FLASHparameters); NVMADR = (offset & 0xFC00); NVMCON = 0x4002; // Comando per scrivere una riga in FLASH __builtin_disi(6); // disable interrupt per 6 cicli // __builtin_write_NVM(); NVMKEY = 0x55; NVMKEY = 0xAA; NVMCONbits.WR = 1; asm("NOP"); asm("NOP"); while(NVMCONbits.WR); return 0; } //************************************** |
|
|
|
|
|
嗨,我已经加载了示例代码CE81-RTSP RAM。运行这个代码和我的代码有相同的结果:Flash内容被删除,但是没有用RAM阵列重写。有没有一个解决方案让Flash编程工作?最佳雷诺
以上来自于百度翻译 以下为原文 Hi, I've loaded sample code CE481 - RTSP RAM. Running this code has the same results as my code: flash contents is erased but not rewritten with the RAM array. Is there a solution to make flash programming work? Best regards Renato |
|
|
|
|
|
你是否完全使用了这个项目,或者你做了其他事情(比如整合到你的项目中,修改了一些东西)吗?
以上来自于百度翻译 以下为原文 Did you use the project completely unaltered or did you do something else (like integrating into your project, modifying "something", whatever? |
|
|
|
|
|
再试着阅读数据表。什么陷阱错误?地址,数学,堆栈,OSCIF它的地址陷阱,然后你是RD/WRE的一个奇怪的地址与一个16位/32位寄存器。可能是间接的….. 0x0201,一些ADDRMOV,ADDRMOV[ADDR],TMP..
以上来自于百度翻译 以下为原文 Try reading the datasheet again. What trap error? address, math, stack, osc If it's address trap then you are rd/wr'ing an odd address with a 16bit/32bit register. Possibly indirect. .equ 0x0201, someaddr mov #someaddr,addr mov [addr],tmp .. mov someaddr,tmp |
|
|
|
|
|
嗨,我使用了未更改的项目。在样本代码CE81-RTSP RAM中,没有陷阱错误,以及在我编写的代码中。在示例代码CE48中,数据缓冲器被写入闪存,然后重置,然后重写。闪存被重置(到0xFFFF),但不重写。不知道如何编程Flash记忆最好的问候
以上来自于百度翻译 以下为原文 Hi, I used the unaltered project. in the sample code CE481 - RTSP RAM there is no trap error, as well as in the code I wrote. In the sample code CE481 a data buffer is written to flash memory, then it is reset and then it should be rewritten. The flash memory is reset (to 0xffff) but is not rewritten. I do not know how to program flash memory Best Regards |
|
|
|
|
|
配置位呢?只是一些提示:你有没有意外写保护活跃?或者最终看门狗在写入序列结束之前导致复位,电源电压是多少?
以上来自于百度翻译 以下为原文 What about the configuration bits? Just some hints:
|
|
|
|
|
|
HII使用Explorer 16/32开发板DM24001和PIM DSPIC33 EP512GM710GP—MA3300 35。电源电压是开发板的电源电压。在我看来,应用注意事项CE81可以启用看门狗或启用写保护。雷纳托。
以上来自于百度翻译 以下为原文 Hi I use Explorer 16/32 Development Board DM240001 and PIM DSPIC33EP512GM710 GP - MA330035. The supply voltage is that of the development board. It does not seem to me that the application note CE481 enables the watchdog or enabled write protection. Renato |
|
|
|
|
|
|
|
|
|
|
|
嗨,重写:-陷阱错误已经消失;在你的应用注意事项CE41我没有设置或重置任何配置位;应用程序NOTECE81的固件不重写闪存。
以上来自于百度翻译 以下为原文 Hi, Recapping: - the trap error is gone; - In your aplication note CE481 I have not set or reset any configuration bit; - The firmware of the application note CE481 does not rewrite the flash memory. |
|
|
|
|
|
Hias是否检查过Apple TeNote是否有效?我做了更多的测试,但是FLASH写作对ReNATO没有效果。
以上来自于百度翻译 以下为原文 Hi has anyone checked if the aplication note works? I have done more tests but flash writing does not work best regards renato |
|
|
|
|
|
1)写Flash肯定是工作-你的程序已经写到Flash,所以部分必须是OK2),如果你仍然使用你在后3版本中显示的代码,然后返回到使用当C编译器不需要精确地生成解锁所需的代码时,它总是最好的方法。3)当你不知道它的每一个部分都是什么时候使用应用笔记代码总是有问题的,特别是如果你使用的是一个不同的处理器(不确定)。是)。最好是参考FRM部分为您的设备,并使用例子在那里。苏珊
以上来自于百度翻译 以下为原文 1) Writing to flash definitely does work - you program got written to flash so that part must be OK 2) If you are still using the code you showed in post #3, then go back to using the __builtin_xxx macro. It is always the best way to go as the C compiler need not generate *exactly* the code that is needed for the unlocking. 3) It is always problematic to use application note code when you don't know exactly what every part of it does, especially if you are using a different processor (not sure if you are). It is always better to refer to the FRM section for your device and use the examples there. Susan |
|
|
|
|
|
你好,苏珊,谢谢你的回答!我已经改写了“WrreFlash行”例程,如前所述,“EraseFlash”例程,见第3页,工作正常。但是“WrreFlash行”不重写闪存。我不知道他做了什么错事。我相信我会回到DSPIC33 EP512MU810,在那里我写了FLASH ME。遗憾的是,在MCC.Unt88t写写闪存(空隙){Unt160t偏移;偏移量=0;NVMSRCADRL=&和RAMPATRAMS(0);NVMADSRADRH=0;NVMADR=0xA000;//(闪存地址和0xFFFF);NVMADRU=0x02;//((闪存地址& Gt;& 16;)和0xFFFF);n=0x400 2;//在Flash ItCON2&=0x8000中写入一行;//禁用GEI NVMKEY=0x55;NVMKEY=0xAA;NVMCONBITW.WR=1;ASM(“NOP”);ASM(“NOP”);而(NVMCONBITS。WR);ItCON2=0x8000;/ /启用GEI返回0;}最好的问候。雷纳托。
以上来自于百度翻译 以下为原文 Hi Susan and thank for your answer! I have rewritten the "writeFLASHrow" routine as shown below. As before, the "eraseFLASH" routine, see post 3, works correctly. But the "writeFLASHrow" does not rewrite the flash memory. I have no idea what he's doing wrong. I believe I will return to the dspic33ep512mu810, where the writing in flash memory worked. my regret is that there is no dspic33ep512mu810 in MCC. uint8_t writeFLASHrow(void) { uint16_t offset; offset = 0; NVMSRCADRL = & RAMparameters [0]; NVMSRCADRH = 0; NVMADR = 0xa000; //( flashAddress & 0xFFFF ); NVMADRU = 0x02; //( (flashAddress >> 16) & 0xFFFF ); NVMCON = 0x4002; // write one row in FLASH INTCON2 &= ~ 0X8000 ; // disable gei NVMKEY = 0x55; NVMKEY = 0xAA; NVMCONbits.WR = 1; asm("NOP"); asm("NOP"); while(NVMCONbits.WR); INTCON2 |= 0X8000 ; //enable gei return 0; } best regards. Renato |
|
|
|
|
|
请参阅我在文章后面的第2页中的第13点,以及Flash编程FRM部分的第5-11页的顶部。此外,“DISI”指令被设计为关闭给定周期数的中断。我不认为CPU看任何中断源文件,Flash写正在进行中。查看Flash程序的MCM部分(第5节),我看到它使用TBLPAG寄存器和TBLWTL和TBWWTH寄存器加载写锁存器。然而,数据表的第5.4部分表示使用NVMSRCADRX寄存器(如上面代码示例中所示)。也许这需要在Microchip中调用一个支持票来查看哪种方法是正确的。也请使用代码示例周围的代码标签——这使得阅读更容易。最后,你如何确定写不起作用?这很重要。愚弄你正在使用的工具。苏珊
以上来自于百度翻译 以下为原文 See my point #2 in my post #13 above, and the top of Page 5-11 of the Flash Programming FRM section. Also the 'disi' instruction is designed to turn off interrupts for a given number of cycles. I don't think the CPU looks at any interrupt sources file the FLASH write is in progress. Looking at the FRM section for that MCU for Flash Programming (Section 5), I see that it says that it uses the TBLPAG register and TBLWTL and TBLWTH registers to load the write latches. However Section 5.4 of the datasheet says to use the NVMSRCADRx registers (as you have in your code example above). Perhaps this needs to be called out to Microchip in a support ticket to see which is the correct approach. Also please use the code tags around your code examples - it makes it much easier to read. Finally, how are you determining that the write has not worked - this is important as you may be being fooled by tools you are using. Susan |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1122浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 00:39 , Processed in 0.981185 second(s), Total 68, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1856