Skip to main content
KS.2
Associate III
August 2, 2021
Solved

devmem2 not working.I have installed devmem2 in my development board to read the peripheral registers however the command is not working /dev/mem opened however it is showing Error at line 75, file devmem2.c (1) [Operation not permitted]

  • August 2, 2021
  • 16 replies
  • 5678 views

..

This topic has been closed for replies.

16 replies

OlivierK
ST Technical Moderator
August 2, 2021
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
KS.2
KS.2Author
Associate III
August 2, 2021

Hi OliverK

yes i followed the same link and installed the devmem2 starter package.

I tried the baudrate command and led command and receieved the error.

dev/mem opened

Error at line 75, file devmem2.c (1) [Operation not permitted]

This is the error message

OlivierK
ST Technical Moderator
August 2, 2021

Hi KS.2 (Community Member)

I've just installed devmem2 it via the starter package and tried the command, no issue to be reported.

Are you using the latest starter package image (V3.0.x)?

root@stm32mp1:~# apt-get update                         

                                         

The software package is provided AS IS, and by downloading it, you agree to be  

bound to the terms of the software license agreement (SLA).           

The detailed content licenses can be found at                  

https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses.             

                                         

Get:1 http://packages.openstlinux.st.com/3.0 dunfell InRelease [3458 B]     

Get:2 http://packages.openstlinux.st.com/3.0 dunfell/main armhf Packages [1005 ]

Get:3 http://packages.openstlinux.st.com/3.0 dunfell/updates armhf Packages [29]

Get:4 http://packages.openstlinux.st.com/3.0 dunfell/untested armhf Packages [1]

Fetched 2477 kB in 4s (554 kB/s)                         

Reading package lists... Done                          

root@stm32mp1:~# apt-get install devmem2                     

Reading package lists... Done                          

Building dependency tree... Done                         

The following NEW packages will be installed:                  

 devmem2                                    

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.          

Need to get 2984 B of archives.                         

After this operation, 0 B of additional disk space will be used.         

Get:1 http://packages.openstlinux.st.com/3.0 dunfell/untested armhf devmem2 arm]

Fetched 2984 B in 0s (3572 B/s)                         

                                         

The software package is provided AS IS, and by downloading it, you agree to be  

bound to the terms of the software license agreement (SLA).           

The detailed content licenses can be found at                  

https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses.             

                                         

Selecting previously unselected package devmem2.                 

(Reading database ... 14610 files and directories currently installed.)     

Preparing to unpack .../devmem2_1.0-r7_armhf.deb ...               

Unpacking devmem2 (1.0-r7) ...                          

Setting up devmem2 (1.0-r7) ...                         

root@stm32mp1:~# devmem2 0x4001000C                       

/dev/mem opened.                                 

Memory mapped at address 0xb6feb000.                       

Read at address 0x4001000C (0xb6feb00c): 0x0000022C               

root@stm32mp1:~# 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
KS.2
KS.2Author
Associate III
August 3, 2021

root@stm32mp1:~# apt-get update

The software package is provided AS IS, and by downloading it, you agree to be bound to the terms of the software license agreement (SLA).

The detailed content licenses can be found at https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses.

Err:1 http://packages.openstlinux.st.com/2.0 dunfell InRelease

 Temporary failure resolving 'packages.openstlinux.st.com'

Reading package lists... Done

W: Failed to fetch http://packages.openstlinux.st.com/2.0/dists/dunfell/InRelease Temporary failure resolving 'packages.openstlinux.st.com'

W: Some index files failed to download. They have been ignored, or old ones used instead.

i am getting this error while trying to update,how to resolve this seems like a dnss issue

KS.2
KS.2Author
Associate III
August 3, 2021

root@stm32mp1:/etc# cat resolv.conf

# This file is managed by man:systemd-resolved(8). Do not edit.

#

# This is a dynamic resolv.conf file for connecting local clients directly to

# all known uplink DNS servers. This file lists all configured search domains.

#

# Third party programs must not access this file directly, but only through the

# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,

# replace this symlink by a static file or a different symlink.

#

# See man:systemd-resolved.service(8) for details about the supported modes of

# operation for /etc/resolv.conf.

nameserver 1.1.1.1

nameserver 8.8.8.8

nameserver 1.0.0.1

# Too many DNS servers configured, the following entries may be ignored.

nameserver 8.8.4.4

nameserver 2606:4700:4700::1111

nameserver 2001:4860:4860::8888

nameserver 2606:4700:4700::1001

nameserver 2001:4860:4860::8844

i think this is the reason as all the entries are being ignored

however i am unable to edit the resolv.conf file

is there any way usual editors are not working(nano,vim,gedit..

)

OlivierK
ST Technical Moderator
August 3, 2021

It looks like you are not using the latest openstlinux packages, are you sure you currently use a V3.0 starter image?

In /etc/apt/sources.list.d#, you should point to a debian package V3.0 (not V2.x)

There is vi that come as std to edit. Others need to be installed.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
KS.2
KS.2Author
Associate III
August 3, 2021

The resolv.conf is the issue i guess

nameserver 1.1.1.1

nameserver 8.8.8.8

nameserver 1.0.0.1

# Too many DNS servers configured, the following entries may be ignored.

nameserver 8.8.4.4

nameserver 2606:4700:4700::1111

nameserver 2001:4860:4860::8888

nameserver 2606:4700:4700::1001

nameserver 2001:4860:4860::8844

since all the servers are being ignored the dnss is not working

is there a way to edit the resolve.conf permanently

i tried overwriting using cat but it keeps changing once i reset the board.

OlivierK
ST Technical Moderator
August 3, 2021
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
OlivierK
ST Technical Moderator
August 3, 2021

However if you can move to openstlinux v3.0 it will likely solve your issue.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
KS.2
KS.2Author
Associate III
August 3, 2021

Will try that

OlivierK
OlivierKBest answer
ST Technical Moderator
August 4, 2021
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
KS.2
KS.2Author
Associate III
August 5, 2021

the problem.was with the internet connectivity fixed it and installed devmem2 now its working fine

Thank you for your help

OlivierK
ST Technical Moderator
August 5, 2021

Hi KS.2 (Community Member)

Please close this topic and open a new one for clarity.

In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

For the coprocessor topic this is where to start:

https://wiki.st.com/stm32mpu/wiki/Coprocessor_management_overview

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.