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.

TMDSDOCK28335: ILLEGAL_ISR on TMS320F28335 Flash Programming

Part Number: TMDSDOCK28335
Other Parts Discussed in Thread: TMS320F28335, C2000WARE

Hi all,
I'm having trouble with Flash programming on TMS320F28335.

Now I'm using a C2000 TMS320F28335, and I want to copy the program from Flash to RAM so that the DSP can work stand alone.
However, the DSP does not work when I press the Debug button in Code Composer Studio (CCS) and write the program to the DSP : PWM waveforms cannot be observed when I run the program.
The CCS debug window shows "ILLEGAL_ISR() at DSP2833x_DefaultIsr.c:154 0x338044", but I can't figure out where the problem is.

I attached some picture and the CCS projects that we are currently considering because it is difficult to explain the situation in writing. Please find it.

```
Projects.zip
    - DAB_40V_Ver7 : Write to RAM。It works fine.
    - DAB_40V_Ver8 : Modify above project to write flash. It cannot work.
Environment1, 2.PNG : Specific environments on CCS
Pin_settings.jpg : A pin settings on control CARD of F28335
Result.PNG : Debug window on CCS
Waveform on GPIO 00 by DAB_40V_ver7.jpg
```
And I used CCS(9.3.0.00012).


I want any advice to fix this issue.


Best Regards,
Eto

Projects.zip

  • This usually occurs when the sections of code that you have declared should run from RAM is called before the memcopy function is ran to copy them over from flash to RAM. Please take a look at this example in C2000Ware, for the correct order of operations for any code you want to run from RAM on a flash loaded project.

    C:\ti\c2000\C2000Ware_4_00_00_00\device_support\f2833x\examples\flash_f28335

    Let me know if this gets us on the right track.

    Another option might be to try not copying over anything to RAM, just executing from flash(even though it is slower than RAM) just to see if we can get that working.  This would take the whole memcopy process out of the picture and would show that the flash placement and programming is OK.

    Best,

    Matthew

  • I was able to get the program to work. The source code before and after the modification is attached.

    Thanks!

    ---

    before:

    main-before.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    // DAB-40V-ver6
    // 2021/2/5 Yasushi Eto
    //
    //###########################################################################
    // $TI Release: F2833x/F2823x Header Files and Peripheral Examples V142 $
    // $Release Date: November 1, 2016 $
    // $Copyright: Copyright (C) 2007-2016 Texas Instruments Incorporated -
    // http://www.ti.com/ ALL RIGHTS RESERVED $
    //###########################################################################
    #include "DSP28x_Project.h" // Device Headerfile and Examples Include File
    #include <string.h>
    // Prototype statements for functions found within this file.
    void EPwm1Config(void);
    void EPwm2Config(void);
    void EPwm3Config(void);
    void EPwm4Config(void);
    void AdcConfig(void);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    after:

    main-after.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    // DAB-40V-ver6
    // 2021/2/5 Yasushi Eto
    //
    //###########################################################################
    // $TI Release: F2833x/F2823x Header Files and Peripheral Examples V142 $
    // $Release Date: November 1, 2016 $
    // $Copyright: Copyright (C) 2007-2016 Texas Instruments Incorporated -
    // http://www.ti.com/ ALL RIGHTS RESERVED $
    //###########################################################################
    #include "DSP28x_Project.h" // Device Headerfile and Examples Include File
    #include <string.h>
    // Functions that will be run from RAM need to be assigned to
    // a different section. This section will then be mapped using
    // the linker cmd file.
    #pragma CODE_SECTION(epwm1_isr, "ramfuncs");
    // Prototype statements for functions found within this file.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX