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.

TMS570LS1224: Problems with simultaneous use of FLASH and EEPROM

Part Number: TMS570LS1224

If Flash (Bank 0) example and EEPROM (Bank 7) example are implemented separately, Erase/Write/Read works normally.

However, if you use the two examples together, you will fall into undefEntry as shown below.

[ Source code (174 line) ]

[ Debug mode - occured undefEntry (55 line) ]

Looking at the questions and answers posted on the forum, I found out that BANK0 can be deleted and rewritten by modifying the code below.

I also learned that BANK7 can be erased and used without modification.

If so, any advice on how to use BANK0 and 7 together would be appreciated. The program I'm preparing for requires both.

1. Edit sys_link.cmd

2. Add the _copyAPI2RAM_ code in sys_core.asm below or use memcpy in sys_main.c to copy BANK0's API_FLASH area to SRAM area (either way)

[ sys_core.asm , sys_startup.c ]

[ sys_main.c ]

3. add supervisor mode

3. Upload the modified code below. I would appreciate it if you could tell me how to avoid falling into undefEntry.

example_eeprom_new2.zip

  • My problem is solved. Looking at the memory map, I added the FEE driver and did not modify the definition below, but the problem was that I overlooked the fact that the capacity occupied by the FEE driver was larger than expected.

    After modifying the below define, normal operation of Flash and EEPROM was confirmed.

    [before]

    #define APP_START_ADDRESS 0x00010100
    #define APP_STATUS_ADDRESS 0x00010000

    [after]

    #define APP_START_ADDRESS 0x00020100
    #define APP_STATUS_ADDRESS 0x00020000

    The problem is solved, but could you please review the code you uploaded to see if there are any other issues?

    (For example, I would like to know the difference, advantages and disadvantages of copying API_FLASH to SRAM in sys_startup.c and memcpying API_FLASH in sys_main.c.)