完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
进入延迟宏的步骤导致了一个地址错误陷阱。在这个步骤中,堆栈窗口改变了FoMTOC源:DASASAMBLE代码:MPLABX 4.20xC16 1.35 O0DSPIC33 EP512MC506ICD3I不能看到的问题是。有什么想法吗?
以上来自于百度翻译 以下为原文 The step into the delay macro caused an address error trap. With this step the stack window changes from test_flash ( ) at C:/Git_lokal/test/Main/./eeprom.c : 430 main ( ) at C:/Git_lokal/test/Main/./main.c : 1013 to test_flash ( ) at C:/Git_lokal/test/Main/./eeprom.c : 430 Call frame information unavailable. Is frame pointer omitted or compiler optimization level higher than 0? C Source: if (ee_adr%PAGESIZE == 0) status= I2C_EEPROM_PageWrite (&eepromInstance, &page[0], ee_adr); Nop(); __delay_ms(10); Nop(); Disassambled code: 428: status= I2C_EEPROM_PageWrite (&eepromInstance, &page[0], ee_adr); 00D948 470068 ADD W14, #0x8, W0 00D94A 90011E MOV [W14+2], W2 00D94C 9001AE MOV [W14+4], W3 00D94E 780080 MOV W0, W1 00D950 21E5C0 MOV #0x1E5C, W0 00D952 021382 CALL I2C_EEPROM_PageWrite 00D954 000001 NOP 00D956 984760 MOV.B W0, [W14+6] 429: Nop(); 00D958 000000 NOP 430: __delay_ms(10); 00D95A 227C00 MOV #0x27C0, W0 00D95C 200091 MOV #0x9, W1 00D95E 02365C CALL ___delay32, .Letext0, .LFE1 00D960 000001 NOP 431: Nop(); 00D962 000000 NOP MPLABX 4.20 XC16 1.35 -O0 dsPIC33EP512MC506 ICD3 I can not see were the problem is. Any idea? |
|
相关推荐
6个回答
|
|
|
|
|
|
I2CYEEPROMYPAGE和I2CYEEPROMETHT来自MCCit产生的EEPROM LIB V1.00是24FC512 EEPROM,EEADR在CARCURNE2CYEEPROMPEX Page之前被检查为页面的开始。
以上来自于百度翻译 以下为原文 typedef struct { unsigned char busAddress; ///< Slave Address bits A2, A1 I2C_CHANNEL channel; ///< I2C channel identifier } I2C_EEPROM_T; #define PAGESIZE (128) uint32_t ee_adr; I2C_EEPROM_T eepromInstance={0x50,I2C_EEPROM_CH1}; uint8_t page[PAGESIZE] I2C_EEPROM_PageWrite and the I2C_EEPROM_T are from the EEPROM lib V1.00 generated by MCC it is a 24FC512 EEPROM and eeadr is checked to be at start of a page before calling I2C_EEPROM_PageWrite if (ee_adr%PAGESIZE == 0) I2C_EEPROM_PageWrite (...); |
|
|
|
你还*创建了一个“I2CYEEPROMYTHT”类型的EEPROMASTATION变量?
以上来自于百度翻译 以下为原文 You also *did* create a eepromInstance variable, of type "I2C_EEPROM_T" ? |
|
|
|
MCC做到了,我把代码插入了最后一篇文章。
以上来自于百度翻译 以下为原文 MCC did, I have inserted the code in last post. |
|
|
|
听起来不错:那时还不确定,我从来没有使用过那些库函数…
以上来自于百度翻译 以下为原文 Sounds good enough: not sure then, and I never used those library functions... |
|
|
|
仍然有问题。现在我已经从这个线程中插入了来自GUYMC的代码。不幸的是地址数组[0-2 ]的值是0x000。我必须使用一个调用而不是rCALL。为什么我不能得到导致地址陷阱错误的正确地址?这是内联汇编程序:
以上来自于百度翻译 以下为原文 Still have the problem. Now I have inserted the code from guymc from this thread. Unfortunately the address array [0-2] has a value of 0x0000. I have to use a call instead of rcall. Any idea why I can not get the proper address that cause the address trap error? unsigned int AbortAddressContainer[3]; void __attribute__((interrupt(preprologue("call _where_was_i")),no_auto_psv)) _AddressError(void) { Nop(); // Set breakpoint here. When hit, variable _RA shows the return address Nop(); Nop(); } and this as inline assembler: ; ; Storage for the exception return address ; .section *,bss,near .global __AbortAddressContainer __AbortAddressContainer: .space 4 ; address where the exception occurred .space 2 ; previous word of stack data ; ; Function to read exception return address ; from the stack, plus the previous word ; .text .global _where_was_i _where_was_i: push.d w0 sub w15,#12,w1 ; twelve bytes pushed since last trap! mov [w1], w0 mov w0, __AbortAddressContainer mov [w1+2], w0 mov.b WREG, __AbortAddressContainer+2 mov [w1-2], w0 mov w0, __AbortAddressContainer+4 pop.d w0 return ; ; Tabulation of stack usage since the exception ; occurred (read from bottom to top). ; ; current SP +12 ; ; push w1 +10 ; where_am_i push w0 +8 ; ; rcall in PC 22->16 +6 ; handler PC 15->0 +4 ; ; PC 22->16 +2 ; TRAP! PC 15->0 +0 |
|
|
|
只有小组成员才能发言,加入小组>>
5244 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3214 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2261 浏览 5 评论
780浏览 1评论
676浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
602浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
684浏览 0评论
581浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-26 05:02 , Processed in 1.455787 second(s), Total 87, Slave 71 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号