SPRUIZ1B July 2023 – August 2024 TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
FILE: memcfg_ex1_ram_management_cpu1.c
This example shows how to assign shared RAM for use by both the CPU2 and CPU1 core. Shared RAM regions are defined in both the CPU2 and CPU1 linker files. In this example GS0 and GS4 are assigned to/owned by CPU2. The remaining shared RAM regions are owned by CPU1.
In this example, a pattern is written to cpu1RWArray and then an IPC flag is sent to notify CPU2 that data is ready to be read. CPU2 then reads the data from cpu2RArray and writes a modified pattern to cpu2RWArray. Once CPU2 acknowledges the IPC flag, CPU1 reads the data from cpu1RArray and compares with expected result.
A timer ISR is also serviced in both CPUs. The ISRs are copied into the shared RAM region owned by the respective CPUs. Each ISR toggles a GPIO. Watch the GPIOs on an oscilloscope, or if using the controlCARD, watch LED1 and LED2 blink at different rates.
Following are the memory allocation details of CPU Timer interrupt ISRs & read(R)/read write(RW) arrays in CPU1 & CPU2 as configured in the example.
NOTE: In the default CPU2 linker cmd file, GS4, FLASH_BANK3 and FLASH_BANK4 are used for allocating various CPU2 sections. The CPU1 application assigns the ownership of these memory regions to CPU2. Please note that CPU2 .out file can be loaded only after CPU1 completes this configuration
The erase setting (CPU1/CPU2 On-Chip Flash -> erase setting) needs to be configured as selected banks only (Choose the corresponding BANKS allocated for CPUs) or necessary sectors only before loading CPU1/CPU2.out file (This is applicable only for FLASH configuration)
Watch Variables