- Сообщения
- 353
- Реакции
- 2,513
- Баллы
- 483
- Ваше "умное" устройство
- Amazfit Bip
Application develop for BipOS
Software Development Kit (SDK)
for MNVolkov BipOS
Software Development Kit (SDK)
for MNVolkov BipOS
Intro
From version MNVolkov BipOS 0.5 the startup code of the applications is completely redisigned. Each application now is a separate file stored in resources. The executable file format is Arm-elf (or simply"elf"). The mod got a new name BipOS. When the MOD starts, resources are scanned for applications. Each firmware has a different amount of resources, and applications are always placed at the end. Therefore, the loader looks for resources by Elf signature starting with resource 930. Found applications are placed in the menu "Applications".
In order to improve overall convenience and reduce the number of incompatibilities designed firmware independent applications. So one and the same Calculator will work both on Latin 1.1.5.12 and not latin 1.1.2.05 with no changes (you only need to place it in the RES file of the corresponding version). Independence from the firmware managed through using of a universal library libbip.a which contains the addresses of the firmware functions. After loading the elf into RAM, the internal addresses of functions and variables are relocated, and library addresses of functions are changed to real addresses of functions in firmware.
Development environment
To develop applications, you will need a development environment and a compiler. As a development environment I use Notepad++ . Probably, you can configure Code:: Blocks or other IDE I did not get to this, postponed for the future. Installing a specialized IDE will certainly increase the usability of development. I will not dwell on the development environment.
Compiler
I use the GNU Embedded Toolchain for Arm to build the application. The following steps are required for installation:
- Download toolchain here:
Download the file gcc-arm-none-eabi-8-2019-q3-update-win32-sha2.exe ( or a more recent edition) with the following description: Windows 32-bit Installer (Signed for Windows 7 and later) - You can set everything by default, at the end of the installation, set all the checkboxes
- It is recommend that you add to system PATH variable the path to the compiler bin folder
The library includes both addresses of firmware functions and some functions that are written to facilitate the development of user applications, such as menu functions. The library must be unzipped to a folder at the same level as the application folders. The path to this folder will be specified in the build script.
У вас нет разрешения на просмотр содержимого!
Sample application
Specifically to facilitate the entry of prepared a sample application in C template_app. The functionality is simple: a working screen of the application is created, when you click in the center of the screen, the background color and labels are change.
You can use this example as a template. To do this, create a new application folder and copy the sample files to it. The name of the application folder in the build script is taken as the service name of the application.
The name displayed in the list of applications must be entered in the label.txt in this case after the name should not be any characters or line feed.
To build the application use .bat file. The build is starting by running the .bat file inside the folder without parameters. All compiler and linker parameters compatible with the BipOS loader are included in this script.
Sample application (with RU comments)
У вас нет разрешения на просмотр содержимого!
Sample application (with EN comments - thanx @Bugmenot1 )
У вас нет разрешения на просмотр содержимого!
Sources on GitHub
Description of App lifecycle
Translate from Russian by @CennoxX - Инструкция - Bip | Application develop for BipOS ( SDK ) EN
Build RES file and load into clock
To run the elf you need to load it in device. To do this, you need to put it in a RES file. To build RES files was developed a special program for PC (Win32) with which you can add to your existing RES file required applications. ResPack.exe is a console application to perform simple operations RES files Amazfit Bip: display content with brief information for each resource, unpacking raw data of resources, making alignment string resources version 61 and 69 to solve the disappearance of text when loading a custom resource and add any files to the resources.
To add application files to an existing RES file run from the command line:
Code:
Код:
ResPack -a <resulting_RES> <source_RES> <files which should be added>
У вас нет разрешения на просмотр содержимого!
Although the use of the BipOS loader significantly reduces "breaking" of your watch, you should still be careful. Consider the algorithms of your app, avoid infinite loops, avoid the writing in the memory area not specifically intended for use by your application, etc. Whatever you do, you do so at your own risk, no responsibility for the consequences of your actions is not responsible. This instruction is informational in nature, before performing any action you should be aware of all that you are going to do and what the consequences will come, take these likely consequences.
The development process is discussed in this topic.
Последнее редактирование: