I have problems with the F035 API. My intention is to store some application parameters in one of the free sectors on the flash.
The problem is that calls to erase/program functions of the flash API will cause the MCU to jump to one of the interrupt vector in sys_intvecs.asm.
This is my tool setup:
Code Composer: 5.3.0
HALCoGen: 3.6.0
Flash API: F035a 1.06 (included with HALCoGen)
First I generate the MCU initialization and driver code with HALCoGen. I create a new project and choose the deice TMDX570LS20SMDK (I have this development kit). The only change is do is to disable all driver modules. Then I generate the source code and create a CCS project. My CCS project settings:
- the device: TMS570LS20216SZWT
- endianess: be32
- compiler: TI v5.0.1
- output format: eabi
- linker command file: "empty"
- runtime support lib. : <automatic>
I use the library file pf035a_api_eabi_vfp.lib and add it to my project together with the include files.
The following code will make the MCU trip and never return from the Flash_Prog_B function.
#define DATA_SIZE 32
#define CONST_FREQ 8
#define SECTOR_21_ADDRESS 0x001E0000
#define SECTOR_21_LENGTH 0x8000
#define SECTOR_21_BASE_ADDRESS 3
void main(void)
{
FLASH_STATUS_ST status;
UINT32 data[DATA_SIZE] = {1};
Flash_Prog_B((UINT32*)SECTOR_21_ADDRESS, data, DATA_SIZE, FLASH_CORE3, CONST_FREQ, (FLASH_ARRAY_ST)0xfff87000, &status);
}
Any suggestion on what might be wrong?
Is where any example code available that shows the use of the flash API with my tool setup?
I have added my dummy project to this post.
Best regards,
Oystein