完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
本帖最后由 一只耳朵怪 于 2018-6-6 14:29 编辑
咨询ti工程师: 你好!我在使用TMS320F28027时遇到如下问题:程序仿真正常(CCS5),修改配置烧写程序不断电情况下正常工作,断电拔掉仿真头重启,程序运行错误。 附: 1、电路板自己制作,GPIO34和TDO都有上拉,XPS悬空 2、配置文件F28027.cmd为例程V210版本的 3、在定义的头文件中添加了 #pragma CODE_SECTION(InitFlash,"ramfuncs"); 4、主程序文件中 extern Uint16 RamfuncsLoadStart; extern Uint16 RamfuncsLoadEnd; extern Uint16 RamfuncsRunStart; void MemCopy(Uint16 *SourceAddr, Uint16* SourceEndAddr, Uint16* DestAddr) [ while(SourceAddr < SourceEndAddr) [ *DestAddr++ = *SourceAddr++; ] return; ] //------Flash初始化--------------------------------------------------------- void InitFlash(void) [ EALLOW; FlashRegs.FPWR.bit.PWR = 3; FlashRegs.FSTATUS.bit.V3STAT = 1; FlashRegs.FOPT.bit.ENPIPE = 1; /* 使能FLASH的流水线模式 */ FlashRegs.FBANKWAIT.bit.PAGEWAIT = 2; /* 访问flash页等待2小于40M时都为1*/ FlashRegs.FBANKWAIT.bit.RANDWAIT = 2; /* 随机访问等待2*/ FlashRegs.FOTPWAIT.bit.OTPWAIT = 3; /* 访问OPT等待2*/ FlashRegs.FSTDBYWAIT.bit.STDBYWAIT = 0x01FF; FlashRegs.FACTIVEWAIT.bit.ACTIVEWAIT = 0x01FF; EDIS; asm(" RPT #7 || NOP"); ] 5、在main函数中有 #ifdef FLASH //--------------------------------------------------------------- MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart); //------Flash初始化--------------------------------------------------------- InitFlash(); #endif 6、在编译器的predefined symbols中定义“FLASH” "LARGE_MODEL" "_DEBUG" 7、映射文件如下: ****************************************************************************** TMS320C2000 Linker PC v6.1.0 ****************************************************************************** >> Linked Wed Nov 21 11:30:40 2012 OUTPUT FILE NAME: ENTRY POINT SYMBOL: "_c_int00" address: 003f65bd MEMORY CONFIGURATION name origin length used unused attr fill ---------------------- -------- --------- -------- -------- ---- -------- PAGE 0: PRAML0 00008000 00000800 000003ca 00000436 RWIX OTP 003d7800 00000400 00000000 00000400 RWIX FLASHD 003f0000 00002000 00000000 00002000 RWIX FLASHC 003f2000 00002000 00000000 00002000 RWIX FLASHA 003f6000 00001f80 000007b9 000017c7 RWIX CSM_RSVD 003f7f80 00000076 00000000 00000076 RWIX BEGIN 003f7ff6 00000002 00000002 00000000 RWIX CSM_PWL_P0 003f7ff8 00000008 00000000 00000008 RWIX IQTABLES 003fe000 00000b50 00000000 00000b50 RWIX IQTABLES2 003feb50 0000008c 00000000 0000008c RWIX IQTABLES3 003febdc 000000aa 00000000 000000aa RWIX ROM 003ff27c 00000d44 00000000 00000d44 RWIX RESET 003fffc0 00000002 00000000 00000002 RWIX VECTORS 003fffc2 0000003e 00000000 0000003e RWIX PAGE 1: BOOT_RSVD 00000000 00000050 00000000 00000050 RWIX RAMM0 00000050 000003b0 00000300 000000b0 RWIX RAMM1 00000400 00000400 00000000 00000400 RWIX DEV_EMU 00000880 00000105 00000004 00000101 RWIX SYS_PWR_CTL 00000985 00000003 00000003 00000000 RWIX FLASH_REGS 00000a80 00000060 00000008 00000058 RWIX CSM 00000ae0 00000010 00000010 00000000 RWIX ADC_RESULT 00000b00 00000020 00000020 00000000 RWIX CPU_TIMER0 00000c00 00000008 00000008 00000000 RWIX CPU_TIMER1 00000c08 00000008 00000008 00000000 RWIX CPU_TIMER2 00000c10 00000008 00000008 00000000 RWIX PIE_CTRL 00000ce0 00000020 0000001a 00000006 RWIX PIE_VECT 00000d00 00000100 00000100 00000000 RWIX COMP1 00006400 00000020 00000011 0000000f RWIX COMP2 00006420 00000020 00000011 0000000f RWIX EPWM1 00006800 00000040 00000040 00000000 RWIX EPWM2 00006840 00000040 00000040 00000000 RWIX EPWM3 00006880 00000040 00000040 00000000 RWIX EPWM4 000068c0 00000040 00000040 00000000 RWIX ECAP1 00006a00 00000020 00000020 00000000 RWIX GPIOCTRL 00006f80 00000040 00000040 00000000 RWIX GPIODAT 00006fc0 00000020 00000020 00000000 RWIX GPIOINT 00006fe0 00000020 0000000a 00000016 RWIX SYSTEM 00007010 00000020 0000001f 00000001 RWIX SPIA 00007040 00000010 00000010 00000000 RWIX SCIA 00007050 00000010 00000010 00000000 RWIX NMIINTRUPT 00007060 00000010 00000010 00000000 RWIX XINTRUPT 00007070 00000010 00000010 00000000 RWIX ADC 00007100 00000080 00000051 0000002f RWIX I2CA 00007900 00000040 00000022 0000001e RWIX DRAML0 00008800 00000800 00000038 000007c8 RWIX PARTID 003d7fff 00000001 00000001 00000000 RWIX FLASHB 003f4000 00002000 00000000 00002000 RWIX CSM_PWL 003f7ff8 00000008 00000008 00000000 RWIX SECTION ALLOCATION MAP output attributes/ section page origin length input sections -------- ---- ---------- ---------- ---------------- .pinit 0 003f6000 00000000 UNINITIALIZED ramfuncs 0 003f6000 000003ca RUN ADDR = 00008000 003f6000 00000233 main.obj (ramfuncs:retain) 003f6233 00000193 main.obj (ramfuncs) 003f63c6 00000004 F2802x_CodeStartBranch.obj (ramfuncs) .text 0 003f63ca 000002a2 003f63ca 000001f3 main.obj (.text) 003f65bd 00000044 rts2800_ml.lib : boot.obj (.text) 003f6601 00000028 main.obj (.text:retain) 003f6629 00000019 rts2800_ml.lib : args_main.obj (.text) 003f6642 00000019 : exit.obj (.text) 003f665b 00000009 : _lock.obj (.text) 003f6664 00000008 F2802x_CodeStartBranch.obj (.text) .econst 0 003f666c 0000010a 003f666c 00000102 main.obj (.econst) 003f676e 00000008 main.obj (.econst:_AngleTable) .cinit 0 003f6776 00000043 003f6776 0000002d main.obj (.cinit) 003f67a3 0000000a rts2800_ml.lib : _lock.obj (.cinit) 003f67ad 0000000a : exit.obj (.cinit) 003f67b7 00000002 --HOLE-- [fill = 0] codestart * 0 003f7ff6 00000002 003f7ff6 00000002 F2802x_CodeStartBranch.obj (codestart) .reset 0 003fffc0 00000002 DSECT 003fffc0 00000002 rts2800_ml.lib : boot.obj (.reset) vectors 0 003fffc2 00000000 DSECT .stack 1 00000050 00000300 UNINITIALIZED 00000050 00000300 --HOLE-- DevEmuRegsFile * 1 00000880 00000004 UNINITIALIZED 00000880 00000004 main.obj (DevEmuRegsFile) SysPwrCtrlRegsFile * 1 00000985 00000003 UNINITIALIZED 00000985 00000003 main.obj (SysPwrCtrlRegsFile) FlashRegsFile * 1 00000a80 00000008 UNINITIALIZED 00000a80 00000008 main.obj (FlashRegsFile) CsmRegsFile * 1 00000ae0 00000010 UNINITIALIZED 00000ae0 00000010 main.obj (CsmRegsFile) AdcResultFile * 1 00000b00 00000020 UNINITIALIZED 00000b00 00000020 main.obj (AdcResultFile) CpuTimer0RegsFile * 1 00000c00 00000008 UNINITIALIZED 00000c00 00000008 main.obj (CpuTimer0RegsFile) CpuTimer1RegsFile * 1 00000c08 00000008 UNINITIALIZED 00000c08 00000008 main.obj (CpuTimer1RegsFile) CpuTimer2RegsFile * 1 00000c10 00000008 UNINITIALIZED 00000c10 00000008 main.obj (CpuTimer2RegsFile) PieCtrlRegsFile * 1 00000ce0 0000001a UNINITIALIZED 00000ce0 0000001a main.obj (PieCtrlRegsFile) PieVectTableFile * 1 00000d00 00000100 UNINITIALIZED 00000d00 00000100 main.obj (PieVectTableFile) EmuKeyVar * 1 00000d00 00000001 UNINITIALIZED 00000d00 00000001 main.obj (EmuKeyVar) EmuBModeVar * 1 00000d01 00000001 UNINITIALIZED 00000d01 00000001 main.obj (EmuBModeVar) FlashCallbackVar * 1 00000d02 00000002 UNINITIALIZED 00000d02 00000002 main.obj (FlashCallbackVar) FlashScalingVar * 1 00000d04 00000002 UNINITIALIZED 00000d04 00000002 main.obj (FlashScalingVar) Comp1RegsFile * 1 00006400 00000011 UNINITIALIZED 00006400 00000011 main.obj (Comp1RegsFile) Comp2RegsFile * 1 00006420 00000011 UNINITIALIZED 00006420 00000011 main.obj (Comp2RegsFile) EPwm1RegsFile * 1 00006800 00000040 UNINITIALIZED 00006800 00000040 main.obj (EPwm1RegsFile) EPwm2RegsFile * 1 00006840 00000040 UNINITIALIZED 00006840 00000040 main.obj (EPwm2RegsFile) EPwm3RegsFile * 1 00006880 00000040 UNINITIALIZED 00006880 00000040 main.obj (EPwm3RegsFile) EPwm4RegsFile * 1 000068c0 00000040 UNINITIALIZED 000068c0 00000040 main.obj (EPwm4RegsFile) ECap1RegsFile * 1 00006a00 00000020 UNINITIALIZED 00006a00 00000020 main.obj (ECap1RegsFile) GpioCtrlRegsFile * 1 00006f80 00000040 UNINITIALIZED 00006f80 00000040 main.obj (GpioCtrlRegsFile) GpioDataRegsFile * 1 00006fc0 00000020 UNINITIALIZED 00006fc0 00000020 main.obj (GpioDataRegsFile) GpioIntRegsFile * 1 00006fe0 0000000a UNINITIALIZED 00006fe0 0000000a main.obj (GpioIntRegsFile) SysCtrlRegsFile * 1 00007010 0000001f UNINITIALIZED 00007010 0000001f main.obj (SysCtrlRegsFile) SpiaRegsFile * 1 00007040 00000010 UNINITIALIZED 00007040 00000010 main.obj (SpiaRegsFile) SciaRegsFile * 1 00007050 00000010 UNINITIALIZED 00007050 00000010 main.obj (SciaRegsFile) NmiIntruptRegsFile * 1 00007060 00000010 UNINITIALIZED 00007060 00000010 main.obj (NmiIntruptRegsFile) XIntruptRegsFile * 1 00007070 00000010 UNINITIALIZED 00007070 00000010 main.obj (XIntruptRegsFile) AdcRegsFile * 1 00007100 00000051 UNINITIALIZED 00007100 00000051 main.obj (AdcRegsFile) I2caRegsFile * 1 00007900 00000022 UNINITIALIZED 00007900 00000022 main.obj (I2caRegsFile) .ebss 1 00008800 00000038 UNINITIALIZED 00008800 00000030 main.obj (.ebss) 00008830 00000004 rts2800_ml.lib : _lock.obj (.ebss) 00008834 00000004 : exit.obj (.ebss) PartIdRegsFile * 1 003d7fff 00000001 UNINITIALIZED 003d7fff 00000001 main.obj (PartIdRegsFile) CsmPwlFile * 1 003f7ff8 00000008 UNINITIALIZED 003f7ff8 00000008 main.obj (CsmPwlFile) GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name address name -------- ---- 003f63ca .text 003f6642 C$$EXIT 003f6606 _ADC_ISR 00007100 _AdcRegs 00000b00 _AdcResult 003f666c _AdvenceAngle 00008802 _Angle1 00008804 _Angle2 003f676e _AngleTable 00006400 _Comp1Regs 00006420 _Comp2Regs 00000c00 _CpuTimer0Regs 00000c08 _CpuTimer1Regs 00000c10 _CpuTimer2Regs 003f7ff8 _CsmPwl 00000ae0 _CsmRegs 000083c6 _DSP28x_usDelay 00000880 _DevEmuRegs 00006a00 _ECap1Regs 00006800 _EPwm1Regs 00006840 _EPwm2Regs 00006880 _EPwm3Regs 000068c0 _EPwm4Regs 003f6614 _ERR_ISR 00000d01 _EmuBMode 00000d00 _EmuKey 000081fb _Epwm1_ISR 00000a80 _FlashRegs 00000d04 _Flash_CPUScaleFactor 00000d02 _Flash_CallbackPtr 00006f80 _GpioCtrlRegs 00006fc0 _GpioDataRegs 00006fe0 _GpioIntRegs 00008800 _Hall 00007900 _I2caRegs 00008233 _InitFlash 003f656c _Initial 003f63ca _MemCopy 00007060 _NmiIntruptRegs 003d7fff _PartIdRegs 00000ce0 _PieCtrlRegs 00000d00 _PieVectTable 003f666e _PieVectTableInit 003f63ca _RamfuncsLoadEnd 003f6000 _RamfuncsLoadStart 00008000 _RamfuncsRunStart 003f660b _SCI_ISR 00007050 _SciaRegs 003f64ba _SetupADC 003f63df _SetupCPU 003f650b _SetupEPWMs 003f655c _SetupSCI 003f64f0 _SetupTimers 00008806 _Speed 00007040 _SpiaRegs 00007010 _SysCtrlRegs 00000985 _SysPwrCtrlRegs 0000880a _Timer0 00008000 _Timer0_ISR 00008808 _Timer1 003f6619 _Timer1_ISR 00007070 _XIntruptRegs 000080f9 _Xint1_ISR 0000814f _Xint2_ISR 000081a5 _Xint3_ISR 00008803 _XintTime 00000350 __STACK_END 00000300 __STACK_SIZE 00000001 __TI_args_main ffffffff ___binit__ ffffffff ___c_args__ 003f6776 ___cinit__ 003f666c ___etext__ ffffffff ___pinit__ 003f63ca ___text__ 003f6629 __args_main 00008834 __cleanup_ptr 00008836 __dtors_ptr 00008832 __lock 003f6663 __nop 003f665f __register_lock 003f665b __register_unlock 00000050 __stack 00008830 __unlock 003f6642 _abort 0000880c _angles 003f65bd _c_int00 00008252 _commutation 00008801 _dir 003f6644 _exit 003f6577 _main 0000880e _output 003f6601 _rsvd_ISR 00008810 _v ffffffff binit 003f6776 cinit 003f7ff6 code_start 003f666c etext ffffffff pinit GLOBAL SYMBOLS: SORTED BY Symbol Address address name -------- ---- 00000001 __TI_args_main 00000050 __stack 00000300 __STACK_SIZE 00000350 __STACK_END 00000880 _DevEmuRegs 00000985 _SysPwrCtrlRegs 00000a80 _FlashRegs 00000ae0 _CsmRegs 00000b00 _AdcResult 00000c00 _CpuTimer0Regs 00000c08 _CpuTimer1Regs 00000c10 _CpuTimer2Regs 00000ce0 _PieCtrlRegs 00000d00 _EmuKey 00000d00 _PieVectTable 00000d01 _EmuBMode 00000d02 _Flash_CallbackPtr 00000d04 _Flash_CPUScaleFactor 00006400 _Comp1Regs 00006420 _Comp2Regs 00006800 _EPwm1Regs 00006840 _EPwm2Regs 00006880 _EPwm3Regs 000068c0 _EPwm4Regs 00006a00 _ECap1Regs 00006f80 _GpioCtrlRegs 00006fc0 _GpioDataRegs 00006fe0 _GpioIntRegs 00007010 _SysCtrlRegs 00007040 _SpiaRegs 00007050 _SciaRegs 00007060 _NmiIntruptRegs 00007070 _XIntruptRegs 00007100 _AdcRegs 00007900 _I2caRegs 00008000 _RamfuncsRunStart 00008000 _Timer0_ISR 000080f9 _Xint1_ISR 0000814f _Xint2_ISR 000081a5 _Xint3_ISR 000081fb _Epwm1_ISR 00008233 _InitFlash 00008252 _commutation 000083c6 _DSP28x_usDelay 00008800 _Hall 00008801 _dir 00008802 _Angle1 00008803 _XintTime 00008804 _Angle2 00008806 _Speed 00008808 _Timer1 0000880a _Timer0 0000880c _angles 0000880e _output 00008810 _v 00008830 __unlock 00008832 __lock 00008834 __cleanup_ptr 00008836 __dtors_ptr 003d7fff _PartIdRegs 003f6000 _RamfuncsLoadStart 003f63ca .text 003f63ca _MemCopy 003f63ca _RamfuncsLoadEnd 003f63ca ___text__ 003f63df _SetupCPU 003f64ba _SetupADC 003f64f0 _SetupTimers 003f650b _SetupEPWMs 003f655c _SetupSCI 003f656c _Initial 003f6577 _main 003f65bd _c_int00 003f6601 _rsvd_ISR 003f6606 _ADC_ISR 003f660b _SCI_ISR 003f6614 _ERR_ISR 003f6619 _Timer1_ISR 003f6629 __args_main 003f6642 C$$EXIT 003f6642 _abort 003f6644 _exit 003f665b __register_unlock 003f665f __register_lock 003f6663 __nop 003f666c _AdvenceAngle 003f666c ___etext__ 003f666c etext 003f666e _PieVectTableInit 003f676e _AngleTable 003f6776 ___cinit__ 003f6776 cinit 003f7ff6 code_start 003f7ff8 _CsmPwl ffffffff ___binit__ ffffffff ___c_args__ ffffffff ___pinit__ ffffffff binit ffffffff pinit [99 symbols] |
|
相关推荐
3个回答
|
|
1. 程序运行错误现象是什么?能否确定在哪里错误?
2. 有没试过量测当时GPIO34/37引脚电平是否确定为高? 3. 复位和电源等是否正常? 4. 排除硬件问题,可以烧写一个TI Flash的例程看看是否正常。 5. 如果是软件问题,不知道main()的for循环之前的所有初始化内容和顺序是否有改变?初始化Flash的代码放在什么位置? If a post answers your question, please mark it with the "verify answer" button. |
|
|
|
|
|
|
|
如果问题还是没有解决
请楼主查一下Delayus()这个函数是否copy到RAM中进行运行。 如果正常,只能在Flash中单步调试,可能是跳转到illegal ISR中了,具体在哪里跳转的,需要单步Debug 如果您认为此问题已被解答,请在“这是否解答您的问题” 后,点击“是”按钮! 谢谢您的合作! |
|
|
|
只有小组成员才能发言,加入小组>>
351 浏览 1 评论
545 浏览 2 评论
NA555DR VCC最低电压需要在5V供电,为什么用3.3V供电搭了个单稳态触发器也使用正常?
790 浏览 3 评论
MSP430F249TPMR出现高温存储后失效了的情况,怎么解决?
660 浏览 1 评论
对于多级放大电路板,在PCB布局中,电源摆放的位置应该注意什么?
1140 浏览 1 评论
AT32F407在USART2 DMA发送数据时,接包接到了要发送的数据,程序还是处于等待传输完成的标识判断中,为什么?
83浏览 29评论
292浏览 23评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
261浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
210浏览 14评论
两个TMP117传感器一个可以正常读取温度值,一个读取的值一直是0,为什么?
68浏览 13评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-28 01:54 , Processed in 0.734952 second(s), Total 79, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号