Welcome, Guest
Username: Password: Remember me
CodeTyphon Cross-Build Development, discussions and problems
  • Page:
  • 1

TOPIC:

CT 7.1 kills my code 4 years 6 months ago #14660

  • concrete
  • concrete's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 11
  • Thank you received: 0
I have a very strange problem, and I'm hoping somebody will have a solution.

For the last few years, I've been using CT 5.9, and everything's been working great. Yesterday I decided to try CT 7.1 (clean install on a virtual machine).

I took one of my projects from CT 5.9 and converted it to 7.1 The conversion was fine, but when I was running the program, something was wrong.

The program is running on ARM Linux (RPi2), and I have a procedure which toggles one of the GPIO pins on and off at certain times. The exact same code works fine when compiled with CT 5.9, but does not work when compiled with 7.1. The majority of the program runs fine (more than 6100 lines of code), but the code which is responsible for the GPIO doesn't work. No error messages, no exceptions, no crashes - just doesn't work.

It appears that CT 7.1 is compiling the code differently from CT 5.9, and the result is a non-working routine.

I created a very simple test program to demonstrate exactly what I'm doing. Please see the attached file.

Host OS: Windows 10 Pro running 32-bit version of CT 7.1
Target OS: ARM Linux (32-bit)
Target Processor: ARM (RPi2)
Attachments:

Please Log in or Create an account to join the conversation.

CT 7.1 kills my code 4 years 6 months ago #14661

  • Matis A.
  • Matis A.'s Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 1105
  • Thank you received: 161
Your target arm OS ? (Raspbian , Ubuntu, etc)
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Matis A..

CT 7.1 kills my code 4 years 6 months ago #14662

  • concrete
  • concrete's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 11
  • Thank you received: 0
Target OS is Raspbian.

Please Log in or Create an account to join the conversation.

CT 7.1 kills my code 4 years 6 months ago #14663

  • Matis A.
  • Matis A.'s Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 1105
  • Thank you received: 161
OK,
give me time to test and suggest, it's Sunday...
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

CT 7.1 kills my code 4 years 6 months ago #14664

  • Matis A.
  • Matis A.'s Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 1105
  • Thank you received: 161
After tests and fix your code, all works OK

Test on Raspberry Pi 3 Model B+ with latest Raspbian
and LAB CodeTyphon installed for debugging.

You can download your project with my fix from here

I execute your fixed projects with command
sudo ./GPIOTest
because normal Raspbian user (pi) do NOT have permition to open /dev/mem for Read and Write
line 100 at your unit LowLevelGPIO.pas

and some live screens from my tests

LAB CT on Raspberry Pi 3 Model B+ with latest Raspbian



sudo ./GPIOTest

PilotLogic Core Programmer
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by Matis A..

CT 7.1 kills my code 4 years 6 months ago #14665

  • concrete
  • concrete's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 11
  • Thank you received: 0
Thank you for looking into the problem - I appreciate it.

But this is not about user permissions. The exact same code runs fine when compiled with CT 5.9. Same user, same operating system, same Pi.

My program always runs as root, not a regular user.

When I tested the program with your modification, it still behaves exactly the same way. I have an LED connected to GPIO17, and with CT 5.9, the LED can be turned on and off. With CT 7.1, the code does nothing.

Please Log in or Create an account to join the conversation.

CT 7.1 kills my code 4 years 6 months ago #14666

  • Matis A.
  • Matis A.'s Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 1105
  • Thank you received: 161
It's better to test your project on an Raspbian Single Board PC
with CT installed for debugging

.
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

CT 7.1 kills my code 4 years 6 months ago #14667

  • concrete
  • concrete's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 11
  • Thank you received: 0
I've developed half a dozen production-environment programs for the Pi (all of them running 24/7 in industrial applications). Each of them contain several thousand lines of code.

They were all developed between 2015 and 2020 using CT 5.9 in Windows, and it was never necessary to install CT on the Pi for debugging any of them.

This is not a debugging issue, and not a permission issue. There are no bugs in the code to debug.

CT 5.9 produces a program that works.
CT 7.1 produces a program that doesn't work.

Please Log in or Create an account to join the conversation.

CT 7.1 kills my code 4 years 6 months ago #14668

  • Matis A.
  • Matis A.'s Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 1105
  • Thank you received: 161
Sir
many things in FPC changed in last 4 years.

My suggestion is to test and fix your library LowLevelGPIO.pas on a Target Hardware with CT,
it's the best approach.

We can do this for you, but we want a sample app to test.
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

CT 7.1 kills my code 4 years 6 months ago #14670

  • concrete
  • concrete's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 11
  • Thank you received: 0
Yes, I certainly believe that many things have changed in FPC during the last four years. But I have tens of thousands of lines of code, and everything works fine - except for this.

The best sample app I can provide you is what I already attached in the original message. If you compile it with CT 5.9 and run it on a Pi with an LED attached to GPIO17, everything will work normally. But the same program compiled with CT 7.1 will do nothing with the LED.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1