This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Illegal Instruction on F28035

Other Parts Discussed in Thread: TMS320F28035

Hi All,

      My target chip is the TMS320F28035 and used emulator is the SD XDS510,i want to make a bldc controller, i use the iir filter for EMF , filter function is in the AD interrupt function, the problem is that when i allow ad interrupt, dsp will enter ILLEGAL_ISR () interrupt function, and when I not enable AD interrupt, the program can run normally ,may be due to the lack of space in ram or other Reason,  If the ram is not enough, which section  is not enough? and When the code is downloaded to the FLASH to save ram, can i use the emulator to debug?   Please help.

the CMD file:

MEMORY
{
PAGE 0 : 
 BEGIN     : origin = 0x000000, length = 0x000002
 BOOT_RSVD    : origin = 0x000002, length = 0x00004E            
 RAMM0     : origin = 0x000050, length = 0x0003B0

progRAM     : origin = 0x008000, length = 0x001600 IQTABLES       : origin = 0x3FE000, length = 0x000B50    /* IQ Math Tables in Boot ROM */
 IQTABLES2      : origin = 0x3FEB50, length = 0x00008C    /* IQ Math Tables in Boot ROM */
 IQTABLES3      : origin = 0x3FEBDC, length = 0x0000AA  /* IQ Math Tables in Boot ROM */

 RESET          : origin = 0x3FFFC0, length = 0x000002
 BOOTROM        : origin = 0x3FF27C, length = 0x000D44              

        
PAGE 1 :

 RAMM1     : origin = 0x000480, length = 0x000380

 dataRAM      : origin = 0x009600, length = 0x000A00

 CLA_CPU_MSGRAM : origin = 0x001480, length = 0x000080
 CPU_CLA_MSGRAM : origin = 0x001500, length = 0x000080
}
 
 
SECTIONS
{
   codestart        : > BEGIN,      PAGE = 0
   ramfuncs         : > RAMM0,      PAGE = 0 

   .text            : > progRAM,    PAGE = 0

   .cinit           : > RAMM0,      PAGE = 0
   .pinit           : > RAMM0,      PAGE = 0
   .switch          : > RAMM0,      PAGE = 0
   .reset           : > RESET,      PAGE = 0, TYPE = DSECT
  
   .stack           : > RAMM1,      PAGE = 1

   .ebss            : > dataRAM,    PAGE = 1
   .econst          : > dataRAM,    PAGE = 1     

   .esysmem         : > RAMM1,      PAGE = 1

   IQmath           : > progRAM,    PAGE = 0
   IQmathTables     : > IQTABLES,  PAGE = 0, TYPE = NOLOAD
   iirfilt   : > dataRAM  PAGE = 1

   Cla1ToCpuMsgRAM  : > CLA_CPU_MSGRAM, PAGE = 1
   CpuToCla1MsgRAM  : > CPU_CLA_MSGRAM, PAGE = 1
The map file:

MEMORY CONFIGURATION

                  name            origin    length      used    attr    fill
         ----------------------  --------  ---------  --------  ----  --------
PAGE  0: BEGIN                   00000000   00000002  00000000  RWIX
         BOOT_RSVD               00000002   0000004e  00000000  RWIX
         RAMM0                   00000050   000003b0  0000023e  RWIX
         progRAM                 00008000   00001600  000013d9  RWIX
         IQTABLES                003fe000   00000b50  00000b50  RWIX
         IQTABLES2               003feb50   0000008c  00000000  RWIX
         IQTABLES3               003febdc   000000aa  00000000  RWIX
         BOOTROM                 003ff27c   00000d44  00000000  RWIX
         RESET                   003fffc0   00000002  00000000  RWIX

PAGE  1: RAMM1                   00000480   00000380  00000050  RWIX
         DEV_EMU                 00000880   00000105  00000004  RWIX
         SYS_PWR_CTL             00000985   00000003  00000000  RWIX
         FLASH_REGS              00000a80   00000060  00000008  RWIX
         CSM                     00000ae0   00000010  00000010  RWIX
         ADC_RESULT              00000b00   00000020  00000020  RWIX
         CPU_TIMER0              00000c00   00000008  00000008  RWIX
         CPU_TIMER1              00000c08   00000008  00000008  RWIX
         CPU_TIMER2              00000c10   00000008  00000008  RWIX
         PIE_CTRL                00000ce0   00000020  0000001a  RWIX
         PIE_VECT                00000d00   00000100  00000100  RWIX
         CLA1                    00001400   00000080  00000040  RWIX
         CLA_CPU_MSGRAM          00001480   00000080  00000000  RWIX
         CPU_CLA_MSGRAM          00001500   00000080  00000000  RWIX
         ECANA                   00006000   00000040  00000034  RWIX
         ECANA_LAM               00006040   00000040  00000040  RWIX
         ECANA_MOTS              00006080   00000040  00000040  RWIX
         ECANA_MOTO              000060c0   00000040  00000040  RWIX
         ECANA_MBOX              00006100   00000100  00000100  RWIX
         COMP1                   00006400   00000020  00000011  RWIX
         COMP2                   00006420   00000020  00000011  RWIX
         COMP3                   00006440   00000020  00000011  RWIX
         EPWM1                   00006800   00000040  0000003a  RWIX
         EPWM2                   00006840   00000040  0000003a  RWIX
         EPWM3                   00006880   00000040  0000003a  RWIX
         EPWM4                   000068c0   00000040  0000003a  RWIX
         EPWM5                   00006900   00000040  0000003a  RWIX
         EPWM6                   00006940   00000040  0000003a  RWIX
         EPWM7                   00006980   00000040  0000003a  RWIX
         ECAP1                   00006a00   00000020  00000020  RWIX
         EQEP1                   00006b00   00000040  00000040  RWIX
         LINA                    00006c00   00000080  0000004a  RWIX
         GPIOCTRL                00006f80   00000040  00000040  RWIX
         GPIODAT                 00006fc0   00000020  00000020  RWIX
         GPIOINT                 00006fe0   00000020  0000000c  RWIX
         SYSTEM                  00007010   00000020  00000020  RWIX
         SPIA                    00007040   00000010  00000010  RWIX
         SCIA                    00007050   00000010  00000010  RWIX
         NMIINTRUPT              00007060   00000010  00000010  RWIX
         XINTRUPT                00007070   00000010  00000010  RWIX
         ADC                     00007100   00000080  00000050  RWIX
         SPIB                    00007740   00000010  00000010  RWIX
         I2CA                    00007900   00000040  00000022  RWIX
         dataRAM                 00009600   00000a00  000008f2  RWIX
         PARTID                  003d7e80   00000001  00000001  RWIX
         CSM_PWL                 003f7ff8   00000008  00000008  RWIX


SECTION ALLOCATION MAP

 output                                  attributes/
section   page    origin      length       input sections
--------  ----  ----------  ----------   ----------------
codestart
*          0    00000000    00000000     UNINITIALIZED

.pinit     0    00000050    00000000     UNINITIALIZED

.switch    0    00000050    00000000     UNINITIALIZED

.cinit     0    00000050    0000021d    
                  00000050    0000000e     rts2800_ml.lib : exit.obj (.cinit)
                  0000005e    0000000a                    : _lock.obj (.cinit)
                  00000068    00000204     DSP2803x_CpuTimers.obj (.cinit)
                  0000026c    00000001     --HOLE-- [fill = 0]

ramfuncs   0    0000026d    00000021    
                  0000026d    0000001d     DSP2803x_CpuTimers.obj (ramfuncs)
                  0000028a    00000004     DSP2803x_usDelay.obj (ramfuncs)

.text      0    00008000    00001392    
                  00008000    00000044     rts2800_ml.lib : boot.obj (.text)
                  00008044    0000004a                    : exit.obj (.text)
                  0000808e    00000009                    : _lock.obj (.text)
                  00008097    00000014                    : args_main.obj (.text)
                  000080ab    0000004b     DLOG4CHC.obj (.text)
                  000080f6    000011db     DSP2803x_CpuTimers.obj (.text)
                  000092d1    00000033     iir16.obj (.text)
                  00009304    0000005a     rts2800_ml.lib : fs_mpy.obj (.text)
                  0000935e    00000029                    : fs_tol.obj (.text)
                  00009387    0000000b                    : u_div.obj (.text)

IQmath     0    00009392    00000047    
                  00009392    00000047     IQmath.lib : IQ24div.obj (IQmath)

 

Thanks & best regards

kou

 

  • Hallo Kou,

    You are using RamFunctions. Be aware to execute MemCopy() before calling these functions, also at the first line in Main().

     

    Best regards, Leo Bosch