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

Color sensor pca20035

Dear, 

I am using thingy:91 pca20035 and try to test the color sensor BH1749NUC

I tried to run the /samples/sensor/bh1749

I got the output: 

SPM: NS image at 0xc000
SPM: NS MSP at 0x20020a78
SPM: NS reset vector at 0xde51
SPM: prepare to jump to Non-Secure image.
***** Booting Zephyr OS build v1.14.99-ncs3-snapshot2-1270-gb1d603491de8 *****
device is 0x20021d9c, name is BH1749
[00:00:00.004,913] [1B][0m<inf> BH1749: BH1749 initialized[1B][0m

I expected it will return the color in process(dev); but I got nothing. 

Do I need to do some "trigger" to enable sensor? 

Thanks, 

BR, 

Hoang Nguyen

Parents Reply Children
  • I think I found a fix to this. After some attempts, I was only able to get the example working when I started a debugging session through SES.

    This is because the program stops at the start of main(), after all the zephyr initialization happens, and you'll have to manually continue the program from there.

    I tried to add k_sleep(500) in the start of main, and flash the program without any debugging, and it worked. Try this fix, and check if you're able to make it work.

    I'll take a deeper look into this and figure why a delay is necessary, and report back to you when I figure it out.

    Best regards,

    Simon

Related