Forum > Debugger

Raspbian: running a program using PascalIO from the IDE

<< < (6/6)

MarkMLl:
Remember that if you can run Linux on it, you can run Lazarus/FPC/gdb on it. At that point if you can SSH into it you can effectively do /local/ debugging.

I can't speak for gdbserver to a non-local process, so suggest that you try it locally first. The major gotchas are (a) do not modify or rebuild your program between starting the program using gdbserver and using the IDE to start debugging and (b) the command line parameters are applied to gdbserver+program: not in the IDE.

MarkMLl

GuidoJ:
Hi Mark!
I build three installation files for FPC 3.2.0 and Lazarus 2.0.12
  fpc-laz_3.2.0_armhf.deb
  fpc-src_3.2.0_armhf.deb
  lazarus-project_2.0.12-0_armhf.deb
see -> https://wiki.freepascal.org/Build_current_FPC_and_Lazarus_for_Raspbian
I you like, I can prepare a download for you.

MarkMLl:
I'm fine thanks. Been doing it since something like Lazarus 0.9.24.

MarkMLl

GuidoJ:
Another update:
I have a basic webserver running that reads out and displays some (currently 4) 1-wire temperature sensors, is able to switch a relay, and handles some configuration settings.
My PI zero now has Raspbian Light installed - very compact; I don't really need the GUI for my application.

I switched from PascalIO to Raspbians pigpio package and now handle the GPIO pins via shell calls:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---uses ..., Unix, ...;[..]function SetPin(pinNo, State:integer):longint;var  st : string;begin  st:=format('pigs w %d %d', [pinNo, State]);  result:=fpSystem(st);end;[..]
That may be much slower, but - as I want to react to a weather forecast - split second timing is not an issue. The function above can do about 130 changes per second on a Pi4; more than adequate.
The calls to "pigs" do not require root privileges and debugging from within the IDE works fine.

Navigation

[0] Message Index

[*] Previous page

Go to full version