View Issue Details

IDProjectCategoryView StatusLast Update
0038763FPCOtherpublic2021-04-16 15:38
ReporterThomas Kuhn Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformARM (RaspBerry PI)OSRaspbian GNU/Linux 
Product Version3.0.4 
Summary0038763: In der Datei TermIOS.pas fehlen in der Defintionklausel {$ifdef cpuarm} Einträge obwohl sie verwendbar sind.
DescriptionIch habe versucht ein Schnittstellen HAT (dual RS485) basierend auf SC16IS752 mit fpc & Lazarus zu verwenden.
Die Python Skripte verwenden
  TIOCGRS485 = $542E;
  TIOCSRS485 = $542F;
mit der passenden Struktur und funktionieren.

Ich habe das in meiner Applikation nachgebildet, und kann nun Half-Duplex über das OS erledigen lassen.
Wo die passende Struktur für die Schreib/Lese Aufrufe wirklich hingehört, weiß ich nicht, ich habe sie selber erzeugt.

 fpioctl(FHandle, TIOCSRS485, @RS485conf);
 fpioctl(FHandle, TIOCGRS485, @RS485conf);

  Tserial_RS485 = record
                    flags : cardinal;
                    delay_rts_before_send : cardinal;
                    delay_rts_after_send : cardinal;
                    padding : array [0..4] of cardinal;
  end;

const
  TIOCGRS485 = $542E; //Read Flags
  TIOCSRS485 = $542F; //Set Flags
  SER_RS485_ENABLED = $0001;
  SER_RS485_RTS_ON_SEND = $0002;
  SER_RS485_RTS_AFTER_SEND = $0004;
  SER_RS485_RX_DURING_TX = $0010;


Steps To ReproduceDie Datei TermIOS.pas prüfen.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

Bart Broersma

2021-04-16 14:27

reporter   ~0130405

Bugreports in English please.

Mark Morgan Lloyd

2021-04-16 14:53

reporter   ~0130406

Discussed at https://forum.lazarus.freepascal.org/index.php/topic,53706.0.html I don't read German either but the gist of it is that those constants are defined for aarch64 but not for 32-bit arm, and a Raspberry Pi can successfully drive an RS485 "hat" if the constants are provided in the program (i.e. kernel support is OK).

Thomas Kuhn

2021-04-16 15:38

reporter   ~0130407

There are entries missing after definition clause {$ifdef cpuarm} in the file TermIOS.pas which can be used anyway.

I tried to use an interface HAT (dual RS485) based on SC16IS752 with fpc & Lazarus.
The Python scripts use
  TIOCGRS485 = $542E;
  TIOCSRS485 = $542F;
together with a suitable data structure.

I mimiced that in my application and now the Os can deal with the Half-Duplex nature of RS485.

I don't know where the suitable data structure and the constants have to be placed.

Issue History

Date Modified Username Field Change
2021-04-16 14:06 Thomas Kuhn New Issue
2021-04-16 14:27 Bart Broersma Note Added: 0130405
2021-04-16 14:53 Mark Morgan Lloyd Note Added: 0130406
2021-04-16 15:38 Thomas Kuhn Note Added: 0130407