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.
Tool/software: Code Composer Studio
Hi,
I am trying to erase a flash memory sector in TMS570LS1224
(Hercules LaunchPad) with use of the library F021 v2.1.1.
1) Fapi_initializeFlashBanks(180);
2) Fapi_setActiveFlashBank(0);
3) Fapi_enableMainBankSectors(0xFF80);
4) wait for not busy
5) Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, (uint32_t*)0x20000);
6) wait for not busy
7) wait for success
In step 6) the program loops forever. The value of the register FMSTAT after
a time is equal to 0x0990. It is strange, because the bit 0x0800 is described
in spnu515b.pdf as Reserved R-0, and reads as 1. Other bits set are: CSTAT,
ERS, and BUSY.
Programming of the flash memory with use of F021 functions runs correctly.
The sectors erasing during programming a program from CCS also runs fine.
The procedure above runs from RAM with disabled interrupts.
Please help. Maybe I should do something before running the procedure
for sector erasing.
Thanks.
Hello,
Please add bl_flash.obj (.const) into the flashAPI section because the flash_sector[] data table (constant data) is used by bl_flash.c.
SECTIONS
{
.intvecs : {} > VECTORS
/* Place the outputsection“flashAPI". It is composed of the input sections: */
/* Fapi_UserDefinedFunctions.obj, bl_flash.obj, and F021_API_CortexR4_BE.lib */
/* It has two different allocations. It allocated to FLASH_API for loading, and allocated to SRAM for running. */
/* This output section is placed in the output file so that, when the program is loaded, */
/* it is in the FLASH_API memory range. Sometime during system execution, before anything in flashAPI is used, */
/* the application copies it from FLASH_API to SRAM. Note this copy is not done automatically. */
/* I must be taken in the application code. Any other section that uses flashAPI (either calls its functions or */
/* refers to its data) acts as if flashAPI is already in SRAM. The LOAD_START etc. statements establish symbols */
/* that are used to implement the copy. The value of the symbol api_load is the starting load address. */
/* Likewise, api_end has the ending load address, and api_run has the starting run address. */
/* api_size is the size */
flashAPI :
{
Fapi_UserDefinedFunctions.obj (.text)
bl_flash.obj (.text)
bl_flash.obj (.const)
--library= ..\..\..\lib\F021_API_CortexR4_BE.lib (.text)
} load = FLASH_API, run = SRAM, LOAD_START(api_load), LOAD_END(api_end), RUN_START(api_run), SIZE(api_size)
.text > FLASH0
.const > FLASH0
.cinit > FLASH0
.pinit > FLASH0
.data > SRAM
.bss > SRAM
}
Hi,
I am not using functions in bl_flash at all, only the functions from F021_API_CortexR4_BE_L2FMC_V3D16.lib.
I think that my sequence reproduces exactly what I see in bl_flash.c.
In the first line there is 160MHz, 180 is my typing error in the post.
Thanks,
Grzegorz
Hi,
It works now. THANK YOU VERY MUCH !
There is a related issue, byt I will open a new post.
Grzegorz