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.

3137 HDK - CCS Reports Incorrect Endianness After Changing Project From RM48 - Seems to be stuck now

Other Parts Discussed in Thread: TMS570LS3137, HALCOGEN

Hello All,

I grabbed the SDCard project from QJ and changed it to work with the 3137 HDK board; had to change to be BE vs. LE - and once I did that the HDK board has become non-responsive.

I tried a project with IAR to see if the board still works - and it doesn't.  I have two 3137 HDK's.

CCS came back and said the endianess of the target is incorrect - that was the first indication that something was wrong.  Now no matter what I set it says that.

Has anyone else seen this?

This board has been working fine up to this - the board was not physically moved since changing the SDCard project.  

I also checked my CCS setup with the other HDK board - it is fine.

Thanks In Advance,
johnw

  • Hi John,

    The easy way is to use HalCoGen to generate a project for TMS570LS3137, then copy FS and SD folders to the new project.
    In my project, the line #10 in sys_core.asm is for little endianess, please change this line to
    mov r1, #0x0000

    Regards,
    QJ
  • QJ,

    OK - a couple of things - I have bootloaders on these boards and have to have adjusted memory maps for the application code - that isn't the root cause here but why the code wasn't erased that had the issue in it. But, it is interesting that having some files loaded with the wrong endianess can render the CCS tools seemingly useless. Since that code runs before the normal program entry point explains why CCS threw errors. Of course I am relieved that it was a firmware issue vs. hardware issue as the board did appear to be pretty dead when this happened.

    I looked at a couple of other projects that I have - instead of changing to what you have above I did this in sys_core.asm:

    mov r1, #0x03D0

    that is on line 19 in the file that I have.

    In sys_memory.asm:

    dloop
    ldr r6, [r9, #0x10] ; Load Pbist done flag
    cmp r6, #0
    beq dloop
    ldr r4, [r12, #0x90] ; read Pbist FSRF0
    ldr r5, [r12, #0x94] ; read Pbist FSRF1
    adds r6, r4, r5, lsl #1
    beq dTest
    ; ldrb r0, [r12, #0x63] ; read Pbist RAMT ;little endianess
    ; ldrb r1, [r12, #0x62] ; read Pbist RAMT ;little endianess
    ldrb r0, [r12, #0x60] ; read Pbist RAMT ;big endianess
    ldrb r1, [r12, #0x61] ; read Pbist RAMT ;big endianess
    tst r4, #1

    dloop starts around line 82.

    Make sure __big_endian__ is defined and __little_endian__ is undefined in the CCS preprocessor settings.

    When I did that - the demo was able to load and I viewed SD card contents via the SCI-USB I/F.

    Thanks,
    johnw
  • QJ/TI,

    In case you are interested - I grabbed the latest source (may need one final merge - I didn't check to see if the last merge was done on the elm chan site) - this works with the 3137 HDK - biggest change I saw was the f_mount function.  This build seems to work OK.

    Regards,
    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/312/4150.RM48-HDK-RevE-SDCard-Demo.7zJohn W.

  • John,

    I'm jumping in here and you may have already resolved the issue.

    The endian bit is changeable through CPSR and it's common to trash CPSR if you have stack overflow issues.
    (Since CPSR is often stacked).

    If you don't have the most recent CCS - check the value in CPSR and even check that it resets to the correct value after a system-rest.
    In some older releases of CCS / Hercules target we had Psuedo set incorrectly - which made the reset ineffective at restoring CPSR to the correct state -- so your part could seem 'stuck' with CPSR trashed even after applying a reset through the emulator.

    Sounds similar to what you were reporting in your first post - so I thought it worth mentioning.

    See e2e.ti.com/.../1246132 for more info on Psuedo if needed.
  • Anthony,

    Hmmm, the Psuedo issue is interesting.

    Problem has been resolved; I posted an example that shows this and runs on the 3137 HDK. Some of the assembly was hard-coded for little endian (RM48) vs. the 3137 HDK which is BE32.

    Regards.
    John W.