6 years, 4 months ago.

Is it possible to debug code from the online compiler in KDS

I have exported my project and opened it successfully in KDS. When I try to step into an SPI write command, I actually just step over it. I cannot actually find the source code anywhere in the project that I have downloaded.

This is happenning in a very simple ISR, as shown below:

SPI spi1(PTD6, PTD7, PTD5); DigitalOut debugOut(PTC3);

void ticker1Isr() { debugOut = 1; spi1.write(spiCount++); spi1.write(spiCount++); debugOut = 0; }

The ISR is called as expected, but when I look at the signals on a logic analyser there seems to be a very long delay between the debugOut pin toggling and the SPI write operation. I want to see the lower level code so that I can see what is going on. I am stepping through in debug mode, but when I get the the line, "spi1.write(spiCount++);" and I click "Step Into" in KDS, it seems to actually just step over, as though this is the lowest code level.

Am I doing something stupid? Should I be able to see the source code for the SPI implementation? I can see the declaration in SPI.h, and I expect to find the implementation in a file called SPI.cpp or something similar, but I cannot find it. Is there something extra I need to do to get access to the source?

Thanks in advance.

When you exported did you get the mbed-os as a binary library? Probably did. Maybe try importing the full mbed-os source code into your online project, removing the precompiled mbed library and export again. Basically build all the files locally as part of your project.

posted by Graham S. 11 Dec 2017
Be the first to answer this question.