Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Compile a function or an application for raspberry

Compile a function or an application for raspberry 2 years 5 months ago #11259

  • do_mhd
  • do_mhd's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Hello,

First of all thank you for this amazing tool and forum.

I am trying to build a project for raspberry pi :
My development station is a virtual machine running Ubuntu (x86_64_linux)
My process station is the raspberry pi

In my project I wish to call a function from the plc program, I did it as described in chapter 11 from designer's guide (Call functions from the plc program) :
- The c code is written under $pwrp_src
- The function is included in ra_plc_user.h which is copied in $pwrp_inc
- I used the same make file in the designer's guide

Using make, I compiled the code and obtained the object in $pwrp_obj of my development station.
I build for the development station and the function works perfectly in simulations.

However, I am failing to obtain the .o file compatible for the raspberry pi, so I can configure it in proviewR and build for the raspberry.

Does anyone have any clue on how to compile the c code for the raspberry pi on my development station ?
I am trying to adapt the makefile but not obtaining any result.

Thanks in advance...
The administrator has disabled public write access.

Compile a function or an application for raspberry 2 years 5 months ago #11260

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi,

You have to compile with the crosscompiler to generate code for the rpi.
Modify the makefile and use arm-linux-gnueabihf-gcc instead of gcc.

You should also direct the o-file to bld/linux_arm/obj that is $pwrp_obj when you build for rpi.

/Claes
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 8.733 seconds