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.

TMDSCNCD28M36: FlashAPI writing problem: F28m36 c28

Part Number: TMDSCNCD28M36

Hello,

I am implementing a bootloader where it take Intel-base hex files in order to update both cores from the F28M36 CPU. The M3 part is fine, and I am facing an issue with the C28 FlashAPI.

Below there is the code that I want to load to the device:

:020000040013E7
:20A000007622761F002B1A2F8000761AFF6900067622761F01C056BF011B761A8F24021E9F
:20A010009A03FF69C5C43E6776228F240214C5C49A019B08FF693E67520060F88F24021455
:20A02000C5C49A0228A8803F3E67520060F88F00701083A4761F01C0C4A4DD0D1AC501005F
:20A030001A1D0200DE091A1D040083A41A1D08001A1D10001A1D2000DC0CDD101A1D400065
:20A040001A1D80001AC601001A1D00011A1D00021A1D00041A1D00081A1D00101A1D0020DF
:20A050001A1D00401A1D00801A1900011A1900021A1900041AC508001A2001001A200200C4
:20A060001A2004001AC404001A1C01001A1C00101A1C10001A1C00011A1C0004761AFF6994
:20A0700000068F24021EC5C49A033E6776228F240214C5C49A019B08FF693E67520060F84D
:20A080008F240214C5C49A0228A880003E67520060F8761F01C41A008000761F01C61A00C9
:20A090008000770077008F240220FF69C5C43E678F240216C5C49A019B083E67520060F9F5
:20A0A0008F240216C5C49A0228A880003E67520060F8761AFF697653A00800062DA9761F37
:20A0B0004FFF0632761F002B9235FF6290010006761F4FFF28ABFFFF28AAFFFF0636CE34C9
:20A0C000CF350FAB610B76220200761F002B19011E30020019011E32761AFF690006761F95
:20A0D000002B4A2F6C07482F6D03492F6C039A0000069A010006761F4FFF063A28ABFFFF56
:20A0E00028AAFFFFCE38CF39CE3CCF3DCE3ECF3F0FAB611176220200761F002B19011E2074
:20A0F000020019011E22020019011E24020019011E26761AFF690006761F002B462F6C0790
:20A10000442F6D03452F6C039A0000069A01000628AD0080FF69561F5616561AE610020032
:20A110002940761F00002902761B7653A23252006142762228A9A23528A800130901611B3A
:20A1200076D3A23529046F0F9B0024A9DF016C04290424A8DF011EA6F7A1248606A781A1EE
:20A1300009011EA724A96303FF5C3B0459A9DF010009FFEC28A9FFFF28A8FFFF0901610590
:20A140008F3FFFFF7653A1B4761A7653A23428A9FFFF28A8FFFF0901610E76FFFFFF6F06E8
:20A15000DF01C3BD1EA73E67C5BE24A9DF0124A8FF5860F77653A2107653A18D3B10761F29
:20A1600000331820FFFE2B222B242B262B282B2A2B2C2B2E2B302B322B342B362B382B2309
:20A170002B252B272B292B2B2B2D2B2F2B312B332B352B372B391A2000012821FFFF291036
:20A18000FF690006761F00331A2000012821FFFF2910FF69000677006F00B2BD761F0280F4
:20A1900059A99200610D28ABFFFF28AAFFFF28A9FFFF28A8FFFF0FAB6103767FFFFF761FC9
:20A1A0000280C5063E67761F0280060461041EA792A13E67761F0280060261031EA73E679D
:20A1B0007653A18B8BBE0006B2BDAABDA2BDFE0882A4D1005ACB6F155CAD2901560303A140
:20A1C00007A3DC8809025CA483A902087653A1D8064261068A4483467653A1D85ACBD90167
:20A1D00092A254A166EAFE8882BE86BE8BBE00065200A8AB8EA4610880A9DF8188A78085A0
:20A1E0007F80000EFFFE88A90FA6610F5300610D9DFF5CA876BFFFFE92859680000EFFFE34
:20A1F00092859680000CFFF8A9A400067653A0717622761F017E1A0B8000FF69761F017F24
:20A200001A0180007653A15E3B1076260000762F0000761F017F18017FFF1A0180006FFA9F
:20A2100028ABFFFF28AAFFFF28A9FFFF28A8FFFF0FAB6004BE00D4006F0928ABFFFF28AA25
:20A22000FFFFA9A488C409028AA992A67653A1F60006761F0280A8080006761F0280A80619
:0AA23000000600069A010006000671
:20A23500FFFFA00000000001FFFEA002000000000000FFFEA004000000000000FFFEA00687
:14A245000000A2310013FFFEA0080000A231001300000000 94
:00000001FF

My software use the following code to save the information to the flash:

oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)ui32index,
                                                    msgBuffer+2+i,
                                                    8,
                                                    0,
                                                    0,
                                                    Fapi_DataOnly);
while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);

if(oReturnCheck != Fapi_Status_Success) {
    FnCallStatus = 10;
    break;
}

Everything works fine until the following line is processed:

:0AA23000000600069A010006000671

It says that it has to save 10 bytes to the address 0x0013A230. The following bytes: 00000600069A0100060006

As it is not a multiple of 8 bytes, my code fill the remaining bytes with 0xFFFF.

It works. I can see these bytes on the CPU memory.

But the next line:

:20A23500FFFFA00000000001FFFEA002000000000000FFFEA004000000000000FFFEA00687

Which says to save 32 bytes on the address 0x0013A235. it doesn't work.

Is it a problem related to the initial address to be saved to Flash? Is is related to the previously saved 0xFFFF information?

I made a manual modification on the Hex File, where I assembled those sections into one memory block, where at the end became the following file?

:020000040013E7
:20A000007622761F002B1A2F8000761AFF6900067622761F01C056BF011B761A8F24021E9F
:20A010009A03FF69C5C43E6776228F240214C5C49A019B08FF693E67520060F88F24021455
:20A02000C5C49A0228A8803F3E67520060F88F00701083A4761F01C0C4A4DD0D1AC501005F
:20A030001A1D0200DE091A1D040083A41A1D08001A1D10001A1D2000DC0CDD101A1D400065
:20A040001A1D80001AC601001A1D00011A1D00021A1D00041A1D00081A1D00101A1D0020DF
:20A050001A1D00401A1D00801A1900011A1900021A1900041AC508001A2001001A200200C4
:20A060001A2004001AC404001A1C01001A1C00101A1C10001A1C00011A1C0004761AFF6994
:20A0700000068F24021EC5C49A033E6776228F240214C5C49A019B08FF693E67520060F84D
:20A080008F240214C5C49A0228A880003E67520060F8761F01C41A008000761F01C61A00C9
:20A090008000770077008F240220FF69C5C43E678F240216C5C49A019B083E67520060F9F5
:20A0A0008F240216C5C49A0228A880003E67520060F8761AFF697653A00800062DA9761F37
:20A0B0004FFF0632761F002B9235FF6290010006761F4FFF28ABFFFF28AAFFFF0636CE34C9
:20A0C000CF350FAB610B76220200761F002B19011E30020019011E32761AFF690006761F95
:20A0D000002B4A2F6C07482F6D03492F6C039A0000069A010006761F4FFF063A28ABFFFF56
:20A0E00028AAFFFFCE38CF39CE3CCF3DCE3ECF3F0FAB611176220200761F002B19011E2074
:20A0F000020019011E22020019011E24020019011E26761AFF690006761F002B462F6C0790
:20A10000442F6D03452F6C039A0000069A01000628AD0080FF69561F5616561AE610020032
:20A110002940761F00002902761B7653A23252006142762228A9A23528A800130901611B3A
:20A1200076D3A23529046F0F9B0024A9DF016C04290424A8DF011EA6F7A1248606A781A1EE
:20A1300009011EA724A96303FF5C3B0459A9DF010009FFEC28A9FFFF28A8FFFF0901610590
:20A140008F3FFFFF7653A1B4761A7653A23428A9FFFF28A8FFFF0901610E76FFFFFF6F06E8
:20A15000DF01C3BD1EA73E67C5BE24A9DF0124A8FF5860F77653A2107653A18D3B10761F29
:20A1600000331820FFFE2B222B242B262B282B2A2B2C2B2E2B302B322B342B362B382B2309
:20A170002B252B272B292B2B2B2D2B2F2B312B332B352B372B391A2000012821FFFF291036
:20A18000FF690006761F00331A2000012821FFFF2910FF69000677006F00B2BD761F0280F4
:20A1900059A99200610D28ABFFFF28AAFFFF28A9FFFF28A8FFFF0FAB6103767FFFFF761FC9
:20A1A0000280C5063E67761F0280060461041EA792A13E67761F0280060261031EA73E679D
:20A1B0007653A18B8BBE0006B2BDAABDA2BDFE0882A4D1005ACB6F155CAD2901560303A140
:20A1C00007A3DC8809025CA483A902087653A1D8064261068A4483467653A1D85ACBD90167
:20A1D00092A254A166EAFE8882BE86BE8BBE00065200A8AB8EA4610880A9DF8188A78085A0
:20A1E0007F80000EFFFE88A90FA6610F5300610D9DFF5CA876BFFFFE92859680000EFFFE34
:20A1F00092859680000CFFF8A9A400067653A0717622761F017E1A0B8000FF69761F017F24
:20A200001A0180007653A15E3B1076260000762F0000761F017F18017FFF1A0180006FFA9F
:20A2100028ABFFFF28AAFFFF28A9FFFF28A8FFFF0FAB6004BE00D4006F0928ABFFFF28AA25
:20A22000FFFFA9A488C409028AA992A67653A1F60006761F0280A8080006761F0280A80619
:20A23000000600069A010006000671FFFFA00000000001FFFEA002000000000000FFFEA010
:20A2400004000000000000FFFEA0060000A2310013FFFEA0080000A231001300000000FF10
:00000001FF

With this configuration, everything was saved correctly to the Flash?

Is there any configuration on Hex Utility that I can do in order to assemble everything together?

Best regards,

Flavio

  • Flavio,

    Please search for "How many bits can be programmed at a time using Fapi_issueProgrammingCommand()?" in the Flash API wiki at processors.wiki.ti.com/.../C2000_Flash_FAQ .

    Also, please search for "Why do you use align directive (ALIGN(x)) in the linker cmd files provided in the C2000Ware examples?" in that wiki.

    Once you review these, we can discuss further. Let me know if that helps.

    Thanks and regards,
    Vamsi

  • Hello Vamsi,

    Thank you for your response.

    This link answered my questions. I revised my linker script, just adding ALIGN(4) at the end of each section specification.

    Below my final hex file:

    :020000040013E7
    :20A000007622761F002B1A2F8000761AFF6900067622761F01C056BF011B761A8F24021E9F
    :20A010009A03FF69C5C43E6776228F240214C5C49A019B08FF693E67520060F88F24021455
    :20A02000C5C49A0228A8803F3E67520060F88F00701083A4761F01C0C4A4DD0D1AC501005F
    :20A030001A1D0200DE091A1D040083A41A1D08001A1D10001A1D2000DC0CDD101A1D400065
    :20A040001A1D80001AC601001A1D00011A1D00021A1D00041A1D00081A1D00101A1D0020DF
    :20A050001A1D00401A1D00801A1900011A1900021A1900041AC508001A2001001A200200C4
    :20A060001A2004001AC404001A1C01001A1C00101A1C10001A1C00011A1C0004761AFF6994
    :20A0700000068F24021EC5C49A033E6776228F240214C5C49A019B08FF693E67520060F84D
    :20A080008F240214C5C49A0228A880003E67520060F8761F01C41A008000761F01C61A00C9
    :20A090008000770077008F240220FF69C5C43E678F240216C5C49A019B083E67520060F9F5
    :20A0A0008F240216C5C49A0228A880003E67520060F8761AFF697653A00800062DA9761F37
    :20A0B0004FFF0632761F002B9235FF6290010006761F4FFF28ABFFFF28AAFFFF0636CE34C9
    :20A0C000CF350FAB610B76220200761F002B19011E30020019011E32761AFF690006761F95
    :20A0D000002B4A2F6C07482F6D03492F6C039A0000069A010006761F4FFF063A28ABFFFF56
    :20A0E00028AAFFFFCE38CF39CE3CCF3DCE3ECF3F0FAB611176220200761F002B19011E2074
    :20A0F000020019011E22020019011E24020019011E26761AFF690006761F002B462F6C0790
    :20A10000442F6D03452F6C039A0000069A01000628AD0080FF69561F5616561AE610020032
    :20A110002940761F00002902761B7653A23252006142762228A9A23828A800130901611B37
    :20A1200076D3A23829046F0F9B0024A9DF016C04290424A8DF011EA6F7A1248606A781A1EB
    :20A1300009011EA724A96303FF5C3B0459A9DF010009FFEC28A9FFFF28A8FFFF0901610590
    :20A140008F3FFFFF7653A1B4761A7653A23428A9FFFF28A8FFFF0901610E76FFFFFF6F06E8
    :20A15000DF01C3BD1EA73E67C5BE24A9DF0124A8FF5860F77653A2107653A18D3B10761F29
    :20A1600000331820FFFE2B222B242B262B282B2A2B2C2B2E2B302B322B342B362B382B2309
    :20A170002B252B272B292B2B2B2D2B2F2B312B332B352B372B391A2000012821FFFF291036
    :20A18000FF690006761F00331A2000012821FFFF2910FF69000677006F00B2BD761F0280F4
    :20A1900059A99200610D28ABFFFF28AAFFFF28A9FFFF28A8FFFF0FAB6103767FFFFF761FC9
    :20A1A0000280C5063E67761F0280060461041EA792A13E67761F0280060261031EA73E679D
    :20A1B0007653A18B8BBE0006B2BDAABDA2BDFE0882A4D1005ACB6F155CAD2901560303A140
    :20A1C00007A3DC8809025CA483A902087653A1D8064261068A4483467653A1D85ACBD90167
    :20A1D00092A254A166EAFE8882BE86BE8BBE00065200A8AB8EA4610880A9DF8188A78085A0
    :20A1E0007F80000EFFFE88A90FA6610F5300610D9DFF5CA876BFFFFE92859680000EFFFE34
    :20A1F00092859680000CFFF8A9A400067653A0717622761F017E1A0B8000FF69761F017F24
    :20A200001A0180007653A15E3B1076260000762F0000761F017F18017FFF1A0180006FFA9F
    :20A2100028ABFFFF28AAFFFF28A9FFFF28A8FFFF0FAB6004BE00D4006F0928ABFFFF28AA25
    :20A22000FFFFA9A488C409028AA992A67653A1F60006761F0280A8080006761F0280A80619
    :0AA23000000600069A010006000671
    :20A23800FFFFA00000000001FFFEA002000000000000FFFEA004000000000000FFFEA00684
    :14A248000000A2310013FFFEA0080000A23100130000000091
    :00000001FF

    The Hex file did not concatenate the code from one address to the other. It shifted the start address so I can add the 0xfff information needed to respect the alignment.

    I will confirm if it is finally working tomorrow.

    Best regards,

    Flavio

  • Flavio,

    Glad the wiki helped. Yes, using the alignment in linker helps to start the section on a 64-bit boundary so that you can fill in 0xFFFF in the previous incomplete 64-bit words.

    Let me know how it goes.

    Thanks and regards,
    Vamsi
  • Flavio,

    Did it work for you?

    Thanks and regards,
    Vamsi

  • Hello Vamsi.

    I could finally test it here and it worked. Thank you very much.

    Now I am facing issues regarding the saved information and maybe will be another post. I hope not.

    Best regards,

    Flavio
  • Flavio,

    Thank you for the confirmation that it worked.

    As you said, please open a new thread as needed.

    I am closing this post.

    Thanks and regards,

    Vamsi