Compiling ersky9x r220 in Windows

ersky9xr is the port of the er9x firmware to the 9XRPRO radio.
Post Reply
ksmeaton
Posts: 4
Joined: Fri May 20, 2016 12:01 pm
Country: Australia

Compiling ersky9x r220 in Windows

Post by ksmeaton » Sun Nov 26, 2017 1:18 pm

Need help please:

I have been guided by a number of responses given by MikeB to others as to compiling ersky9x under windows but I seem to have missed something in my setup as I keep running into errors. My Windows platform is XP. I eventually want to compile for 9XR PRO, but having no idea as to where to specify this, I am compiling using the defaults just to get a successful run.

current results for clean and compile are:

D:\ErSky9X\mbtx-master\radio\ersky9x\src>make clean
rm -f x9dobj/*.*
rm -f x9eobj/*.*
rm -f x9dpobj/*.*
rm -f x12dobj/*.*
rm -f skyobj/*.*
rm -f skyRobj/*.*
rm -f skySobj/*.*
rm -f skyLobj/*.*
rm -f sky9XTobj/*.*
rm -f x7obj/*.*
rm -f ersky9x_rom.elf
rm -f ersky9x_rom.map
rm -f ersky9x_rom.hex
rm -f core_cm3.c.bak board_lowlevel.c.bak crt.c.bak vectors_sam3s.c.bak port.c.b
ak coos.c.bak sky/joy/HIDDJoystickDriver.c.bak sky/joy/HIDDFunction.c.bak sky/jo
y/USBDDriver.c.bak sky/joy/USBD.c.bak sky/joy/USBRequests.c.bak sky/joy/USBDescr
iptors.c.bak sky/joy/USBDDriverCallbacks.c.bak sky/joy/USBDCallbacks.c.bak sky/j
oy/HIDIdleRequest.c.bak sky/joy/HIDReportRequest.c.bak sky/joy/HIDDTransferDrive
r.c.bak sky/joy/USBD_HAL.c.bak sky/joy/pmc.c.bak sky/joy/device_descriptor.c.bak

rm -f core_cm3.lst board_lowlevel.lst crt.lst vectors_sam3s.lst port.lst coos.ls
t sky/joy/HIDDJoystickDriver.lst sky/joy/HIDDFunction.lst sky/joy/USBDDriver.lst
sky/joy/USBD.lst sky/joy/USBRequests.lst sky/joy/USBDescriptors.lst sky/joy/USB
DDriverCallbacks.lst sky/joy/USBDCallbacks.lst sky/joy/HIDIdleRequest.lst sky/jo
y/HIDReportRequest.lst sky/joy/HIDDTransferDriver.lst sky/joy/USBD_HAL.lst sky/j
oy/pmc.lst sky/joy/device_descriptor.lst
rm -f core_cm3.lss board_lowlevel.lss crt.lss vectors_sam3s.lss port.lss coos.ls
s sky/joy/HIDDJoystickDriver.lss sky/joy/HIDDFunction.lss sky/joy/USBDDriver.lss
sky/joy/USBD.lss sky/joy/USBRequests.lss sky/joy/USBDescriptors.lss sky/joy/USB
DDriverCallbacks.lss sky/joy/USBDCallbacks.lss sky/joy/HIDIdleRequest.lss sky/jo
y/HIDReportRequest.lss sky/joy/HIDDTransferDriver.lss sky/joy/USBD_HAL.lss sky/j
oy/pmc.lss sky/joy/device_descriptor.lss
rm -f
rm -f
rm -fR .dep

D:\ErSky9X\mbtx-master\radio\ersky9x\src>make REVB=1 REVX=1 STAMP=1
/usr/bin/cat: prov.txt: No such file or directory
/usr/bin/cat: .svn/entries: No such file or directory

Generate Version-stamp:
arm-none-eabi-gcc -c -mcpu=cortex-m3 -Os -gdwarf-2 -mthumb -fomit-frame-pointer
-Wall -Wstrict-prototypes -fverbose-asm -Dat91sam3s8 -DRUN_FROM_FLASH=1 -DBASIC
-DPCBSKY -DUSB_JOYSTICK -DSTAMP -DREVB -DREVX -DXFIRE -DCPUARM -MD -MP -MF sk
yRobj/core_cm3.o.d -I . -I./sky/joy/inc core_cm3.c -o skyRobj/core_cm3.o
process_begin: CreateProcess(NULL, arm-none-eabi-gcc -c -mcpu=cortex-m3 -Os -gdw
arf-2 -mthumb -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Dat9
1sam3s8 -DRUN_FROM_FLASH=1 -DBASIC -DPCBSKY -DUSB_JOYSTICK -DSTAMP -DREVB -DREVX
-DXFIRE -DCPUARM -MD -MP -MF skyRobj/core_cm3.o.d -I . -I./sky/joy/inc core_cm3
.c -o skyRobj/core_cm3.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [skyRobj/core_cm3.o] Error 2

D:\ErSky9X\mbtx-master\radio\ersky9x\src>

Thanks in anticipation.

ReSt
Posts: 1477
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: Compiling ersky9x r220 in Windows

Post by ReSt » Sun Nov 26, 2017 2:59 pm

I don't know if that has anything to do with your problem, but, do you have an empty directory "skyobj" in your source directory?

I know that I had problems to compile when that (empty) directory was missing

Also a missing file "stamp-ersky9x.h" made me problems. I always copy it from the previous release level into the source directory.

Reinhard

User avatar
MikeB
9x Developer
Posts: 15811
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Compiling ersky9x r220 in Windows

Post by MikeB » Sun Nov 26, 2017 7:23 pm

I'm not sure what the problem is.
As a test I just downloaded a .zip file from Github, unzipped into a clean directory and did a build using:
make REVB=1 REVX=1 STAMP=1
I did get:

grep: stamp-ersky9x.h: No such file or directory
/usr/bin/cat: prov.txt: No such file or directory
/usr/bin/cat: .svn/entries: No such file or directory

but then the compile and link ran with no problems (Windows 10).

The main difference I can see is you have:
process_begin: CreateProcess(. . .
after the compile command that I don't see, I just get the compile going ahead. I don't know if this is XP doing something different.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

ksmeaton
Posts: 4
Joined: Fri May 20, 2016 12:01 pm
Country: Australia

Re: Compiling ersky9x r220 in Windows

Post by ksmeaton » Mon Nov 27, 2017 1:31 pm

Thank you Reinhard and Mike for your responses.

I have taken your suggestions on board, Mike, that perhaps XP is my problem. I have completely re-downloaded WinAVR, er9x r220 (zip), and also your wbuild.zip bunch of goodies. I reloaded all of these programs/sources etc., into completely new folders. I copied your goodies into the WinAVR\utils\bin folder. I open a CMD window and based it on the new ersky9x\src folder. I modified the PATH contents so that only WinAVR\bin and WinAVR\utils\bin were available to this window. I then reran the make clean and the make REVB....... and got the same result as in my first post.

I am Secretary/Treasurer of my flying club and have access to their Win10 laptop. I repeated the exercise above on the Win10 platform and got almost the same result. Below is the output of the clean and compile attempt from the Win10 platform.

I have been a programmer/systems programmer (an old term) since 1962 but Linux and make files have never been a big part of my world so I am stumped with this one. I know that you downloaded fresh ersky9x source files and were able to successfully compile, but I guess that your Win10 platform has been part of your development tool set for some time and maybe your path setup is allowing your run to fill some gaps.

Really lost with this.

C:\KevinSmeaton\ersky9x\mbtx-master\radio\ersky9x\src>make clean
rm -f x9dobj/*.*
rm -f x9eobj/*.*
rm -f x9dpobj/*.*
rm -f x12dobj/*.*
rm -f skyobj/*.*
rm -f skyRobj/*.*
rm -f skySobj/*.*
rm -f skyLobj/*.*
rm -f sky9XTobj/*.*
rm -f x7obj/*.*
rm -f ersky9x_rom.elf
rm -f ersky9x_rom.map
rm -f ersky9x_rom.hex
rm -f core_cm3.c.bak board_lowlevel.c.bak crt.c.bak vectors_sam3s.c.bak port.c.bak coos.c.bak sky/joy/HIDDJoystickDriver.c.bak sky/joy/HIDDFunction.c.bak sky/joy/USBDDriver.c.bak sky/joy/USBD.c.bak sky/joy/USBRequests.c.bak sky/joy/USBDescriptors.c.bak sky/joy/USBDDriverCallbacks.c.bak sky/joy/USBDCallbacks.c.bak sky/joy/HIDIdleRequest.c.bak sky/joy/HIDReportRequest.c.bak sky/joy/HIDDTransferDriver.c.bak sky/joy/USBD_HAL.c.bak sky/joy/pmc.c.bak sky/joy/device_descriptor.c.bak
rm -f core_cm3.lst board_lowlevel.lst crt.lst vectors_sam3s.lst port.lst coos.lst sky/joy/HIDDJoystickDriver.lst sky/joy/HIDDFunction.lst sky/joy/USBDDriver.lst sky/joy/USBD.lst sky/joy/USBRequests.lst sky/joy/USBDescriptors.lst sky/joy/USBDDriverCallbacks.lst sky/joy/USBDCallbacks.lst sky/joy/HIDIdleRequest.lst sky/joy/HIDReportRequest.lst sky/joy/HIDDTransferDriver.lst sky/joy/USBD_HAL.lst sky/joy/pmc.lst sky/joy/device_descriptor.lst
rm -f core_cm3.lss board_lowlevel.lss crt.lss vectors_sam3s.lss port.lss coos.lss sky/joy/HIDDJoystickDriver.lss sky/joy/HIDDFunction.lss sky/joy/USBDDriver.lss sky/joy/USBD.lss sky/joy/USBRequests.lss sky/joy/USBDescriptors.lss sky/joy/USBDDriverCallbacks.lss sky/joy/USBDCallbacks.lss sky/joy/HIDIdleRequest.lss sky/joy/HIDReportRequest.lss sky/joy/HIDDTransferDriver.lss sky/joy/USBD_HAL.lss sky/joy/pmc.lss sky/joy/device_descriptor.lss
rm -f
rm -f
rm -fR .dep

C:\KevinSmeaton\ersky9x\mbtx-master\radio\ersky9x\src>make REVB=1 REVX=1 STAMP=1
/usr/bin/cat: prov.txt: No such file or directory
/usr/bin/cat: .svn/entries: No such file or directory

Generate Version-stamp:
arm-none-eabi-gcc -c -mcpu=cortex-m3 -Os -gdwarf-2 -mthumb -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Dat91sam3s8 -DRUN_FROM_FLASH=1 -DBASIC -DPCBSKY -DUSB_JOYSTICK -DSTAMP -DREVB -DREVX -DXFIRE -DCPUARM -MD -MP -MF skyRobj/core_cm3.o.d -I . -I./sky/joy/inc core_cm3.c -o skyRobj/core_cm3.o
process_begin: CreateProcess(NULL, arm-none-eabi-gcc -c -mcpu=cortex-m3 -Os -gdwarf-2 -mthumb -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Dat91sam3s8 -DRUN_FROM_FLASH=1 -DBASIC -DPCBSKY -DUSB_JOYSTICK -DSTAMP -DREVB -DREVX -DXFIRE -DCPUARM -MD -MP -MF skyRobj/core_cm3.o.d -I . -I./sky/joy/inc core_cm3.c -o skyRobj/core_cm3.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [skyRobj/core_cm3.o] Error 2

C:\KevinSmeaton\ersky9x\mbtx-master\radio\ersky9x\src>

Thanks for your time.

User avatar
MikeB
9x Developer
Posts: 15811
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Compiling ersky9x r220 in Windows

Post by MikeB » Mon Nov 27, 2017 3:31 pm

er9x, that uses WINAVR to compile, runs on the original 9X radio with an AVR processor (64/128/2561).
ersky9x, that runs on the 'PRO (and the Taranis etc.) is for ARM processors, so you need an ARM compiler installed to do the build.
I use a YAGARTO build, you can find it here: https://sourceforge.net/projects/yagarto/.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!


ReSt
Posts: 1477
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: Compiling ersky9x r220 in Windows

Post by ReSt » Mon Nov 27, 2017 4:12 pm

Kevin, I rechecked my system (XP SP3) and tried a github clone donwload from 30.Oct.2017 without any modifications. Only difference is that I use a batch file to start the compile. And my path statements are really long and include a lot of directories (from Python over Ruby, Yagarto and others)

It compiles without any problem with your parameters

So it is not a question of the OS

Reinhard

ksmeaton
Posts: 4
Joined: Fri May 20, 2016 12:01 pm
Country: Australia

Re: Compiling ersky9x r220 in Windows

Post by ksmeaton » Tue Nov 28, 2017 2:19 am

Thank you very much Mike and Reinhard.

What a difference the correct compiler makes. Good compile now - all sweet.

In all my reading of the forums and the Web in general, first in trying to find out how to compile ersky9x and then to try and sort out my problem, I have not found or not registered to the fact that a different compiler was required for er9x vs ersky9x builds. Learn something new every day.

Thanks again Guys and to all involved in bringing this magic radio system/systems to us.

User avatar
MikeB
9x Developer
Posts: 15811
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Compiling ersky9x r220 in Windows

Post by MikeB » Tue Nov 28, 2017 10:06 am

Have you any particular reason for wanting to compile ersky9x yourself, rather that use the published built versions?
Note that if you downloaded the source from Github, and fetched the latest (not specifying r220 specifically), then you will have sources for a more recent test version for r221.
I need to change the revision numbering generation for the stamp file. I'm still using a file called "entries" in a .svn directory, which is left from when the sources were on googlecode, together with a "prov.txt" file to keep track of test versions. Neither of these files are on Github.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

ksmeaton
Posts: 4
Joined: Fri May 20, 2016 12:01 pm
Country: Australia

Re: Compiling ersky9x r220 in Windows

Post by ksmeaton » Tue Nov 28, 2017 4:32 pm

Thanks again for your help Mike and prompt response.

I have been building a variety of SBUS to PWM interface modules based on Arduino Minis. With the current cost of chips into Australia from China these things cost me $2 to $3 OZ. I now want to learn more about the PXX protocol and to build interfaces to it. S.Port is another protocol that I want to look at and perhaps use it as a back channel for some ideas I have. I sorted the SBUS from info available on the Web but have had less luck with PXX and S.Port. I know that ersky9x supports these and am looking to the build as a source of information.
Most of my recent programming is for wireless communications and is in assembler on PIC's, Arduino's and Pi's. If I am not pushed for CPU cycles or memory space I use C.
Is there any document that tells me what the REVB, REVX, STAMP, DEBUG etc., software switches do please.
We have 1 Ashes Test in the bag - can we get any more??
Kevin

User avatar
MikeB
9x Developer
Posts: 15811
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Compiling ersky9x r220 in Windows

Post by MikeB » Tue Nov 28, 2017 11:02 pm

I haven't documented the build options for make.
For "SKY" type boards (SKY/9XR-PRO/AR9X/ARUNI) always have REVB=1. There was a prototype SKY board that was REVA. When I get time, I'll remove the need for REVB since I'm the only one who has a REVA board.
REVX=1 is for the 9XR-PRO.
STAMP=1 is no longer needed.
DEBUG=1 includes a debug task that uses the COM2 port at 115200 baud. It allows you to use a terminal program to run test code and inspect the memory.
There are some other options for making firmware for other hardware, like PCB=X9D for the Taranis.

You might like to have a look at my Github repositories at https://github.com/MikeBland. There are several projects there relating to SBUS and SPort.
PXX is only used by the FrSky XJT module. I can't publish details as the documentation I have is under a NDA from FrSky.
Unless you wish to build something that uses a XJT, you might look at the Multi protocol. This is very like SBUS, and is documented by comments in the source code.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

CatRovacer
Posts: 25
Joined: Tue Nov 14, 2017 11:53 am
Country: Russian Federation

Re: Compiling ersky9x r220 in Windows

Post by CatRovacer » Sun Apr 08, 2018 7:29 pm

How to compile fw for 9XR pro and QX7 with mostly reduced features? (for reduce flash & RAM footprint)
i.e. i want reject:
SD card, logs, voice, haptic, GV, only EN lang, Lua, heli
Which def's need add in make when launch?
good food & warm summer

User avatar
MikeB
9x Developer
Posts: 15811
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Compiling ersky9x r220 in Windows

Post by MikeB » Sun Apr 08, 2018 9:02 pm

I don't have any conditional compilation in to remove those sorts of things.
Why do you want to reduce the flash and RAM footprints? Both radios have plenty of both spare.

Mike
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
MikeB
9x Developer
Posts: 15811
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Compiling ersky9x r220 in Windows

Post by MikeB » Mon Apr 09, 2018 11:28 am

There is a "SMALL" conditional compile option, which is used for the original SKY board build as this has "only" 256K of flash. This removes some of the languages, so you should be able to see what to change to remove all but one.
You could try removing, say, audio.cpp, from the list of source files in "makefile", then build the firmware and see all the references that then fail. You would then need to go through all the source files that have these references and remove them in some way, possibly by surrounding them with a #ifndef EXTRA_SMALL and #endif.

The build command for the "small" version is:
make REVB=1 SMALL=1
The build options for the SKY version are in the makefile, starting around line 636:

Code: Select all

else

# List C source files here
SRC  = core_cm3.c \
       board_lowlevel.c \
       crt.c \
       vectors_sam3s.c \
       port.c \
       coos.c

ifeq ($(LUA), 1)
SRC += LUA/lapi.c LUA/lcode.c LUA/lctype.c LUA/ldebug.c LUA/ldo.c LUA/ldump.c LUA/lfunc.c LUA/lgc.c LUA/llex.c LUA/lmem.c \
           LUA/lobject.c LUA/lopcodes.c LUA/lparser.c LUA/lstate.c LUA/lstring.c LUA/ltable.c LUA/lrotable.c LUA/ltm.c LUA/lundump.c LUA/lvm.c LUA/lzio.c \
           LUA/lbaselib.c LUA/linit.c LUA/lmathlib.c LUA/lbitlib.c LUA/loadlib.c LUA/lauxlib.c LUA/ltablib.c LUA/lcorolib.c LUA/liolib.c \
           syscalls.c
endif


#       sky/usb/udi_hid.c \

#       sky/usb/USBEndpointDescriptor.c sky/usb/USBGenericRequest.c \
#       sky/usb/USBD_UDP.c sky/usb/USBDDriver.c sky/usb/USBDCallbacks.c \
#       sky/usb/USBFeatureRequest.c sky/usb/USBInterfaceRequest.c sky/usb/USBGetDescriptorRequest.c \
#       sky/usb/USBSetAddressRequest.c sky/usb/USBSetConfigurationRequest.c \
#       sky/usb/USBConfigurationDescriptor.c sky/usb/USBGenericDescriptor.c \
#       sky/usb/hidJoystick.c \
#       sky/usb/HIDDMouseDriver.c \
#       sky/usb/hid_device_descriptor.c \


CPPSRC = stamp.cpp \
         drivers.cpp \
         sdcard_driver.cpp \
         ff.cpp \
         sky/sound.cpp \
         sky/diskio.cpp \
         sky/power.cpp \
         lcd.cpp \
         file.cpp \
         templates.cpp \
         pers.cpp \
         menus.cpp \
         mixer.cpp \
         frsky.cpp \
         audio.cpp \
         ersky9x.cpp \
         timers.cpp \
         logicio.cpp \
         pulses.cpp \
         sky/pulses_driver.cpp \
			en.cpp \
			de.cpp \
			fr.cpp \
			loadboot.cpp \
			maintenance.cpp \
			mavlink.cpp \
			sbus.cpp \
			logs.cpp

ifeq ($(LUA), 1)
CPPSRC += LUA/api_lcd.cpp LUA/interface.cpp LUA/lua_api.cpp
endif
ifeq ($(BASIC), 1)
	  CPPSRC += basic/parser.cpp
endif

	 ifeq ($(SMALL), 1)
	 else
CPPSRC += no.cpp se.cpp it.cpp pl.cpp vi.cpp sp.cpp
	 endif
Mike
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

CatRovacer
Posts: 25
Joined: Tue Nov 14, 2017 11:53 am
Country: Russian Federation

Re: Compiling ersky9x r220 in Windows

Post by CatRovacer » Mon Apr 09, 2018 9:07 pm

Thanks Mike
I compiled, work good on 9XR Pro, But there are still a lot of non-exclusive functions. will revise makefile and src's
good food & warm summer

Post Reply

Return to “ersky9xr”