sudo cannot access file new_device

Friends,
I am adding a mikro click board driver to my OS. I issued:
cd /sys/bus/mikrobus/devices/mikrobus-0/
sudo cat new_device
cat: new_device: Permission denied

I am not allowed to access the file new_device. How do I correct it?

Hi. new_device is to write the manifest of a connected mikrobus board without clickID. So it does not make sense to read from it. See: Using mikroBUS — BeagleBoard Documentation

Mr Singh,
All of my click boards do not have clickID chips.

This is why I have to tell BeagleBoard how to use it.

I think you misunderstood what I meant to say (I was replying from the phone). What I meant was that you are supposed to write the manifest to new_device not read from it (cat reads from file).

You can check the Section What if my add-on doesn’t have ClickID? for more context but for mikroBUS addon boards without clickID or with non functional manifest, you write a functional manifest to the new_device file as follows:

cat /lib/firmware/mikrobus/AMBIENT-2-CLICK.mnfb > /sys/bus/mikrobus/devices/mikrobus-0/new_device

This parses the manifest to identify the currently connected board. You can also remove a previously registered board by writing anything to delete_device sysfs entry at the same path.

Ok, then.
But at this stage, I just want to see what is inside
/sys/bus/mikrobus/devices/mikrobus-0/new_device

so I run cat. This action should have been permitted.

What do you mean by inside? There are 2 possible cases:

  1. mikroBUS addon board with clickID
    In this case since the board identification is automatic, if you want to know if the manifest was parsed successfully, you can check dmesg logs.
    A sysfs entry at /sys/bus/w1/devices/w1_bus_master1-cc-<random>/mikrobus_manifest can be used to read the current manifest or write a new manifest to it. Note: the manifest is binary blob, not the readable manifest format.

  2. mikroBUS addon board without clickID
    In this case, you can manually write the manifest to sys/bus/mikrobus/devices/mikrobus-0/new_device but this manifest is not stored anywhere and you will need to load the manifest again after reboot. There is also no way to read the manifest back since well the user already must have the manifest since they were the ones who loaded it.

1 Like

I see.
The entry /sys/bus/mikrobus/devices/mikrobus-0/new_device is not even a file! :laughing: