LOG_DEBUG(TRACE, "xxx")?

Hi.

I compiled firmware included bootloader, user_part and system_part1 on the linux. I compiled firmware as the following.

$ make clean all PLATFORM=xenon DEBUG_BUILD=y

And I can download binaries by the particle debugger as the following.

$ openocd -f interface/cmsis-dap.cfg -f target/nrf52-particle.cfg -c “adapter_khz 1000” -c “transport select swd” -c “init” -c “program d:/bootloader.bin 0xf4000 verify reset” -c “exit”
$openocd -f interface/cmsis-dap.cfg -f target/nrf52-particle.cfg -c “adapter_khz 1000” -c “transport select swd” -c “init” -c “program d:/user-part.bin 0xD4000 verify reset” -c “exit”
$openocd -f interface/cmsis-dap.cfg -f target/nrf52-particle.cfg -c “adapter_khz 1000” -c “transport select swd” -c “init” -c “program d:/system-part1.bin 0x30000 verify reset” -c “exit”

I compile firmware on the linux but I download binaries by openOCD on the windows 10.

In the source code, I found out a function LOG_DEBUG(…) in service/ind/logging.h. I think LOG_DEBUG(…) output logs if I compile firmware by DEBUG_BUILD. But I cannot any logs through USB Serial.
If LOG_DEBUG function is activated, Which port is it output the logs by LOG_DEBUG()? For example, USB Serial? SWO? any other port?

Best regards,
Inchul Lee.

The LOG_DEBUG requires DEBUG_BUILD=y and also a LogHandler in your user firmware to catch the logs. It would normally be for USB Serial, a globally constructed object like:

SerialLogHandler logHandler(LOG_LEVEL_TRACE);

or for the hardware UART (TX), Serial1LogHandler. You can also write a custom log appender if you want to send the data somewhere else.

Thank you for your information. First of all, when the firmware was complied with DEBUG_BUILD=y, I faced with APP_FLASH overflow. So I modified memory map and solved the problem.
I could see the APP log messages and System log messages through USB serial. But the log message I wanted is not printed USB serial. For example, I appended DEBUG, LOG_DEBUG and LOG(INFO, …) into system\src\system_setup.cpp.

template<typename Config> void SystemSetupConsole<Config>::handle(char c)
{
    if ('i' == c)
    {
    	// see if we have any additional properties. This is true
    	// for Cellular and Mesh devices.
    	hal_system_info_t info = {};
    	info.size = sizeof(info);
    	HAL_OTA_Add_System_Info(&info, true, nullptr);
    	LOG(TRACE, "device info key/value count: %d", info.key_value_count);
		LOG(INFO, "INFO : device info key/value count: %d", info.key_value_count);
		print("print\r\n");
		LOG_DEBUG(TRACE, "test-logdebug");
		DEBUG("test-debug");
                ...

How can I append CUSTOMER LOG?

Best regards,
Inchu Lee.