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.

TMS570LS0432: Memory Mapping issue with printf() statements

Part Number: TMS570LS0432
Other Parts Discussed in Thread: HALCOGEN, , LAUNCHXL2-570LC43

My main symptom is in the CCS console any printf statement results in the following response:

"Invalid CIO command (0).  Memory map prevented reading 0x0800970C"

This memory location corresponds to the CIOBUF section that I believe is temporary data used by printf that the debugger reads to display the printf statement. (See Below)

During my debugging efforts, I've noticed that depending on the HalCoGen-configured User-Stack size and binary size that this issue presents whenever this CIOBUF section falls above 0x0800_8000. My theory is that this may be a configuration setting on the Debugger (perhaps a GEL file?) and not the processor/HAL code.

Miscellany

  • Disabling the MPU any various nMPU regions has no impact on this issue
  • This issue appears intermittent based on application binary (Perhaps smaller stack allocations happen to result in better chance of the CIOBUF symbols from falling under 0x0800_8000)
  • No HalCoGen MPU or RAM settings seems to correspond to the observed 0x0800_8000 boundary.
  • I'm building my binary outside of CCS but am using CCS to flash the binary and use the debugger - perhaps a setting is getting lost between the build step and debugger configuration used by CCS?

If this is a debugger setting any instructions on parameters or files to investigate would be helpful. Thanks!

my HL_sys_link.cmd file:

  • During my debugging efforts, I've noticed that depending on the HalCoGen-configured User-Stack size and binary size that this issue presents whenever this CIOBUF section falls above 0x0800_8000.

    The TMS570LS0432 has 32 KB of RAM, between 0x08000000 and 0x08007FFF, as shown by the datasheet:

    The ccs1030/ccs/ccs_base/emulation/gel/tms570ls043x.gel matches the above, which explains why the CCS debugger reports "Invalid CIO command (0). Memory map prevented reading 0x0800970C" :

            GEL_MapAdd(0x08000000, 0, 0x00008000, 1, 1); /* Internal RAM          */

    my HL_sys_link.cmd file:

    What caused the HL_sys_link_cmd to set the RAM memory region to be from 0x08004000 to 0x0807EFFF which is beyond the end of the the 32KB of RAM in a TMS570LS0432?

  • Chester - Thanks for looking into this.

    I believe this chip set for the Hercules Launchpad corresponds to SPNU563A which has larger RAM than the configuration you are showing (March 2018 version):

    https://www.ti.com/lit/ug/spnu563a/spnu563a.pdf?ts=1624119072343&ref_url=https%253A%252F%252Fwww.google.com%252F

    For what it's worth, I used the default project created by New > TMS570LC43x > TMS570LC43572WT and it's RAM configuration is shown as:

    MEMORY
    {
    /* USER CODE BEGIN (2) */
    /* USER CODE END */
    VECTORS (X) : origin=0x00000000 length=0x00000020
    FLASH0 (RX) : origin=0x00000020 length=0x001FFFE0
    FLASH1 (RX) : origin=0x00200000 length=0x00200000
    STACKS (RW) : origin=0x08000000 length=0x00001500
    RAM (RW) : origin=0x08001500 length=0x0007eb00

    /* USER CODE BEGIN (3) */
    /* USER CODE END */
    }

    which I believe matches the datasheet. Perhaps it's as simple as updated that GEL file and loading it into CCS?

  • I believe this chip set for the Hercules Launchpad corresponds to SPNU563A which has larger RAM than the configuration you are showing (March 2018 version):

    Can you clarify which Hercules Launchpad you are using?

    The thread title contains TMS570LS0432 which is the device datasheet I listed the RAM for.

    Whereas SPNU563A is for a TMS570LC43x.

  • The PN is LAUNCHXL2-570LC43, which I believe corresponds to TMS570LC43x.

    This confusion actually gets the root cause of my issue - I was using the "TMS570LS043x" CCS configuration instead of the proper "TMS570LC43x" and they must have been close enough to flash the ELF but have intermittent issues due to RAM size.

    My issue is now resolved, feel free to relabel this issue as you see fit. Thanks for the support!