This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

when i was interfacing with adxl375 with nrf52840 error

https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ADXL375_5F00_I2C.zip

i was using the code from above link 

my sdk is 16

when i run the code ,i get an error like

Output/twi_sensor_pca10056 Release/Obj/thumb_crt0.o: in function `memory_set':

undefined reference to `main'

what should i do to rectify this?please help me

Parents Reply
  • Hi

    The nrf_drv_twi_init function has been changed to include a fourth 'context' variable in later version, but you can simply provide NULL or 0 like this:

    nrf_drv_twi_init(&m_twi_master, &config, NULL, NULL);

    The nrf_drv_twi_rx function is also changed, but here only the last 'no_stop' argument was removed, so you can fix his simply by removing the last 'false' in each all to nrf_drv_twi_rx:

    nrf_drv_twi_rx(p_twi_master,slave_addr, pdata, bytes);

    And then it seems you have two main functions in your project. You can only have one main function, so you need to decide which one to keep and which one to remove (simply renaming the one you don't need should make the project build). 

    Best regards
    Torbjørn

Children
No Data
Related