How to use 'printf' on DVK-BASE-2+ADD5043 and AX8052F143

I have completed a hardware project using 27MHZ on AX5043, but now I have a software problem, I use DVC-2C, AxCode::Blocks, how to enable UART0 so that I can use printf

Hi Justin. You can enable the verbose output by selecting the right box in the “Kit Option” menu as shown below:

Note that the LCD on the DVK2c-MAIN board shares the UART0 so you can either display text on the LCD or on the COM port via UART0. In alternative you can use the DBGLINK which is displayed on AX CodeBlocks when selecting Debug Link:

Hi georgi:
Thank you for your answer. I finished the setting according to the instructions. I added printf(“found AX5043\n”), but “found AX5043” cannot be displayed in the Debugger link window. What should I do?

Hi Justin, for our AX8052 based DVKs we don`t have a typical printf function from the stdio.h C library but other skimmed down functions that achieve the same result.
To see how our firmware prints output on the UART or display please inspect our Ax-RadioLab generated source code.
In the main.c you can for example see that:

  • Line 318: display_writestr("found AX5043\n") - this function is used to send strings onto the UART0. You can find more detailed implementation in the display_com0.h/c where depending on what has been selected in the GUI the output will be displayed on the LCD (#if defined(USE_LCD)) or on COM0 (#elif defined (USE_COM0) ). In the same library you can find all the other functions used to print int, hex, etc.
  • Line 322: dbglink_writestr("found AX5043\n") - this function is used to send strings over the DBG Link. Details can be found in libmfdbglink.h/c.

(@justin.h725 since your latest posts shift from the “27 MHz match” topic, I have moved our conversation to this new topic.)

1 Like

Hi georgi:
I have completed the project according to your instructions, but I still have to connect the GPS module to the AX8052. UART0 has been used, so I want to use UART1. Do you have any suggestions to help me complete this project?