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.

F28M35H52C: Executing Flash Control function calls from RAM does not program data in to FLASH sectors on C28

Part Number: F28M35H52C
Other Parts Discussed in Thread: CONTROLSUITE

Hi guys,

I need some support for following issue's seen while developing a custom bootloader application on concerto C28 core. 

NOTABLE MENTIONS:

- C28 bootloader application uses F021_API_C28x_FPU32.lib for erasing and programming the FLASH sectors of C28 core. 

- Now I make sure the above library is executed off of RAM.

GROUP
{
.TI.ramfunc
{ -l F021_API_C28x_FPU32.lib}

} LOAD = FLASHA,
RUN = RAML0,
LOAD_START(_RamfuncsLoadStart),
LOAD_SIZE(_RamfuncsLoadSize),
RUN_START(_RamfuncsRunStart),
PAGE = 0

- Some of the other functions i run off of RAM are : 

#pragma CODE_SECTION(InitFlash, ".TI.ramfunc");
#pragma CODE_SECTION(SetupFlash, ".TI.ramfunc");
#pragma CODE_SECTION(FlashGainPump,".TI.ramfunc");
#pragma CODE_SECTION(FlashLeavePump,".TI.ramfunc");

- Apart from above function i execute some self written function's off of RAM and these are : (I have attached the source code as reference for anybody to see what these functions do ! )

FlashControlInterface.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:
// Description:
//
//
//
//
//
//###########################################################################
//
// Author:
//
//###########################################################################
//###########################################################################
//
// Device Related Header files
//
//###########################################################################
#include "../include/Flash Control Interface/FlashControlInterface.h"
// Functions that will be run from RAM need to be assigned to
// a different section. This section will then be mapped to a load and
// run address using the linker cmd file.
#ifdef __TI_COMPILER_VERSION__
#if __TI_COMPILER_VERSION__ >= 15009000
#pragma CODE_SECTION(eraseFlashSectors, ".TI.ramfunc");
#pragma CODE_SECTION(programFlashSectors, ".TI.ramfunc");
#else
#pragma CODE_SECTION(eraseFlashSectors, "ramfuncs");
#pragma CODE_SECTION(programFlashSectors, "ramfuncs");
#endif
#endif
//###########################################################################
// Function Defination
//###########################################################################
//###########################################################################
//
// Error
//
//###########################################################################
void Error(Fapi_StatusType status)
{
for(;;);
}
//###########################################################################
//
// eraseFlashSectors
//
//###########################################################################
void eraseFlashSectors (void)
{
FlashGainPump();
Fapi_StatusType oReturnCheck;
volatile Fapi_LibraryInfoType oLibInfo;
volatile Fapi_FlashStatusType oFlashStatus;
Fapi_FlashBankSectorsType oFlashBankSectors;
Fapi_FlashStatusWordType oFlashStatusWord;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#pragma CODE_SECTION(eraseFlashSectors, ".TI.ramfunc"); 
#pragma CODE_SECTION(programFlashSectors, ".TI.ramfunc");

Problem I am facing: 

Now in my software i perform erase of sectors before i program any sectors. Later when i try to program flash sectors at certain calculated addresses with out applying a breakpoint on  "Fapi_issueProgrammingCommand" , to my surprise the api returns a "Fapi_Status_Success" but in reality no data will be programmed in the FLASH when i look in the Memory Browser view on CCS ! 

But when i apply a break point at "Fapi_issueProgrammingCommand" and step over the data contents will be programmed. I do not understand whats going on here ? Should i provide some delay here ? 

I used FLASH Porgamming example provided in control suite. 

Thanks