dependency on lib_xassert ...

New to XMOS and XCore? Get started here.
Post Reply
soundhound
Member++
Posts: 18
Joined: Thu Mar 08, 2018 4:07 pm

dependency on lib_xassert ...

Post by soundhound »

hi
after ticking off lib_logging and lib_xassert (which loggind depends on) in the makefile module dependencies for my Hello World application,
the compilation fails with
"lib_logging/src/debug_printf.c:2:10: fatal error: 'debug_print.h' file not found "

how can this be when the dependency is explicitly established?


User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

try adding:

Code: Select all

#include "debug_print.h"
and post your results. If still not working, post your code here.
soundhound
Member++
Posts: 18
Joined: Thu Mar 08, 2018 4:07 pm

Post by soundhound »

scrap my reference to lib_xassert, I don't think it is relevant here....

I'm not using any debug statements - that include is in lib_logging/src/debug_printf.c
so the anomaly is that lib_logging doesn't appear able to include its own header file!
from what I have read of the xtc guide so far a library should be describing everything about itself necessary for compilation.
my expectation is that ticking a dependency box in my app should be all that is needed for the library to compile itself for inclusion :(
soundhound
Member++
Posts: 18
Joined: Thu Mar 08, 2018 4:07 pm

Post by soundhound »

after going through the content of the underlying directory and swapping in files from a working compilation (AN00156 I2C example)
looking for the difference that accounted for not finding a library's own header file, I found that nothing mattered - I could not reliably recreate a failure/success, could not account for any step that yielded one or the other.

after a day's worth of fiddling I was creating a new project, toggling the makefile dependency on lib_i2c, and seeing the compilation of library lib_logging indicating the debug_print.h file was being found.
I can now NOT recreate the original error. Utterly inexplicable!!!
it's as if something in the behaviour of XTC itself changed over the course of the day.
frustrating to hit such anomalies right out of the gate.
Schatz143
Member++
Posts: 31
Joined: Mon Jan 20, 2020 9:54 am

Post by Schatz143 »

hi ,i got the same error for x200 explorer kit.And in the make file i selected lib_spi ,lib_logging also but
"workspace/lib_logging/src/debug_printf.c:2:10: fatal error: 'debug_print.h' file not found
1 error generated.
xmake[1]: *** [.build/_l_logging/src/debug_printf.c.pca.xml.decouple] Error 1
xmake: *** [analyze] Error 2"

Code: Select all




#include <xs1.h>
#include <spi.h>
#include <syscall.h>
#include <timer.h>
#include <print.h>
#include <platform.h>
#include "debug_print.h"



out buffered port:32   p_sclk  = on tile[0]: XS1_PORT_1I;
out port               p_ss[1] = on tile[0]: {XS1_PORT_1J};
in buffered port:32    p_miso  = on tile[0]: XS1_PORT_1K;
out buffered port:32   p_mosi  = on tile[0]: XS1_PORT_1L;
clock clk_spi = XS1_CLKBLK_1;

int main(void) {
  interface spi_master_if i_spi[1];
  par {
    on tile[0]: app(i_spi[0]);
    on tile[0]: spi_master(i_spi, 1,
                           p_sclk, p_mosi, p_miso, p_ss, 1,
                           null);
  }
  return 0;
}

void my_application(client spi_master_if spi)
{
    uint8_t val;
    printf("one bit transfer .0x22");
    spi.begin_transaction(0,100,SPI_MODE_0);
    val= spi.transfer8(0x22);
    spi.end_transaction(1000);
    printf("read data %d from the bus.\n",val);


}







User avatar
RedDave
Experienced Member
Posts: 77
Joined: Fri Oct 05, 2018 4:26 pm

Post by RedDave »

I have just experienced the same error.

I have a folder (PARENT_FOLDER) in which I have many projects, several of which are xTIMEcomposer. I have just created a new folder structure, including one for a new xTIMEcomposer project. I added lib_i2c to the project and built it getting the error

PARENT_FOLDER/AN_OLD_PROJECT/lib_logging/src/debug_printf.c:2:10: fatal error: 'debug_print.h' file not found

i.e. it was using lib_logging from elsewhere, not in this project's workspace!

I then looked to add lib_logging explicitly to this workspace, it wasn't there in the library list, because, once again, the connection to XMOS had turned off. I went into Window : Preferences : xTIMEcomposer : Enable connection to https://www.xmos.com/developer. The rebuild then worked.

The problem may be as simple as a lack of internet connection.

Since this post was the first I found when I went looking for a solution, this seemed a good place to post this info, even if a couple of years old.
Post Reply