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.

TMS570LS3137: Flash_Program_Check() function Problem in bl_Flash

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hi,

While trying to program eeprom by referring the functions in bl_flash.c and .h files.

there is a function Flash_Program_Check() that check every program or erase operations whether that are valid or not by comparing 

the variable taken by parameter and memory which are stored.

Now this function take source memory adress as uint32_t paramater,

and if I want to save a variable uint8_t, I have to do:

uint8_t variable = 0x55;

then Flash_Program_Check( 0xF0200000, (uint32_t)&variable, sizeof(variable) ) ;

After that, program write epprom successfully and then starting to check 

by comparing value of *( 0xF0200000 ) = 0x55FFFFFF with content of address in the ram of variable like *(0x80...)= 0x55XXXX(anything can be. this is ram)

so comparing result always fails.

How should I compare source addres of my variable by masking only its adress ? I am not sure where I will mask

For example, in case above, 0x55 took place at first but next time maybe it will take place in the middle or at the end.

I want to use fee driver but I cant use bl_flash and fee driver functions together somehow, bl_flash functions crashes in runtime if fee driver enables in halcogen.

Also, If I enter No_Of_Bytes parameter less than 4, this will cause another bug at bytes counting in it.

  • Hi Ismail,

    If you want to use flash bank 7 as EEPROM, please use FEE driver generated by HALCoGen. The objective of TI FEE Driver is to provide a set of software functions intended to use a Sector of on-chip Flash memory as the emulated EEPROM.

    Please don't write data to EEPROM using your code like bl_flash.c if FEE driver is used. Otherwise, you will mess up the data in the EEPROM.

  • What I understood is if I want to program EEPROM, I have to use fee driver it is okey, got it. Besides using eeprom to store my calibratıon values I have to program flash bank 0 and flash bank 1 at the same time for bootloader purpose. At this point, you dont have library support on Halcogen. There is only bl_flash.c .h module. Unfortunately, this module could not be used if fee driver is enabled on Halcogen. Program throws error as I mentioned other threads while initialize flash bank function is executing.

  • Both data flash (bank7, EEPROM)) and program Flash (Bank 0 and Bank1) can be enabled and used at the same time. 

    While programming or erasing a sector of program flash, none of the flash locations in that bank can be read. This will stall the CPU until the erase has completed. When erasing a sector in the main flash (bank 0) the only way to keep executing is to copy instructions to the RAM and execute there or to execute code exclusively from another flash bank (bank 1).