Serial output from system firmware (read in Linux terminal)

Hi, I was trying to debug the particle photon system firmware but could not get the system firmware to print into the USB serial output port. I wanted print to serial (connected to my terminal as USB device) from the spark_protocol.cpp code on message receipt from cloud. I tried to do it through 2 calls,

serial_dump(“MY MSG”);
and
DEBUG(“MY MSG 2”);

But both did not print anything to serial form the system firmware. I am reading serial inputs from the USB using a Linux terminal.
PS, messages from my applications through serial are captured well, but I dunno how to print and read messages from the system firmware using serial.

Hey there! @mdma and @BDub will be able to give you feedback on serial debugging the system firmware, and I know that the upcoming release of firmware (v060) will have a significantly revamped system debugging system. Do you think you’ve successfully opened a serial connection with the device and the messages are simply not passing through from the system thread?

Have you read this and built the system with DEBUG_BUILD on?

Hi, can you tell me how to rebuild system modules with the DEBUG_BUILD=y flag? I am building by running “make DEBUG_BUILD=y” command in firmware/modules folder after a clean. This, however, does not make the system-part1.bin nor system-part2.bin, as per expected without the flag. Is there a makefile that does not build system modules when the flag is set?

You need to set the target platform, otherwise you are building for Core which is always monolithic.
And if you are building the develop branch you also need to set PARTICLE_DEVELOP=1.