Post Go back to editing

CCES, ADSP-SC570, no printf output to console

Category: Hardware
Product Number: ADSP-SC570


I am using CrossCore Embedded Studio on the ADSP-SC570 Development kit.
I am able to load and run my project which was developed using the Power_On_Self_Test example provided in ADSP-SC5xx_EZ-KIT_Lite-Rel2.0.2.
The code, which contains a "Hello World" printf statement, is being loaded on to the A5 core. It executes but does not provide output to the console.

A previous community response suggested adding \n to the end of the statement and also setting the  __primIO breakpoint.
The dialogue below shows how the user suggested setting the breakpoint.

However, in my current workspace, the automatic breakpoints do not contain __primIO.

It appears that I may be missing a setting or an install to allow for console output?
Any help on how to get the printf to route to the console would be appreciated.


Moved & tagged
[edited by: emassa at 2:12 PM (GMT -4) on 13 Mar 2023]
  • Additional information: I am running the code on the A5 Cortex.

  • Hi,

    For SHARC and Blackfin cores, output to the CCES console is implemented with a so-called "primitive write" operation, which takes a character buffer and its length as its arguments. Glossing over implementation details, printf() basically processes its arguments into one or more primitive write operations, depending on buffering mode.

    The primitive write is implemented with a breakpoint called __primio. When connected to a debug session, the target is halted on the breakpoint, the buffer and length are fetched from the target memory and written to the console, and the target resumes.

    For ARM core, semihosting allows us to route to our console window.

    Semihosting is a facility which allows a program running on the target to access stdio facilities provided by CCES on the host, e.g to use printf() to print messages in the console window.

    Therefore, please ensure that “Enable semihosting” checked, under “Automatic Breakpoints” for core 0.

    Also, The stdout stream is line-buffered by default. You have to either print a new-line at the end of the string, call fflush(), call exit() or return from main() before the line in the buffer will be output. The example hasn't done any of these things when it spins in a while(1) loop at the end of main().

    We are able to print in console window for cortex core using printf. Please refer the attached screenshot "Test_printf.jpg".

    If you are still facing issues, please delete existing workspace, create a simple project from scratch in new workspace & create new debug session and enable semihosting and also add new line (\n) at end of printf statement, then let us know how you are getting on.

    Best Regards,

  • Hi,

    I have enabled semi-hosting.
    (Please note that there are NO __primIO breakpoints listed.)

    Attached is a sample run of the project.
    Program runs to POST, but generates no output to console.

  • Hi,

    Unfortunately, we are unable to simulate your issue here EZ-KIT. We could able to print in console window using printf for cortex core post example project. Please refer the attached screenshot "post_test_print.jpeg"

    Could you please try to create a simple new project for core0 (instead of post code)and test whether printf function works.

    If you are facing issue with specific project, Please share us your example project to simulate your issue here.

    If possible can you please try to run in EZ-KIT board and let us know how you gets on. Also, please try in different machine.

    Please let us know which version of CCES and operating system you are using.

    As we mentioned before, __primIO breakpoint available for SHARC and Blackfin cores only.




    Attached a brand new project using a brand new workspace.
    The project has has two problems:
    1- There is no console output when using the printf
    2- The define ADI_CORE_SHARC0 is reporting unresolved even though its in <sys/adi_core.h>

    For my test, I added a test printf, added the stdio.h include &  commented out the adi_core_enable() functions. I was then able to compile and run, but still get no output.

    Thanks for your help.

  • CCES is running on Windows 11 Enterprise with an Intel(R) Core(TM) i7-10750H CPU@2.60GHz
    I am using the
     “CrossCore Debugger” session with the ICE-1000 provided with the kit.
    I am using the EzKit license string.
  • Do I need to make a call to init_uart_stdio() to get console output?

  • I have an additional clue to this printf problem.
    When I first install CCES and create a new workspace & project, the printf works!
    However, after I install the FreeRTOS add-in, the printf fails to write to console.

    Is there an RTOS configuration setting that must be enabled for prints to console?

  • Hi,

    Unfortunately, the default method of semihosting I/O is incompatible with FreeRTOS for cortex-A platforms.

    Therefore is recommended to use UART for this, in a similar manner to other platforms/toolchains.

    Output from the application should be visible within the TTY terminal (e.g. PuTTY/TeraTerm).

    We recommend to refer section "5.1 Running the Basic Example for ARM on ADSP-SC573 EZ-Kit with CrossCore Embedded Studio" in below linked user guide for more details.

    Also, Please refer section "Download FreeRTOS source code" for more details on FreeRTOS source code.

    After successfully installation, you can find the below examples in the FreeRTOS installation path:
    <Installation path>\Analog Devices\Freertos\FreeRTOSv10.0.0\FreeRTOS\Demo

    Please refer the user guide "adi_freertos_user_guide.pdf" which available in the below path after installing FreeRTOS software.
    <installation path>:\Analog Devices\FreeRTOSvx.x.x\Docs

    Also, Information on the device I/O feature of the GCC toolchain can be found in the CCES help:

    Start CCES
    From the Help menu select Help Contents

    In the left pane browse to CrossCore Embedded Studio > ARM Development Tools Documentation > Cortex-A > Analog Devices ARM Toolchain Manual > Analog Devices Runtime Library Support > Device I/O Support