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.

TMS320F280049C: No EPWM output if change CMD file from RAM to Flash

Part Number: TMS320F280049C

Hi Expert,

There's a strange issue, that when change cmd file from RAM to flash, there's no EPWM output wave while with "ram_cmd" file, the EPWM output is normal.

Could you please provide some suggestions about how to debug this issue? Thanks!

Attached falsh_cmd and flash_map file as below.

28004x_cla_ram_link_cmd2.txt
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
MEMORY
{
PAGE 0 :
/* BEGIN is used for the "boot to SARAM" bootloader mode */
BEGIN : origin = 0x080000, length = 0x000002
RAMM0 : origin = 0x0000F3, length = 0x00030D
RAMLS0 : origin = 0x008000, length = 0x000800
RAMLS3 : origin = 0x009800, length = 0x000800
RAMLS4 : origin = 0x00A000, length = 0x000800
RESET : origin = 0x3FFFC0, length = 0x000002
/* Flash sectors */
/* BANK 0 */
FLASH_BANK0_SEC0 : origin = 0x080002, length = 0x000FFE /* on-chip Flash */
FLASH_BANK0_SEC1 : origin = 0x081000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC2 : origin = 0x082000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC3 : origin = 0x083000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC4 : origin = 0x084000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC5 : origin = 0x085000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC6 : origin = 0x086000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC7 : origin = 0x087000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC8 : origin = 0x088000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC9 : origin = 0x089000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC10 : origin = 0x08A000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC11 : origin = 0x08B000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC12 : origin = 0x08C000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC13 : origin = 0x08D000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC14 : origin = 0x08E000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC15 : origin = 0x08F000, length = 0x001000 /* on-chip Flash */
/* BANK 1 */
FLASH_BANK1_SEC0 : origin = 0x090000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC1 : origin = 0x091000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC2 : origin = 0x092000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC3 : origin = 0x093000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC4 : origin = 0x094000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC5 : origin = 0x095000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC6 : origin = 0x096000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC7 : origin = 0x097000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC8 : origin = 0x098000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC9 : origin = 0x099000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC10 : origin = 0x09A000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC11 : origin = 0x09B000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC12 : origin = 0x09C000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC13 : origin = 0x09D000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC14 : origin = 0x09E000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC15 : origin = 0x09F000, length = 0x000FF0 /* on-chip Flash */
// FLASH_BANK1_SEC15_RSVD : origin = 0x09FFF0, length = 0x000010 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
PAGE 1 :
BOOT_RSVD : origin = 0x000002, length = 0x0000F1 /* Part of M0, BOOT rom will use this for stack */
RAMM1 : origin = 0x000400, length = 0x0003F8 /* on-chip RAM block M1 */
// RAMM1_RSVD : origin = 0x0007F8, length = 0x000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
RAMLS1 : origin = 0x008800, length = 0x000800
RAMLS2 : origin = 0x009000, length = 0x000800
RAMLS5 : origin = 0x00A800, length = 0x000800
RAMLS6 : origin = 0x00B000, length = 0x000800
RAMLS7 : origin = 0x00B800, length = 0x000800
RAMGS0 : origin = 0x00C000, length = 0x002000
RAMGS1 : origin = 0x00E000, length = 0x002000
RAMGS2 : origin = 0x010000, length = 0x002000
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0576.QT2_AC_side_map.txt
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
******************************************************************************
TMS320C2000 Linker PC v18.12.4
******************************************************************************
>> Linked Sun Aug 30 23:15:19 2020
OUTPUT FILE NAME: <QT2_AC_side.out>
ENTRY POINT SYMBOL: "code_start" address: 00080000
MEMORY CONFIGURATION
name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
PAGE 0:
RAMM0 000000f3 0000030d 00000000 0000030d RWIX
RAMLS0 00008000 00000800 0000070c 000000f4 RWIX
RAMLS3 00009800 00000800 00000088 00000778 RWIX
RAMLS4 0000a000 00000800 00000130 000006d0 RWIX
BEGIN 00080000 00000002 00000002 00000000 RWIX
FLASH_BANK0_SEC0 00080002 00000ffe 00000000 00000ffe RWIX
FLASH_BANK0_SEC1 00081000 00001000 00000168 00000e98 RWIX
FLASH_BANK0_SEC2 00082000 00001000 00001000 00000000 RWIX
FLASH_BANK0_SEC3 00083000 00001000 00001000 00000000 RWIX
FLASH_BANK0_SEC4 00084000 00001000 00000e56 000001aa RWIX
FLASH_BANK0_SEC5 00085000 00001000 000006a0 00000960 RWIX
FLASH_BANK0_SEC6 00086000 00001000 00000000 00001000 RWIX
FLASH_BANK0_SEC7 00087000 00001000 00000000 00001000 RWIX
FLASH_BANK0_SEC8 00088000 00001000 00000000 00001000 RWIX
FLASH_BANK0_SEC9 00089000 00001000 00000000 00001000 RWIX
FLASH_BANK0_SEC10 0008a000 00001000 00000000 00001000 RWIX
FLASH_BANK0_SEC11 0008b000 00001000 00000000 00001000 RWIX
FLASH_BANK0_SEC12 0008c000 00001000 00000000 00001000 RWIX
FLASH_BANK0_SEC13 0008d000 00001000 00000000 00001000 RWIX
FLASH_BANK0_SEC14 0008e000 00001000 00000000 00001000 RWIX
FLASH_BANK0_SEC15 0008f000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC0 00090000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC1 00091000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC2 00092000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC3 00093000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC4 00094000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC5 00095000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC6 00096000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC7 00097000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC8 00098000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC9 00099000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC10 0009a000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC11 0009b000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC12 0009c000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC13 0009d000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC14 0009e000 00001000 00000000 00001000 RWIX
FLASH_BANK1_SEC15 0009f000 00000ff0 00000000 00000ff0 RWIX
RESET 003fffc0 00000002 00000000 00000002 RWIX
PAGE 1:
BOOT_RSVD 00000002 000000f1 00000000 000000f1 RWIX
RAMM1 00000400 000003f8 000003f8 00000000 RWIX
ADCA_RESULT 00000b00 00000020 00000000 00000020 RWIX
ADCB_RESULT 00000b20 00000020 00000000 00000020 RWIX
ADCC_RESULT 00000b40 00000020 00000000 00000020 RWIX
CPU_TIMER0 00000c00 00000008 00000000 00000008 RWIX
CPU_TIMER1 00000c08 00000008 00000000 00000008 RWIX
CPU_TIMER2 00000c10 00000008 00000000 00000008 RWIX
PIE_CTRL 00000ce0 00000020 00000000 00000020 RWIX
PIE_VECT 00000d00 00000200 00000000 00000200 RWIX
DMA 00001000 00000200 00000000 00000200 RWIX
CLA1 00001400 00000080 00000000 00000080 RWIX
CLA1_MSGRAMLOW 00001480 00000080 00000000 00000080 RWIX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Rayna

  • Rayna,

    Did the application end up in ITRAP?  Or is it executing fine with no EPWM output?

    Is this observed with debugger connected or standalone?  Is it working with debugger connected?  

    Thanks and regards,

    Vamsi

  • Hi Vamsi,

    I did not see it ended up in ITRAP. The application is running standalone without debugger connected.

    With exactly the same project code:

    • if changing  Active Build Configuration to CPU1_RAM, it works fine with PWM waveforms generated as expected
    • if changing  Active Build Configuration to CPU1_FLASH, there is no PWM waveform generated 

    very strange. Any idea what might be the cause and how to diagnose?

  • Xiaoquan,

    1) Did you try to run the flash build configuration with debugger connected?  Did it work like that?

    2) Did you configure the boot mode pins correctly for flash boot?

    3) Please search for "Could you list the procedure involved in modifying an application from RAM based configuration to Flash based configuration in simple steps?" in the flash wiki at https://processors.wiki.ti.com/index.php/C2000_Flash_FAQ#Flash_Linker_cmd_file and see whether your application is handling these steps correctly or not.

    Thanks and regards,

    Vamsi

  • Hi Vamsi,

    This issue is solved by changing --opt_level from off to 3.

    However, We're confused about the reason, why "--opt_level = off", there's no EPWM output, while "--opt_level = 3", the EPWM output is normal?

    Could you please help to explain it? Thanks!

    Rayna

  • Rayna,

    Thank you for the update.  That is why I was asking whether the application worked fine or not in debugger connected mode.  Answering this question would have helped us to understand whether or not it is an issue because of the project changes made to move from RAM build to flash build.  

    Regarding the optimization clearing the issue:  Please note that Flash execution involves additional wait-states (unlike 0-wait RAM).  Hence, the rate at which the interrupts (and hence the remaining code) work may change based on the priority of the interrupts.  Ex: If the high priority interrupts take more time due to additional wait-states, CPU may not get to low priority interrupts and other code quickly.  Optimizing the code can impact this as it can reduce the overall cycles it takes to execute the high priority interrupts.  Hence, it worked in this case.

    Please suggest to map ISRs to RAM (using .TI.ramfunc) and see if that helps.

    Thanks and regards,
    Vamsi

     

  • Hi Vamsi,

    Thanks for your explanation. And it's very helpful.

    However, I have a few confusions as below,

    • What the difference of working or not in debugger connected mode with flash build, and what the usage of this information? For this case, both these two modes could not output EPWM before.
    • By the way, which optimization level could suggest to customer to have better performance?

    Thanks!

    Rayna

  • Rayna,

    If the application works fine in debugger mode and not in standalone mode, it can be for different reasons:

    1) Something is mapped to RAM (this always does not show up looking at linker cmd - Ex: If you have some section that is not mapped at all in linker cmd, you may get a warning during compile that some sections are allocated to available memory since they have not been allocated in the linker cmd to any memory) 

    2) User did not do some configuration correctly.  Ex: Watchdog is not serviced correctly.  Gel file disables the watchdog in debugger case.  In standalone, it will be enabled as it is default.

    etc.

    Hence, it is important for us to rule out these issues and hence we need to know whether application ran successfully or not with debugger.

    Regarding optimization question: Please open a new thread and corresponding experts will help you.

    Thanks and regards,
    Vamsi