In the modem section, MTK provides the complete source code only to major smartphone companies like Xiaomi, OPPO, Vivo, and significant design firms such as Huawei Communications, Longqi Technology, and Wentai Technology, as well as module manufacturers like Quectel, Broadlink, Meg, and Ruihai.
Smaller manufacturers receive binary libraries and partially customized parameter source code.
As for the recommended compilation environment, the magnet link provided contains the file “TK_MD_BASIC_MOLY.LR12A.R2.MP.V143.7.tar.zst.”
Recommended compilation environment
Recommended Build Environment
*******************************************
* [OS] : Linux
* [PERL] : v5.14.2 or v5.18.4 / v5.26.1
* [MAKE] : GNU Make v3.81 / v4.1
* [SHELL] : GNU bash v4.2.25 or v4.3.11
* [COMPILER] : v4.9.2 or above
* [Host GCC] : gcc version 4.8.4
* [Perl Module]: Switch.pm, File/Copy/Recursive.pm, XML/Simple.pm
Actual compilation environment
Debian Buster
[PERL] : v5.28.1
[MAKE] : GUN Make v4.2.1
[COMPILER] : v4.9.2(2016.05-08) [OK]
[HOST GCC] : v8.3.0
apt install build-essential
apt install libswitch-perl libfile-copy-recursive-perl libxml-simple-perl
https://codescape.mips.com/components/toolchain/2016.05-08/Codescape.GNU.Tools.Package.2016.05-08.for.MIPS.MTI.Bare.Metal.CentOS-5.x86_64.tar.gz
( MTI Bare Metal Toolchain MIPS32R2-MIPS32R5, MIPS64R2-MIPS64R5 and microMIPS)
Compile hardware configuration 16G RAM, 100G Storage
mkdir ~/modem
cd ~/modem
tar xvaf ~/Downloads/TK_MD_BASIC_MOLY.LR12A.R2.MP.V143.7.tar.zst
cd mcu/common/tools
mkdir -p GCC/MIPS/4.9.2
cd GCC/MIPS/ 4.9.2
tar xvaf ~/Downloads/Codescape.GNU.Tools.Package.2016.05-08.for.MIPS.MTI.Bare.Metal.CentOS-5.x86_64.tar.gz
cd mips-mti-elf
mv 2016.05-08 / ../linux
cd ~/modem/
cd mcu
common/tools/GCC/MIPS/4.9.2/linux/bin/mips-mti-elf-gcc -v
The version of MIPS gcc should be 2016.05-08
cd ~/modem
cd mcu
ls -a make/projects
you can see
'TK_MD_BASIC(LWCTG_R2_6763).mak' 'TK_MD_BASIC(LWTG_R2_6763).mak'
Start compiling
./m "TK_MD_BASIC(LWTG_R2_6763).mak" new
Before compilation, modifications can be made to the contents of the custom directory at mcu/pcore/custom.
The compiled results will be located in the mcu/build/TK_MD_BASIC/LWTG_R2_6763/bin directory.
The files generated include:
- TK_MD_BASIC_MDBIN_PCB01_MT6763_S00.MOLY_LR12A_R2_MP_V143_7.bin (md1bin.img, also known as md1rom)
- DbgInfo_LR12A.R2.MP_TK_MD_BASIC_MOLY_LR12A_R2_MP_V143_7_2024_02_15_09_49
– md_all_in_one/single_bin_modem.bin
To execute the modemRenameCopy.pl script, which is a crucial step, ensure not to overlook it. This script collects all the files that need to be copied to the AP side into the temp_modem folder (located in the modem codebase root directory) and generates an Android.mk file.
To pack the modem image, execute the following command in the Android source code directory device/mediatek/build/build/tools:
./modemRenameCopy.pl ~/mtk/modem/mcu “TK_MD_BASIC(LWCTG_R2_6763).mak”
After executing the command, new modem image files will be generated in the modem code directory modem/mcu/temp_modem.
Finally, modify md1bin.img to md1img.img and place it together with md1dsp.img into the version directory for flashing purposes.