I’m attempting to debug some COAP calls made from the device-os on a P1. After a bit of digging I discovered that by doing the following I should be able to see the deviceOS logging:
Set up Workbench targeting deviceOS@1.4.0 for P1
Particle: Compile application for debug (local)
Put P1 in DFU-mode
run particle flash my-app.bin --usb
Reset device
Watch output with particle serial monitor
I’m starting my test with the most basic firmware before I try my own
When I watch the output from the logger, I only see messages coming through about the data going through hal. If I manually log things in my program, those will work though.
This isn’t the actual message – it’s similar to this though. I’m not by my hardware right now
[hal] TRACE: sent bytes 2
[hal] TRACE: received bytes 16
These logs fire any time data is sent/received by the device but I’m not seeing anything else.
I have a few questions
What am I doing wrong? Why aren’t all the logs showing up?
Is there any way to build the system parts in as a debug build through Workbench? My main application hasn’t been ported from ParticleDev
It looks like you need to flash the system parts of the DeviceOS. You compiled in debug, which is the correct step to take, but then you only flashed the empty application.
Once you flash system-part1.bin and system-part2.bin, then you will see all the logs from the device.
i’m curious if you see different results doing the following:
clean all the things: run the Particle: Clean application for debug (local) and just to extra-sure Particle: Clean application & DeviceOS (local) tasks
flash using the local compiler: run the Particle: Flash application for debug (local) task
fire up the serial monitor: run the Paricle: Serial Monitor command
to run a task, click “Terminal > Run Task…” from VSCode’s main menu, then select the task
to run a command, press cmd+shift+p (ctrl+shift+p on windows & linux), then type the command name in to filter and click an item to run it.
What exactly do these two do and where are the generated artifacts?
Particle: Compile application for debug (local)
Particle: Compile application & Device OS (local)
For the “Compile application for debug (local)” I was under the impression that it makes a single binary that includes bootloader + system parts + app.
I started looking through the system firmware and see that two years ago there was a commit to start removing some of the logging code to make the build size for Photon/P1 smaller.