Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do you still have ADS 1.2 compiler somewhere #4

Open
veso266 opened this issue Aug 10, 2022 · 13 comments
Open

Do you still have ADS 1.2 compiler somewhere #4

veso266 opened this issue Aug 10, 2022 · 13 comments

Comments

@veso266
Copy link

veso266 commented Aug 10, 2022

Hello there, someone had given me Nokia 215 (not 4G KaiOS version) to play around

and I decided to try to write an app for it
So after searched online I found your post on SO: https://stackoverflow.com/a/72823567/19734667

So I was wondering if you still have this Arms ADS compiler somewhere and if you could share it

Another question: did you ever figure out how to sign an app using RSA key instead of IMSI patch, since I sadly dont have a mini sim card at hand to put into, this is probably my only hope on running something on this phone

Thanks for Anwsering and Best Regards

@raspiduino
Copy link
Owner

not 4G KaiOS version

Good :)))

So I was wondering if you still have this Arms ADS compiler somewhere and if you could share it

Yes, but read this carefully before you choose that:
If you just want to developing on Nokia, you can use GCC. It's free, open source, secure, and generating the much smaller binary than ARM ADS does, support standard C better, and it's much easier to search for error codes online.

The ARM ADS is not free. You can download it easily from ARM, here, but you will need a license from ARM (I don't know how much, but maybe they stop selling license for this). If you don't want to pay, you can cr@ck it easily :)), but that is illegal.

TL;DR: Use GCC if you just want to dev. Use ARM ADS if you really know what you are doing.

What is your choice?

Thanks!

@raspiduino
Copy link
Owner

Did you ever figure out how to sign an app using RSA key instead of IMSI patch

No, but I will ask XimikBoda

@XimikBoda
Copy link
Contributor

XimikBoda commented Aug 10, 2022

Did you ever figure out how to sign an app using RSA key instead of IMSI patch

It's probably not possible right now, the certificate check is done too well
The only way to find out the private key is to find an information leak somewhere, but given the low popularity of the platform, this is unlikely.
Another option is to try to flash a new public key into the firmware (but I don’t know if there is an integrity check there) (and if the key is in a compressed memory area, this also complicates the task)

It will probably be easier to find a SIM card, a blocked one will do, the main thing is that the phone recognizes its presence and reads the IMSI

@raspiduino
Copy link
Owner

a blocked one will do

If you arrive in Vietnam, I will give you one, for free :))

@veso266
Copy link
Author

veso266 commented Aug 11, 2022

Hi there, I managed to find a SIM Card, and also a working ADS1.2 (since SDK documentation mentions to use ADS, not even sure how to swich to gcc (since there is no option for that in options)
slika

then when I hit make it doesn't want to make due to some file that should be created automaticly missing
BSCMAKE: error BK1506 : cannot open file '.\Debug\HelloWorld.sbr': No such file or directory

then after turning this browse information off according to this: https://stackoverflow.com/questions/109281/bscmake-error-bk1506-cannot-open-file-stdafx-sbr-no-such-file-or-directory

like this
BrowseInformation="0"

in HelloWorld.vcproj

then errors became even more cryptic
The system cannot find the path specified. (what path,.....)

so how did you setup your dev enviroment
I just installed VS2008 Professional, then installed ADS1.2 and MRE_SDK found on some github issue

then configured VC directories according to this: https://github.com/UstadMobile/ustadmobile-mre
I left ADS1.2 on default options
slika

ARM Processor: 
Compiler Options:--o1 -g- -apcs /ropi/rwpi -cpu ARM7EJ-S 
Linker options: -info totals -rwpi -ropi -nodebug 

then I created a default VS project using
slika

like Getting Started With MRE.pdf suggested (not sure what to pick for my Nokia 215 😄

so how did you setup your IDE (I am using Windows 11, maybe this is causing problems not sure)

@raspiduino
Copy link
Owner

raspiduino commented Aug 12, 2022

not even sure how to swich to gcc (since there is no option for that in options)

Basically you can use any arm-none-eabi-*, go and download a compiler. For example, I use Sourcery CodeBench Lite for ARM EABI, but any compiler can be applied.

After download and setup a GCC compiler, it's now time to config.

In your MRE SDK V3.0.00\tools directory, open the file sys.ini in an editor:
image

Find the line GCCPath= (usually line 63), and change it to the registry key of the compiler you installed. For example:

GCCPath="SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Sourcery CodeBench Lite for ARM EABI"

You need to find the "uninstall key" of the compiler (Google for this).

Open the MRE SDK 3.0 app (MRE launcher or something like that), and there will be a config button:
image

A small window will appear, and you can choose GCC. I often tick the "Thumb command" button, not sure if it still works if you don't use it.

Good luck!

@raspiduino
Copy link
Owner

how did you setup your IDE

Good news: you don't need to use VS 2008 (the thing that costs you money) anymore! You can use (maybe) any version of Visual Studio you like, but requires a workaround.

Will update on this later

@XimikBoda
Copy link
Contributor

XimikBoda commented Aug 12, 2022

About VS 2008, you can use VS 2008 express, it is free

@yeppiidev
Copy link

ive experienced the same problem while building but got it fixed with the use of GCC instead of ARM's compiler

@yeppiidev
Copy link

About VS 2008, you can use VS 2008 express, it is free

I think you can use ANY IDE and use the MreLauncher tool to compile your app. I've noticed that the tool relies on an assembly that's found with VS 2008 which it uses to open .vcproj files. Probably should work if you have VS 2008 express installed.

@raspiduino
Copy link
Owner

I use VS2022 with MRE SDK, but I have to create a custom script for building the app

@yeppiidev
Copy link

Can you share some details on how you would do that?

@raspiduino
Copy link
Owner

raspiduino commented Mar 16, 2023

Here is a video of me building a MRE project from scratch using VS2022 and then run it in MODIS (MRE simulator)

Generally, you can generate and open MRE projects without even installing VS2008. So just do that.

For building MRE app for real phones

Copy this script to a new file named BuildApp.bat in the project's directory, then edit it according to your project:

@echo off
echo Building uARMRE
echo Precheck the Resource 
"C:\Program Files (x86)\MRE SDK V3.0.00\tools\ResEditor\CmdShell.exe" save  "D:\Data\dev\uARMRE\uARMRE.vcproj"
if not exist arm mkdir arm
if %errorlevel% NEQ 0 goto exit
echo     CC    gccmain.c
"D:\Data\dev\Sourcery_CodeBench_Lite_for_ARM_EABI\bin\arm-none-eabi-gcc" -static -c -fpic -mcpu=arm7tdmi-s -fvisibility=hidden -mthumb -mlittle-endian -Ofast -D__MRE_COMPILER_GCC__ -fno-exceptions -fno-non-call-exceptions -o "D:\Data\dev\uARMRE\arm\gccmain.o" -c "C:\Program Files (x86)\MRE SDK V3.0.00\lib\MRE30\src\gccmain.c"      -D _MINIGUI_LIB_ -D _USE_MINIGUIENTRY -D _NOUNIX_ -D _FOR_WNC -D __MRE_SDK__ -D   __MRE_VENUS_NORMAL__  -D  __MMI_MAINLCD_240X320__ -I "C:\Program Files (x86)\MRE SDK V3.0.00\include" -I "C:\Program Files (x86)\MRE SDK V3.0.00\include\service" -I "C:\Program Files (x86)\MRE SDK V3.0.00\include" -I "C:\Program Files (x86)\MRE SDK V3.0.00\include\service" -I "D:\Data\dev\uARMRE\include" -I "D:\Data\dev\uARMRE\include\service" -I "D:\Data\dev\uARMRE\include\component" -I "D:\Data\dev\uARMRE\ResID" -I "D:\Data\dev\uARMRE\src\app\widget" -I "D:\Data\dev\uARMRE\src\app\launcher" -I "D:\Data\dev\uARMRE\src\app\wallpaper" -I "D:\Data\dev\uARMRE\src\app\screen_lock" -I "D:\Data\dev\uARMRE\include\service" -I "D:\Data\dev\uARMRE\include\component" -I "D:\Data\dev\uARMRE\include\service" -I "D:\Data\dev\uARMRE\src\framework" -I "D:\Data\dev\uARMRE\src\framework\ui_core\base" -I "D:\Data\dev\uARMRE\src\framework\ui_core\mvc" -I "D:\Data\dev\uARMRE\src\framework\ui_core\pme" -I "D:\Data\dev\uARMRE\src\framework\mmi_core" -I "D:\Data\dev\uARMRE\src\ui_engine\vrt\interface" -I "D:\Data\dev\uARMRE\src\component" -I "D:\Data\dev\uARMRE\src\ui_engine\framework\xml" -I "D:\Data\dev\uARMRE"
if %errorlevel% NEQ 0 goto exit
echo     CC    callout_RAM.c
"D:\Data\dev\Sourcery_CodeBench_Lite_for_ARM_EABI\bin\arm-none-eabi-gcc" -static -c -fpic -mcpu=arm7tdmi-s -fvisibility=hidden -mthumb -mlittle-endian -Ofast -D__MRE_COMPILER_GCC__ -fno-exceptions -fno-non-call-exceptions -o "D:\Data\dev\uARMRE\arm\callout_RAM.o" -c "d:\Data\dev\uARMRE\callout_RAM.c"      -D _MINIGUI_LIB_ -D _USE_MINIGUIENTRY -D _NOUNIX_ -D _FOR_WNC -D __MRE_SDK__ -D   __MRE_VENUS_NORMAL__  -D  __MMI_MAINLCD_240X320__ -I "C:\Program Files (x86)\MRE SDK V3.0.00\include" -I "C:\Program Files (x86)\MRE SDK V3.0.00\include\service" -I "C:\Program Files (x86)\MRE SDK V3.0.00\include" -I "C:\Program Files (x86)\MRE SDK V3.0.00\include\service" -I "D:\Data\dev\uARMRE\include" -I "D:\Data\dev\uARMRE\include\service" -I "D:\Data\dev\uARMRE\include\component" -I "D:\Data\dev\uARMRE\ResID" -I "D:\Data\dev\uARMRE\src\app\widget" -I "D:\Data\dev\uARMRE\src\app\launcher" -I "D:\Data\dev\uARMRE\src\app\wallpaper" -I "D:\Data\dev\uARMRE\src\app\screen_lock" -I "D:\Data\dev\uARMRE\include\service" -I "D:\Data\dev\uARMRE\include\component" -I "D:\Data\dev\uARMRE\include\service" -I "D:\Data\dev\uARMRE\src\framework" -I "D:\Data\dev\uARMRE\src\framework\ui_core\base" -I "D:\Data\dev\uARMRE\src\framework\ui_core\mvc" -I "D:\Data\dev\uARMRE\src\framework\ui_core\pme" -I "D:\Data\dev\uARMRE\src\framework\mmi_core" -I "D:\Data\dev\uARMRE\src\ui_engine\vrt\interface" -I "D:\Data\dev\uARMRE\src\component" -I "D:\Data\dev\uARMRE\src\ui_engine\framework\xml" -I "D:\Data\dev\uARMRE"
if %errorlevel% NEQ 0 goto exit
echo     CC    T2Input.cpp
"D:\Data\dev\Sourcery_CodeBench_Lite_for_ARM_EABI\bin\arm-none-eabi-g++" -static -c -fpic -mcpu=arm7tdmi-s -fvisibility=hidden -mthumb -mlittle-endian -Ofast -D__MRE_COMPILER_GCC__ -fno-exceptions -fno-non-call-exceptions -fno-rtti -fcheck-new -fno-rtti -fcheck-new -fno-rtti -fcheck-new -o "D:\Data\dev\uARMRE\arm\T2Input.o" -c "d:\Data\dev\uARMRE\T2Input.cpp"      -D _MINIGUI_LIB_ -D _USE_MINIGUIENTRY -D _NOUNIX_ -D _FOR_WNC -D __MRE_SDK__ -D   __MRE_VENUS_NORMAL__  -D  __MMI_MAINLCD_240X320__ -I "C:\Program Files (x86)\MRE SDK V3.0.00\include" -I "C:\Program Files (x86)\MRE SDK V3.0.00\include\service" -I "C:\Program Files (x86)\MRE SDK V3.0.00\include" -I "C:\Program Files (x86)\MRE SDK V3.0.00\include\service" -I "D:\Data\dev\uARMRE\include" -I "D:\Data\dev\uARMRE\include\service" -I "D:\Data\dev\uARMRE\include\component" -I "D:\Data\dev\uARMRE\ResID" -I "D:\Data\dev\uARMRE\src\app\widget" -I "D:\Data\dev\uARMRE\src\app\launcher" -I "D:\Data\dev\uARMRE\src\app\wallpaper" -I "D:\Data\dev\uARMRE\src\app\screen_lock" -I "D:\Data\dev\uARMRE\include\service" -I "D:\Data\dev\uARMRE\include\component" -I "D:\Data\dev\uARMRE\include\service" -I "D:\Data\dev\uARMRE\src\framework" -I "D:\Data\dev\uARMRE\src\framework\ui_core\base" -I "D:\Data\dev\uARMRE\src\framework\ui_core\mvc" -I "D:\Data\dev\uARMRE\src\framework\ui_core\pme" -I "D:\Data\dev\uARMRE\src\framework\mmi_core" -I "D:\Data\dev\uARMRE\src\ui_engine\vrt\interface" -I "D:\Data\dev\uARMRE\src\component" -I "D:\Data\dev\uARMRE\src\ui_engine\framework\xml" -I "D:\Data\dev\uARMRE"
if %errorlevel% NEQ 0 goto exit
echo     LD    uARMRE.axf
"D:\Data\dev\Sourcery_CodeBench_Lite_for_ARM_EABI\bin\arm-none-eabi-gcc" -o "D:\Data\dev\uARMRE\uARMRE.axf"  "D:\Data\dev\uARMRE\arm\gccmain.o"  "D:\Data\dev\uARMRE\arm\callout_RAM.o"  "D:\Data\dev\uARMRE\arm\Console.o"  "D:\Data\dev\uARMRE\arm\Console_io.o"  "D:\Data\dev\uARMRE\arm\cp15.o"  "D:\Data\dev\uARMRE\arm\CPU.o"  "D:\Data\dev\uARMRE\arm\dcache.o"  "D:\Data\dev\uARMRE\arm\fifo.o"  "D:\Data\dev\uARMRE\arm\icache.o"  "D:\Data\dev\uARMRE\arm\main.o"  "D:\Data\dev\uARMRE\arm\math64.o"  "D:\Data\dev\uARMRE\arm\mem.o"  "D:\Data\dev\uARMRE\arm\MMU.o"  "D:\Data\dev\uARMRE\arm\pxa255_DMA.o"  "D:\Data\dev\uARMRE\arm\pxa255_DSP.o"  "D:\Data\dev\uARMRE\arm\pxa255_GPIO.o"  "D:\Data\dev\uARMRE\arm\pxa255_IC.o"  "D:\Data\dev\uARMRE\arm\pxa255_LCD.o"  "D:\Data\dev\uARMRE\arm\pxa255_PwrClk.o"  "D:\Data\dev\uARMRE\arm\pxa255_RTC.o"  "D:\Data\dev\uARMRE\arm\pxa255_TIMR.o"  "D:\Data\dev\uARMRE\arm\pxa255_UART.o"  "D:\Data\dev\uARMRE\arm\RAM.o"  "D:\Data\dev\uARMRE\arm\rt.o"  "D:\Data\dev\uARMRE\arm\SoC.o"  "D:\Data\dev\uARMRE\arm\T2Input.o" -Ofast -static -fpic -pie -T "C:\Program Files (x86)\MRE SDK V3.0.00\lib\MRE30\armgcc_t\scat.ld" -l:"C:\Program Files (x86)\MRE SDK V3.0.00\lib\MRE30\armgcc_t\percommon.a" -l:"C:\Program Files (x86)\MRE SDK V3.0.00\lib\MRE30\armgcc_t\pertcp.a" -l:"C:\Program Files (x86)\MRE SDK V3.0.00\lib\MRE30\armgcc_t\persensor.a" -l:"C:\Program Files (x86)\MRE SDK V3.0.00\lib\MRE30\armgcc_t\persmsper.a" -l:"C:\Program Files (x86)\MRE SDK V3.0.00\lib\MRE30\armgcc_t\perbitstream.a" -l:"C:\Program Files (x86)\MRE SDK V3.0.00\lib\MRE30\armgcc_t\percontact.a" -l:"C:\Program Files (x86)\MRE SDK V3.0.00\lib\MRE30\armgcc_t\permms.a" -l:"C:\Program Files (x86)\MRE SDK V3.0.00\lib\MRE30\armgcc_t\persmsmng.a" -l:"C:\Program Files (x86)\MRE SDK V3.0.00\lib\MRE30\armgcc_t\perfile.a"
if %errorlevel% NEQ 0 goto exit
echo     PACK  uARMRE.pkd
"C:\Program Files (x86)\MRE SDK V3.0.00\tools\ResEditor\CmdShell.exe" pack -silent -resolution 240x320 -o "D:\Data\dev\uARMRE\uARMRE.pkd" -e AXF "D:\Data\dev\uARMRE\uARMRE.vcproj" "D:\Data\dev\uARMRE\uARMRE.axf"
if %errorlevel% NEQ 0 goto exit
echo     GEN   uARMRE.vxp
"C:\Program Files (x86)\MRE SDK V3.0.00\tools\PackDigist.exe" "D:\Data\dev\uARMRE\uARMRE.vcproj" "uARMRE" "0.1.0" "uARMRE contributors" "3072" "NotSupportBg" "Not Support rotate" "uARMRE" "uARMRE" "uARMRE" "1234567890" "content" " TCP Sensor SMS(person) BitStream Contact MMS SMSMng File" "vxp" "GCC" "PKD" "UnCompress" "NoVPI" "Adaptable" "15728960" "UnSysMemAble" "" "-1" "UNPUSH" "-1" ""  "UnAutoStart"  "UnTransferImg" "NoIdleShortcut"  D:\Data\dev\uARMRE\arm D:\Data\dev\uARMRE\build.log

:exit

(Script cut from my BuildApp.bat for uARMRE)

You will need to modify:

  • C:\Program Files (x86)\MRE SDK V3.0.00: Path to MRE SDK. The example I provided is the default path. If it's not where you install your SDK, then change it to your correct SDK path.
  • uARMRE: the project name. You must replace it with your correct project name
  • D:\Data\dev\uARMRE: your project path. Replace it with the path to your project's root folder
  • D:\Data\dev\Sourcery_CodeBench_Lite_for_ARM_EABI\bin\arm-none-eabi-gcc and D:\Data\dev\Sourcery_CodeBench_Lite_for_ARM_EABI\bin\arm-none-eabi-gcc: path to gcc and g++ compiler. Change it according to your compiler installation path.

You should:

  • Mimic the same command line for adding more source files for building
  • Change the permission string " TCP Sensor SMS(person) BitStream Contact MMS SMSMng File" to fit your permission need. It's exactly the same name as shown the permission list in MRE SDK app.
  • Add more .lib file if you need to, to the linking command line, otherwise it won't link. Sometimes you may encounter unexpected .lib name that you need to use. In that case, just open the folder containing .lib files, then try searching for the correct library.

(If I'm not missing anything, then it's all you need to change)

Building for running in MODIS using VS2022

  • Load the project to VS2022 (open the .vcproj file in VS2022)
  • There should be an upgrade prompt, just accept it
  • After accepting, the project will open.
  • Right click on the project, then choose project properties.
  • Goto the Debugging tab
  • Insert the path to your MODIS executable in the Command box. For example, you can write C:\Program Files (x86)\MRE SDK V3.0.00\models\Model03_HVGA_MRE3.0\MoDIS\Release\MoDIS.exe in the box for model 3 simulation. You can choose the model that fits your need.
  • Goto the VC Directories tab.
  • Add include and library path to the end of corresponding boxes. You must add ; between paths. Add the MRE include and lib directories to the box. For example, I add C:\Program Files (x86)\MRE SDK V3.0.00\include to Include paths and C:\Program Files (x86)\MRE SDK V3.0.00\lib\MRE30\armgcc_t to Library paths
  • If you have problems with building VC projects (for me, it was VS2022 not able to find Windows SDK's include and lib path, then add the path to WinSDK's include and lib path to the boxes in the VC Directories tab. For me, I add D:\Windows Kits\10\Include\10.0.22000.0\ucrt\ to the include path and D:\Windows Kits\10\Lib\10.0.22000.0\ucrt\x86\ to the lib path.

REMEMBER: MODIS is an x86 (32-bit) application, so don't link the vxp against x64 libs.

FYI, I am making a script to automatically do these things for you, but since I'm not having a lot of time, the project was abandoned, but I'm always welcome PRs

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants