Welcome, Guest
Username: Password: Remember me

TOPIC: ProviewR on Raspberry Pi

ProviewR on Raspberry Pi 2 months 4 days ago #12378

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 856
  • Thank you received: 2
  • Karma: 5
Hi Claes,

I re installed your recommended toolchain and it worked perfectly without any undefined references.
Thank you

By the way I tried to create a user io method for accessing a USB CAN over my rpi but I don t remember how to modified the $pwrp_appl/makefile in order to compile my C code driver against the above mentioned cross toolchain.

could you help me by providing the additionnal lines required (I guess at least a CC= flag but I m so bad with makefile that I would appreciate your help or guidances on that)

Also how to change the pwrp_obj directory to match the arm64 arch that the compiler is looking for ? Actually it generates every object file in projectpath/bld/x86_64_linux/obj rather than in projectpath/bld/arm64-linux/obj directory ?

Thanks for your help
Snarf

-- EDIT --
This is my makefile so far
snarf_top : snarf
include $(pwr_exe)/pwrp_rules.mk

snarf_modules : $(pwrp_obj)/rt_io_user.o \
	$(pwrp_obj)/ra_io_m_nodave_plc.o \
	$(pwrp_obj)/ra_io_m_nodave_transaction.o \
	$(pwrp_obj)/ra_io_m_usb_rack.o \
	$(pwrp_obj)/ra_io_m_usb_can.o



snarf : snarf_modules
	@echo "****** snarf modules built ******"
 
#
# Modules
#
 
$(pwrp_obj)/rt_io_user.o : $(pwrp_appl)/rt_io_user.c $(pwrp_appl)/ra_io_m_nodave.h
$(pwrp_obj)/ra_io_m_nodave_plc.o : $(pwrp_appl)/ra_io_m_nodave_plc.c $(pwrp_appl)/ra_io_m_nodave.h
$(pwrp_obj)/ra_io_m_nodave_transaction.o : $(pwrp_appl)/ra_io_m_nodave_transaction.c $(pwrp_appl)/ra_io_m_nodave.h
$(pwrp_obj)/ra_io_m_usb_rack.o : $(pwrp_appl)/ra_io_m_usb_rack.c $(pwrp_appl)/ra_io_m_usbcan.h
$(pwrp_obj)/ra_io_m_usb_can.o : $(pwrp_appl)/ra_io_m_usb_can.c $(pwrp_appl)/ra_io_m_usbcan.h
Last Edit: 2 months 4 days ago by Snarf77. Reason: adding makefile content
The administrator has disabled public write access.

ProviewR on Raspberry Pi 2 months 4 days ago #12379

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3215
  • Thank you received: 512
  • Karma: 134
Hi Snarf,

You can redefine pwrp_obj with

pwrp_obj := $(pwrp_root)/bld/arm64_linux/obj

If you look in pwrp_rules.mk you can see that cc is defined to gcc, and this has to be changed to the cross compiler.

/Claes
Last Edit: 2 months 4 days ago by claes.
The administrator has disabled public write access.

ProviewR on Raspberry Pi 1 month 3 weeks ago #12391

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 856
  • Thank you received: 2
  • Karma: 5
Hi Claes,

Just to confirm everything is now working following your guidances
Thank you very much for all

Just for my knowledge, can you switch between a cross compile environment and a normal one without changing each time the pwrp_rules.mk file ?

how do you manage if you have one app for a same arch PC target and one for rPI ? you changed pwrp_rules each time ?

Snarf
The administrator has disabled public write access.

ProviewR on Raspberry Pi 1 month 3 weeks ago #12392

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3215
  • Thank you received: 512
  • Karma: 134
Hi Snarf,

One way is to supply an argument to make. In the example below the argument "rpi" will execute the dependencies for rpi, while if no argument is supplied the first dependency in the file will be executed (appl).

appl: exe
	@ echo "make appl"

rpi: rpi_exe
	@ echo "make rpi"

include $(pwrp_exe)/pwrp_rules_local.mk

exe : $(pwrp_exe)/myappl

rpi_exe : $(pwrp_root)/bld/arm64_linux/exe/myappl

$(pwrp_exe)/myappl : $(pwrp_appl)/myappl.cpp
	@ echo "Link appl"
	@ $(cxx) -o $(target) $(source) ...

$(pwrp_root)/bld/arm64_linux/exe/myappl : $(pwrp_appl)/myappl.cpp
	@ echo "Link appl arm"
	@ $(cxxcross) -o $(target) $(source) ...

/Claes
The administrator has disabled public write access.
Time to create page: 9.074 seconds