pinMode PWM: Unable to do this when using /dev/gpiomem. Try sudo? [message #1852166] |
Tue, 03 May 2022 10:15  |
Kurt Struevy Messages: 45 Registered: May 2016 |
Member |
|
|
Hello,
since several weeks I try to find any solution for my problem.
I created an application using eclipse 2022-03 CDT. It works perfect!
a big compliment to the designers of eclipse.
After some time I got eclips running on a Windows machine using a toolchain for a raspberry pi.
Debugging for remote application works perfect.
But when I try to run an application where I use wiringpi then I get a problem where I havn't find any solution at all.
I use this code :
pinMode(motor_l_u, OUTPUT);
pinMode(motor_l_v, OUTPUT);
pinMode(motor_r_u, OUTPUT);
pinMode(motor_r_v, OUTPUT);
.....
pinMode(motor_l_u, PWM_OUTPUT);
pinMode(motor_l_v, PWM_OUTPUT);
pinMode(motor_r_u, PWM_OUTPUT);
pinMode(motor_r_v, PWM_OUTPUT);
Executing the first lines makes no problem.
But when I to try execute the lines
pinMode(motor_l_u, PWM_OUTPUT);
pinMode(motor_l_v, PWM_OUTPUT);
pinMode(motor_r_u, PWM_OUTPUT);
pinMode(motor_r_v, PWM_OUTPUT);
I get this error:
pinMode PWM: Unable to do this when using /dev/gpiomem. Try sudo?
Child exited with status 1
logout
Sometimes I think there is no way to debug such a programm when it needs wiringPi.
When I run the application on a console as normal user I get the same error.
When I run this application on a console typing
then it works.
Is there really no solution available?
I'm almost very frustrated because eclipse is a wonderfull IDE but without debugging such an appliation it's not usefull.
Kurt
|
|
|
|
Re: pinMode PWM: Unable to do this when using /dev/gpiomem. Try sudo? [message #1852174 is a reply to message #1852173] |
Tue, 03 May 2022 16:01   |
Kurt Struevy Messages: 45 Registered: May 2016 |
Member |
|
|
Hallo Tauno Voibio,
thanks for your quick replay!
No it's not necessary to add your user to gpio group
I found a working solution:
- create a script (e.G.: gdbscript) on the raspberry with the content
#! /bin/bash
#
sudo gdbserver $*
- store it
- mak it executable
- on eclipse modify
Debug Configurations ...
- tab: -->Debugger
- tab: ----> Gdbserver Settings
- tab ------> in Gdbserver path write:
the result is:
Last login: Tue May 3 18:08:32 2022 from 192.168.180.38
/home/raspi/gdbscript :2345 /home/raspi/Eclipse/RoboCar;exit
raspi@raspberrypi:~$ /home/raspi/gdbscript :2345 /home/raspi/Eclipse/RoboCar;exit
Process /home/raspi/Eclipse/RoboCar created; pid = 4686
Listening on port 2345
Remote debugging from host 192.168.180.38
see attached picture
that should work.
[Updated on: Tue, 03 May 2022 16:23] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02725 seconds