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.

C6455, CCS3.3.38.2, and printf problem

Hi,

I couldn't use printf() function. puts() works but not printf() although I included stdio.h

Any ideas?

Thanks,

Pete.

  • Most likely, your problem has to do with heap space. I was able to build a simple "Hello, World!" test program using printf, and it worked just fine. This was with rts64plus from CodeGen 6.1.5 and -heap 0x1000 in the linker cmd file.

    If you are using BIOS, you will have to do a couple of steps to allow dynamic heaps, and then configure heaps in some memories, and then tell it to use those heaps.

    If these are not enough of help, please provide more information, like simulator or emulator or DSK, BIOS or not, etc.

  • Mariana, thanks for an useful link. It works.

    I didn't understand and do anything from Step 3 though

    • Step 3: Make sure you have allocated the .cio section to valid memory:
    This section is used by the C I/O functions and needs to be allocated to valid data memory (PAGE 1) in the linker command file. It usually requires ~0x120 words but may be dependent on device family.


  • Pete said:

    I didn't understand and do anything from Step 3 though

    • Step 3: Make sure you have allocated the .cio section to valid memory:

    This just means that your linker command file needs to have the .cio section mapped somewhere valid, which implies that your linker command file must contain a .cio section and that it must be mapped to valid memory, this is similar to other sections you have in your project (.text, .bss, etc.) that must be mapped to valid memory (DDR, ISRAM, etc.). If you are using DSP/BIOS than I believe this will be managed for you already if you are using a default BIOS configuration file.

    What you are trying to avoid here is either not having a .cio section defined, or having it defined and mapped to some invalid memory location.