Microchip
直播中

张润

8年用户 238经验值
私信 关注
[问答]

闪存写入dsPIC33ep512GM170进入错误

嗨,我写闪存的问题有问题。我有“写闪存行”例程,与微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)

王璨

2018-9-21 10:56:21
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.
举报

李慎梓

2018-9-21 11:14:17
在论坛上发现的代码,下面的微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;
}
//**************************************
 
举报

李慎梓

2018-9-21 11:28:36
嗨,我已经加载了示例代码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
举报

王璨

2018-9-21 11:44:19
你是否完全使用了这个项目,或者你做了其他事情(比如整合到你的项目中,修改了一些东西)吗?

以上来自于百度翻译


      以下为原文

   
Did you use the project completely unaltered or did you do something else (like integrating into your project, modifying "something", whatever?
举报

更多回帖

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