Other Parts Discussed in Thread: TMDSCNCD28379D
Hi
I am trying to get printf send debug messages to CCS using C I/O (in this case puts() ).
Out of the box it also does work fine, but to avoid that it reserves one of my two HW breakpoints I want to move it to ram as suggested in Tips for using Printf.
If I do a simple
`.text:cio : { rts*.lib<trgmsg.c.obj exit.c.obj>(.text) } > RAMLS`
It still works fine in debug, but this program can only run from debugger, as it relies on the debugger to fill the allocated ram section with the CIO code.
Therefore i wanted to add it to the ti.ramfuns section so the code is copied to ram by call to device_init().
But then I get no more output in the console.
I can't figure out why this is the case.
- I have verified that the code is actually copied to ram.
- I have put a function of my main program into ramfuncs too, just to verify that I can execute code there.
- I can see in the memory view of the debugger that values is written to the __CIOBUF_
- I have verified in the map file that C$$IO$$ and C$$EXIT is indeed placed in RAM.
I the attached demo project, please notice two commented lines in the CIO_inRAM.cmd file
In the packed version printf does not work, and it looks like this:
// Make sure the CIO relevant part is put into memory, to not block one of the two HW breakpoints.
//.text:cio : { rts*.lib<trgmsg.c.obj exit.c.obj>(.text) } > RAMLS
//.TI.ramfunc : {}
.TI.ramfunc : { -l rts*.lib<trgmsg.c.obj exit.c.obj>(.text) }
LOAD = FLASH,
RUN = RAMLS,
LOAD_START(RamfuncsLoadStart),
LOAD_SIZE(RamfuncsLoadSize),
LOAD_END(RamfuncsLoadEnd),
RUN_START(RamfuncsRunStart),
RUN_SIZE(RamfuncsRunSize),
RUN_END(RamfuncsRunEnd),
ALIGN(8)
If you change it to
// Make sure the CIO relevant part is put into memory, to not block one of the two HW breakpoints.
.text:cio : { rts*.lib<trgmsg.c.obj exit.c.obj>(.text) } > RAMLS
.TI.ramfunc : {}
//.TI.ramfunc : { -l rts*.lib<trgmsg.c.obj exit.c.obj>(.text) }
LOAD = FLASH,
RUN = RAMLS,
LOAD_START(RamfuncsLoadStart),
LOAD_SIZE(RamfuncsLoadSize),
LOAD_END(RamfuncsLoadEnd),
RUN_START(RamfuncsRunStart),
RUN_SIZE(RamfuncsRunSize),
RUN_END(RamfuncsRunEnd),
ALIGN(8)
It stops working, with the above mentioned limitation.
I am using the TMDSCNCD28379D Control board kit, and have tried using both and XDS110, and an XDS200. debugger.
I have not tried the builtin XDS110V2 thing, as neither this nor an available UART is present on my custom board where this ultimately must run.
Code Composer Studio Version: 12.2.0.00009