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.

TMS320F28377D: difference access speed between CPU1 & CPU2 flash

Part Number: TMS320F28377D
Other Parts Discussed in Thread: CONTROLSUITE

Hi,

Trying C:\ti\controlSUITE\device_support\F2837xD\v210\F2837xD_examples_Dual\ipc_gpio_toggle example,
when I use attach files (ipc_gpio_toggle_cpu01_bsp001.c & ipc_gpio_toggle_cpu02_bsp001.c) and run in RAM,
both toggle signals of CPU1 & CPU2 are synchronizing.
But CPU2 toggle signal was faster than CPU1 when run in flash.

Any explanation for the difference access speed between CPU1 & CPU2 flash?
thanks,

best regards,
Simen
-----------------------------------------------------------------------

CPU2 toggle timing in flash

CPU1 toggle timing in flash

ipc_gpio_toggle_cpu01_bsp001.c
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
//###########################################################################
//
// FILE: ipc_gpio_toggle_cpu01.c
//
// TITLE: GPIO Toggle for F2837xD CPU1.
//
//! \addtogroup dual_example_list
//! <h1> IPC GPIO toggle </h1>
//!
//! This example shows GPIO input on the local CPU triggering an output on the
//! remote CPU. A GPIO input change on CPU01 causes an output change on CPU02
//! and vice versa. \n
//! CPU1 has control of GPIO31 , GPIO15 and GPIO14.\n
//! CPU2 has control of GPIO34 , GPIO12 and GPIO11.
//!
//! \b Hardware \b Connections
//! - connect GPIO15 to GPIO11
//! - connect GPIO14 to GPIO12
//!
//! \b Watch \b Pins
//! - GPIO31 - output on CPU2 (LED blinking if using control card)
//! - GPIO11 - input on CPU2
//! - GPIO34 - output on CPU1 (LED blinking if using control card)
//! - GPIO14 - input on CPU1
//! - GPIO12 - square wave output on CPU02
//! - GPIO15 - square wave output on CPU01
//
//###########################################################################
// $TI Release: F2837xD Support Library v210 $
// $Release Date: Tue Nov 1 14:46:15 CDT 2016 $
// $Copyright: Copyright (C) 2013-2016 Texas Instruments Incorporated -
// http://www.ti.com/ ALL RIGHTS RESERVED $
//###########################################################################
//
// Included Files
//
#include "F28x_Project.h"
#include "F2837xD_Ipc_drivers.h"
//
// Main
//
Uint32 Cnt=0;
void main(void)
{
//
// Declare all local variables
//
uint16_t state;
uint32_t count;
//
// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the F2837xD_SysCtrl.c file.
//
InitSysCtrl();
#ifdef _STANDALONE
#ifdef _FLASH
//
// Send boot command to allow the CPU2 application to begin execution
//
IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

ipc_gpio_toggle_cpu02_bsp001.c
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
//###########################################################################
//
// FILE: ipc_gpio_toggle_cpu02.c
//
// TITLE: IPC GPIO Toggle for F2837xD CPU2.
//
// This example tests the IPC of the F2837xD.
// CPU1 have controls of one input on GPIO15 and one output on GPIO11.
// CPU2 have controls of one input on GPIO14 and one output on GPIO12.
// Toggling the input on CPU1 will also toggle the output on CPU2 through IPC.
// Toggling the input on CPU2 will also toggle the output on CPU1 through IPC.
//
// \b Watch Variables \b
// - GPIO31 - output on CPU2
// - GPIO11 - input on CPU2
// - GPIO34 - output on CPU1
// - GPIO14 - input on CPU1
// - GPIO12 - square wave output on CPU02
// - GPIO15 - square wave output on CPU01
// Connect the outputs to an oscilloscope
//
//###########################################################################
// $TI Release: F2837xD Support Library v210 $
// $Release Date: Tue Nov 1 14:46:15 CDT 2016 $
// $Copyright: Copyright (C) 2013-2016 Texas Instruments Incorporated -
// http://www.ti.com/ ALL RIGHTS RESERVED $
//###########################################################################
//
// Included Files
//
#include "F28x_Project.h"
#include "F2837xD_Ipc_drivers.h"
//
// Main
//
Uint32 Cnt=0;
void main(void)
{
//
// Declare all variables
//
uint32_t count;
uint16_t state;
//
// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the F2837xD_SysCtrl.c file.
//
InitSysCtrl();
//
// Step 2. Initialize GPIO:
//
// InitGpio(); // Skipped for this example
//
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
//
DINT;
//
// Initialize PIE control registers to their default state.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Simen,

    Assuming that you use same waitstates on both CPUs and that there are no interrupts, the difference can be because of the code alignment in the memory - which can cause more or less fetches.

    Try putting your toggle code in a separate function and map it to the same address on both cores.

    Thanks and regards,
    Vamsi
  • Hi Vamsi,

    Your answer is right.
    They can synchronize when I map "loop function " to the same address on both cores.
    thanks,


    best regards,
    Simen
  • Simen,

    Glad that it worked. Flash fetches are 128-bit wide and the location of the code in this 128-bit aligned memory will cause differences in number of fetches when prefetch is enabled. When you map them to the same address, fetches will be similar. For better performance, always map your functions (if possible) at the start of a 128-bit aligned memory.

    I am closing this thread.

    Thanks and regards,
    Vamsi