Page 1 of 1

Setting up a development environment in Linux

Posted: Sun Aug 08, 2021 6:03 pm
by oh1fss
Here is information to new developers on how to set up a development environment in Linux.

Install lubuntu 21.04

Download MCUXpresso IDE from NXP and install it.

Code: Select all

cd Downloads/
chmod 744 mcuxpressoide-11.4.0_6224.x86_64.deb.bin
sudo sh ./mcuxpressoide-11.4.0_6224.x86_64.deb.bin
Run the IDE from Lubuntu menu: Programming > mcuxpressoide 11.4.0_6224 IDE
From the IDE, choose "Download and Install SDKs"
Choose processors, filter MK22FN512, choose Install
Close IDE

Download OpenGD77 sources and buildtools. Build the .bin file:

Code: Select all

$ . /usr/local/mcuxpressoide/
$ mkdir -p OpenGD77/R2021071101
$ cd OpenGD77/R2021071101/
$ unzip /home/Big/Downloads/R2021071101/
$ unzip /home/Big/Downloads/R2021071101/
$ cd OpenGD77/
$ sudo apt-get install dos2unix
$ dos2unix prepare
$ ./prepare
$ dos2unix firmware/tools/codec_cleaner
$ cd firmware
$ mkdir build
$ cd build
$ make -f ../Makefile RADIO=RD5R
Set up firmware uploader:

Code: Select all

$ mkdir ~/OpenGD77/tmp
$ cd ~/OpenGD77/tmp
$ unzip /home/Big/Downloads/R2021052901/2021-01-26_GD-77_CPS_\& 'Firmware software V4.3.6/GD-77_V4.3.6.sgl'
$ unzip /home/Big/Downloads/R2021071101/
$ chmod +x
$ dos2unix
# to fix ModuleNotFoundError: No module named 'usb'
$ sudo apt-get install python3-usb
# to fix usb.core.USBError: [Errno 13] Access denied (insufficient permissions)
# Download from forums
$ unzip ~/Downloads/
$ sudo cp -p 99-gd77.rules /etc/udev/rules.d/
$ sudo udevadm control --reload-rules
Upload the new firmware to radio:

Code: Select all

$ ./ -f ~/OpenGD77/R2021071101/OpenGD77/firmware/build/bin/OpenDM5R.bin -s Firmware\ software\ V4.3.6/GD-77_V4.3.6.sgl -m RD-5R
 - Now flashing your RD-5R with "/home/jj/OpenGD77/R2021071101/OpenGD77/firmware/build/bin/OpenDM5R.bin"
 - Patching the official firmware
 - Firmware file is unencrypted binary
 - Sending Download command
 - Sending ACK
 - Sending encryption key
 - Sending F-PROG command
 - Sending radio modem number
 - Sending radio modem number 2
 - Sending version
 - Sending erase command
 - Send post erase command
 - Sending Program command
 - Sending last block                   
Firmware update complete. Please reboot the RD-5R.