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.
I'm getting an error code returned when I attempt to copy data into flash. An absurd lack of an cohesive documentation prevents me from figuring out what exactly is going wrong.
I am calling memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (Uint32)&RamfuncsLoadSize); before attempting the copy, so it's not because I'm attempting to write to flash while running out of flash.
relevant .cmd file parts:
FLASH_UNUSED : origin = 0x3D8000, length = 0x1BFFF
FLASHA : origin = 0x3F4000, length = 0x3F80
ramfuncs : LOAD = FLASHA,
RUN = RAML0,
LOAD_START(_RamfuncsLoadStart),
LOAD_END(_RamfuncsLoadEnd),
LOAD_SIZE(_RamfuncsLoadSize),
RUN_START(_RamfuncsRunStart),
PAGE = 0
code:
#pragma CODE_SECTION("ramfuncs");
void mycopy( void )
{
Uint16* dst_ptr = (Uint16*)0x3F0010;
Uint16 srcBuffer[10];
for (int i=0; i<10; i++)
{
srcBuffer[i] = i+200;
}
DINT;
g_status = Flash_Program( dst_ptr, srcBuffer, 10, &g_flashStatus);
EINT;
}
result:
FLASH_ST values after flash_program():
FirstFailAddr: 0x3f0010
ExpectedData: 200
ActualData: 65535 (0xFFFF)
g_status, the return value of Flash_Program() ends up being 0x1E
As an additional couple points of information:
flash_program is not called anywhere in the v100a code examples.
The first usage in the example code is in v136.
The return value of flash_program is not explained anywhere in the code I've seen, other than to show that STATUS_SUCCESS is the good value.
I've not seen any explanation of what other return values indicate.
Which version of controlsuite is that?
The one I installed from 15 Sept 2016 does not have v100a, only v100, and that example does not have that pdf in the doc folder.