This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF SDK 1.7 + Actinius Icarus (nRF9160)

Hi,
I cannot compile the sample of VL53L0X with VSC.
I have the following error: 'DT_N_INST_0_st_vl53l0x_P_label' undeclared (first use in this function)
Do I need to add specific information related to my Icarus card?
By reworking the sample with other examples, I passed this error but I'm stuck on another point:
In the file /opt/nordic/ncs/v1.7.0/zephyr/drivers/sensor/vl53l0x/vl53l0x.c DEVICE_INST_DEFINE (0, vl53l0x_init, NULL, & vl53l0x_driver, NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY, & vl53l0x_api_funcs);
give me this first error (then others same style): error: expected declaration specifiers or '...' before numeric constant

Does somebody have an idea ?


Thanks for help
Parents
  • Hi,

     

    You'll need to add the vl53l0x to your device tree overlay.

    That is usually done by adding a board specific overlay, in my_application/boards/$board.overlay.

    Here's what I added to the board overlay file:

    &i2c2 {
            status = "okay";
            vl53l0x@29 {
                    compatible = "st,vl53l0x";
                    reg = <0x29>;
                    label = "VL53L0X";
            };
    };

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    You'll need to add the vl53l0x to your device tree overlay.

    That is usually done by adding a board specific overlay, in my_application/boards/$board.overlay.

    Here's what I added to the board overlay file:

    &i2c2 {
            status = "okay";
            vl53l0x@29 {
                    compatible = "st,vl53l0x";
                    reg = <0x29>;
                    label = "VL53L0X";
            };
    };

     

    Kind regards,

    Håkon

Children
  • thanks for help !

    I added an overlay file (actinius_icarus.overlay) in a folder boards.

    Whitout success, have you made any other changes ? on the call of device_get_binding ?

  • Hi,

     

    I did no other change to the example (zephyr/samples/sensor/vl53l0x/) other than create the folder "boards" and place the overlay file in that folder.

    I configured for board actinius_icarus_ns (therefore the overlay was in path path/to/zephyr/samples/sensor/vl53l0x/boards/actinius_icarus_ns.overlay)

     

    Remember to re-create your build after adding new changes to the device tree (ie. delete the build and regenerate it).

     

    Kind regards,

    Håkon

  • Merci, ça a fonctionné.
    Il fallait également créer l'application en mode Workspace et non freestanding.

    Thanks !

Related