Skip to content

Commit

Permalink
Added readme
Browse files Browse the repository at this point in the history
  • Loading branch information
XimikBoda committed Sep 10, 2024
1 parent 6575834 commit 76117c9
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ project ("Demo")
set(APP_NAME "Demo")
set(DEVELOPER_NAME "YouName")
set(RAM "500" CACHE STRING "Ram requirement (in kb)")
set(IMSI "1234567890" CACHE STRING "Imsi of first SIM-card")
option(BACKGROUND "App can work background" OFF)

set(MRE_SDK "$ENV{MRE_SDK}" CACHE STRING "MRE SDK dir")
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 XimikBoda

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Template for build MRE .vxp app by cmake

## What are the CMake projects in this repo about?

|Folder|Description|Type|
|-|-|-|
|cmake|Place for cmake toolchain|Toolchain|
|mreapi|A single point for the entire MRE API|Static liblary|
|main|Main code for app|Static liblary|
|resourses|A resourses pack target (there you can add own resourses)|Resourses (.res)|
|core|The application is linked here|Executable (for phone) or library (for MoDis)|
|vxp|The application is packed to vxp here|vxp|
|run/run_in_MoDis|Target for auto copy .vc.vxp to MoDis and run it (only Windows)|bat|

## Requirements to build

- cmake
- make
- gcc-arm-none-eabi
- MRE SDK (for includes, libs and MoDis) (you can find it [there](https://github.com/raspiduino/mre-sdk))
- [TinyMRESDK](https://github.com/XimikBoda/TinyMRESDK) (For resourse pack and app pack)

## How to build?
### For phone

```
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-arm-none-eabi.cmake -DMRE_SDK=path/to/mre/sdk -DTinyMRESDK=path/to/tiny/mre/sdk -G "MinGW Makefiles" ..
make
```

If it can`t find right gcc, add ```-DTOOLCHAIN_PREFIX=path/to/gcc/arm/none/eabi``` to cmake

### For MoDis simulator (only on Windows)

```
mkdir vs
cd vs
cmake -DMRE_SDK=path/to/mre/sdk -DTinyMRESDK=path/to/tiny/mre/sdk -G "Visual Studio 17 2022" -A Win32 ..
Demo.sln
```

Also you can use cmake gui for config (Don`t forget to set MRE_SDK and TinyMRESDK variables)

## How to run

**Note** You can't run `.vxp` on MoDis and `.vc.vxp` on phone.
### On phone

**Note**: If you use Nokia phone, you need to add your IMSI (```-DIMSI="91234567890"```) with 9 at begin (because of mre api bug)

Just copy `build/vxp/vxp.vxp` to sd-card

### On MoDis simulator (only on Windows)

You can use `run_in_MoDis` target (right click and `Set as Startup Project`), but if you want to debug it, manualy change *Command* (in project properties) to MoDis.exe.

Or you can manualy copy `vs/vxp/vxp.vc.vxp` to MoDis.
Binary file added extra/On_MREmu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extra/On_MoDis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extra/On_Nokia_220.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resourses/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND "${TinyMRESDK}/bin/PackRes.exe"
COMMAND "${TinyMRESDK}/bin/PackRes"
-o "$<TARGET_FILE:${PROJECT_NAME}>"
-f ${RESOURSES_FILES}
--empty-logo
Expand Down
3 changes: 2 additions & 1 deletion vxp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ else()
endif()

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND "${TinyMRESDK}/bin/PackApp.exe"
COMMAND "${TinyMRESDK}/bin/PackApp"
-a "$<TARGET_FILE:core>"
-r "$<TARGET_FILE:resourses>"
-o "$<TARGET_FILE:${PROJECT_NAME}>"
-tr "${RAM}"
-tn "${APP_NAME}"
-tdn "${DEVELOPER_NAME}"
-tb "${TB}"
-ti "${IMSI}"
)

0 comments on commit 76117c9

Please sign in to comment.