Setting up a development environment in Linux
Posted: Sun Aug 08, 2021 6:03 pm
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.
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:
Set up firmware uploader:
Upload the new firmware to radio:
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
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/MCUXpressoPath.sh
$ mkdir -p OpenGD77/R2021071101
$ cd OpenGD77/R2021071101/
$ unzip /home/Big/Downloads/R2021071101/OpenGD77_sources.zip
$ unzip /home/Big/Downloads/R2021071101/OpenGD77_buildtools.zip
$ 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
Code: Select all
$ mkdir ~/OpenGD77/tmp
$ cd ~/OpenGD77/tmp
$ unzip /home/Big/Downloads/R2021052901/2021-01-26_GD-77_CPS_\&_Firmware_Changelog_Ham_Version.zip 'Firmware software V4.3.6/GD-77_V4.3.6.sgl'
$ unzip /home/Big/Downloads/R2021071101/OpenGD77_FirmwareLoaders.zip gd-77_firmware_loader.py
$ chmod +x gd-77_firmware_loader.py
$ dos2unix gd-77_firmware_loader.py
# 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 99-gd77.rules.zip from opengd77.com forums
$ unzip ~/Downloads/99-gd77.rules.zip
$ sudo cp -p 99-gd77.rules /etc/udev/rules.d/
$ sudo udevadm control --reload-rules
Code: Select all
$ ./gd-77_firmware_loader.py -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.