📜 ⬆️ ⬇️

Fernly - the operating system for my watch

Begins a new round of race operating systems. Perhaps GNU Linux, Android OS, Windows, OS X are receding into the past, like dinosaurs, giving way to new mammal rodents. This is how these animals look on X-rays.
image
It is noticeable that the nervous system of "rodents" is more complicated than that of "dinosaurs." Tracks are traced to at least 4 areas, 3 of which are rectangles. Each area is a separate IP block (intellectual property block). Each MT626x core has its own DMA (memory management controller).

Watches for $ 3.25 , cheap trackers for $ 16.99 , trackers , watches with a built-in mobile phone for $ 23 , just a phone for $ 22.95 robots, copters and other "symbols of freedom and a new generation of superhumans". On most of these devices are chips from MediaTek Inc. These chips are very cheap. The device (such as Fernvale) turns out to be cheaper than a similar one based on an ESP8266 or Arduino, given the performance and potential.

A good example of a similar device for $ 5.42 with a MediaTek Inc. chip, the difference is in the absence of some unplugged pins, but you can find devices a bit more expensive with a large number of pins and with the ability to connect loops. For these devices, you can make EAT user applications. They do not need an external controller. Why spend 150 million in Russia at the unprofitable enterprise "Micron" to create your GSM module and wait 2 years, when you can buy the same for $ 3? Yes, if you sell each Russian by 1 modem (which is, of course, utopia), then the income will not cover the costs.

The process of replacing old expensive devices with new ones is cheap. Devices of the type: mobile phones, tablets, PCs change to small devices, which we trust a lot of personal information. Including the hash codes of our wallets, passwords, entry points to the crypto network. In some special cases (when such chips are used in car electronic units) we trust them with our lives.
')

Story


The first Smart Watch of the modern format was made by Samsung in 2003 . A prototype with a black and white screen was ready in 2001 .
image
Just 1 year later, when I was working at Samsung NT , I suggested to our team leader that the clock be used only for displaying information, storing and transmitting, but not for calls. It is necessary to use radio modules of very small consumption, and not WiFi or BT, as they are doing now.

What new OS are waiting for us at the new stage of evolution


Fernly port for MT6260 is not even a rodent in the world of mobile open operating systems. It is rather a cockroach, which did not have time to crush. Maybe by mistake. Or from the fact that he quickly runs and hides. On the contrary, there are altruists who feed this insect. Fernly port for MT6261 .

Nuttx is already a rodent. And apparently such rodents and belongs to the future. For example, the autopilot Pixhawk PX4 for copters work well, and sold for $ 55 even better. NuttX port for MT6260 .

ChibiOS is gaining more and more popular rodents due to the well-developed RT API HAL drivers. This OS is suitable for smart home , car controller , adapter for CAN bus and various peripheral devices .

Why much depends on the root certificates of the new OS


Product licenses depend on the license for the device or application. It is possible to create a product using these tools (watches, copters, robots, mobile devices), but the rights to it or the results of work are often licensed or in fact belong to the company that manufactured your tools. Modern experts have already found bookmarks in Chinese software. Such programs are able to share your information without your knowledge, but with the knowledge and on behalf of the manufacturer. Find examples of such services is not difficult.

In the next video, Michael Raggo, at 13 minutes, talks about the U8 clock on the MT6261D chip with the closed Nucleus operating system.



For this watch, Fernly has already begun to make a free operating system and even ported Nuttx to this chip.
about port Nuttx
we were able to boot on the MT6260
Port fernvale-nuttx on github . Now, with an eye to the Fernly port for MT6261D, you can make the NuttX port for MT6261D, but the memory area of ​​static RAM in MT6261D is smaller. Only 44k bytes .

A lot of Chinese code requires checking and securing the integrity and immutability of the tested firmware with certificates and means of control and verification available to all. You can look at the Chinese implementation of the MQTT protocol with authorization. Or a service for scooters with an unusually "deep knowledge" of customer devices. Or we can examine under a microscope a Chinese store with an API, devices and an app store with a BaaS (backend as a service) provider . These are all examples of code that millions of people use under the "honest Chinese word."

Who first saw the OSHW platform in MT626x


The link is the forum of one very well-known in narrow circles of the Kosagi team. The Bunnie leader with his girlfriend , the Kosagi team, or alone successfully ignited all sorts of crowdsourcing platforms with new initiatives (for example, wearable electronics) that even Adafruit could envy. This man was educated in America at MIT, although he is Chinese. And his whole team is Chinese (except for one person - Sean Cross):

image

Andrew 'bunnie' Huang took part in several fundraising projects. One of the most curious of these projects is The Essential Guide to Electronics in Shenzhen .
What is Gongkai and why is it needed for open source projects?
As you probably know, Shenzhen is a city near Hong Kong, where they produce a lot of electronics for the whole world. Where corporations of America have successfully lost part of their investments due to the immediate appropriation by the Chinese of new technologies. For example, smart watches, the best brands, were immediately manufactured in large batches under a new name, and their parts could be bought from friends (only Chinese with friends from Shenzhen). This system is called Gongkai .

The fact is that the movement of free source code is possible if someone pays for this work. A lot of Chinese people do not give them benefits from the state for being idle, as they do in Finland or some other countries that have won over Semitism. Therefore, the Chinese profit from their friends.


"New Chinese" technology


Bunnie used in its project novena flexible loops with soldered chips as additional contacts for connecting a digital oscilloscope. To intercept transmission protocols through the hardware interfaces of this year, which are so popular this year. For example, The $ 12 “Gongkai” Phone . And he did it so that from the point of view of American law, it was legal. Bunnie did not copy the source code of the Nucleus operating system into its project, but created its own open source operating system. The Kosagi team tried to use only legal methods and methods of obtaining information about devices with MT626x chips.
image
The fact is that the company MediaTek Inc. There is a technology for generating software drivers for their chip with automatic distribution of 25 pins for general use. Therefore, the only white person from the kosagi team, Sean Cross, wrote an interpreter for the operating system scripting language similar to MAUI (a closed operating system of devices based on MediaTek chips that includes the MMI user interface).

That is, the difference from the usual Bunnie Chinese specialist sample of 2006 that he can creatively approach the issue of copying technology programs, including using already copied technologies.

This is in fact the essence of the new “Great Revolution”, which was announced in December 2014 by Bunnie in his blog, but it never happened. A year and a half of the efforts of the Chinese and Americans did not help.

"Great Revolution" last week


Now all 3 components (OSHW, OS, DOCs) are in fact in the legal legal field and are available for study. A week ago, a good-hearted person from the Russian Federation (we will not point with a finger, although regular users of specialized forums on smartwatch can find this user’s nickname by style) decided to feed the cockroaches and, at the same time, mice and laid out the current documentation of MediaTek Inc. on, relatively, not the newest chips. PDF files for new MediaTek Inc. chips closed with passwords. Old chips are not used in new devices, but they are being used in "Chinese copies of Chinese copies of devices". Maybe someone is doing a code right now that will allow you to handle your smart watches with Arduino-like code .

Who will win these mouse races? Bets are accepted, gentlemen with GT.

Now we can accurately answer the question - how many cores and IP blocks are copied by MediaTek Inc. (without a license) for SoC MT6261. The answer to this question is via the link on the forum (we will consider it a micro-game inside this post on GT).

PS I hope that in the comments, experts will indicate the name of the document and the number of IP blocks on the X-ray .

PSS Compile Fernly OS and download in my watch with MT6260
git clone https://github.com/robertfoss/setup_codesourcery.git sudo setup_codesourcery/setup.sh /usr/local/bin/codesourcery-arm-2014.05.sh git clone https://github.com/xobs/fernly.git cd fernly/ make CROSS_COMPILE=arm-none-eabi- Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity. AS scriptic/set-plls.S AS scriptic/enable-psram.S AS scriptic/spi.S AS scriptic/spi-blockmode.S AS scriptic/keypad.S AS start.S CC bionic.c CC cmd-hex.c CC cmd-irq.c CC cmd-peekpoke.c CC cmd-reboot.c CC cmd-sleep.c CC cmd-spi.c CC cmd-led.c CC cmd-load.c CC cmd-bl.c CC cmd-lcd.c CC cmd-keypad.c CC emi.c CC irq.c CC lcd.c CC main.c CC scriptic.c CC serial.c CC spi.c CC utils.c CC vectors.c CC vsprintf.c arm-none-eabi-ld --nostdlib -T fernvale.ld --entry=reset_handler -o build/firmware.elf build/scriptic/set-plls.o build/scriptic/enable-psram.o build/scriptic/spi.o build/scriptic/spi-blockmode.o build/scriptic/keypad.o build/start.o build/bionic.o build/cmd-hex.o build/cmd-irq.o build/cmd-peekpoke.o build/cmd-reboot.o build/cmd-sleep.o build/cmd-spi.o build/cmd-led.o build/cmd-load.o build/cmd-bl.o build/cmd-lcd.o build/cmd-keypad.o build/emi.o build/irq.o build/lcd.o build/main.o build/scriptic.o build/serial.o build/spi.o build/utils.o build/vectors.o build/vsprintf.o lib/libgcc-armv5.a arm-none-eabi-objcopy -S -O binary build/firmware.elf build/firmware.bin AS usb-loader.S arm-none-eabi-objcopy -S -O binary build/usb-loader.o build/usb-loader.bin gcc fernly-usb-loader.c sha1.c -o build/fernly-usb-loader ./build/fernly-usb-loader -w -s /dev/ttyUSB0 ./build/usb-loader.bin ./build/firmware.bin 


PSSS Compiling Nuttx OS and downloading to my watch with MT6260
 git clone https://github.com/robertfoss/setup_codesourcery.git sudo setup_codesourcery/setup.sh /usr/local/bin/codesourcery-arm-2014.05.sh git clone https://github.com/sutajiokousagi/fernvale-nuttx.git cd fernvale-nuttx/misc/tools/kconfig-frontends/; ./configure --enable-mconf make make install cd ../../../nuttx/tools/; ./configure.sh kosagi-fernvale/nsh cd ../; make menuconfig nano ./setenv.sh ============> cut <======================= #!/bin/bash if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi WD=`pwd` if [ ! -x "setenv.sh" ]; then echo "This script must be executed from the top-level NuttX build directory" exit 1 fi if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}" fi # This is the Cygwin path to the location where I installed the CodeSourcery # toolchain under windows. You will also have to edit this if you install # the CodeSourcery toolchain in any other location #export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" # This is the Cygwin path to the location where I build the buildroot # toolchain. #export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" export TOOLCHAIN_BIN='/usr/local/codesourcery/arm-2014.05/bin' # This is the path to the tools subdirectory, # but in ${WD}/configs/kosagi-fernvale/tools possible find crypto bootloader. export LPCTOOL_DIR="${WD}/configs/olimex-lpc-h3131/tools" # Add the path to the toolchain to the PATH varialble export PATH="${TOOLCHAIN_BIN}:${LPCTOOL_DIR}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" ==========================> cut <============================== . ./setenv.sh make CROSSDEV=arm-none-eabi- # Look to https://github.com/sutajiokousagi/fernvale-nuttx/blob/master/nuttx/configs/kosagi-fernvale/README.txt # Currently, Fernvale requires a serial bootstrap. # This program is called fernly-loader, and will blast an image to offset 0x0. cd configs/kosagi-fernvale/tools/ make ./fernly-usb-loader /dev/ttyUSB0 ../../../build/usb-loader.bin ../../../build/firmware.bin ../../../nuttx.bin       .       ,   .   : Setting serial port parameters... Ok Initiating communication... Ok Getting hardware version... 0xca01 Getting chip ID... 0x625a <==================   MT625A   MT6260. Getting boot config (low)... 0x0000 Getting boot config (high)... 0x0000 Getting hardware subcode... 0x8000 Getting hardware version (again)... 0xca01 Getting chip firmware version... 0x0001 Getting security version... v 5 Enabling security (?!)... Ok Reading ME... 00000000 5a c2 9e 20 c9 5d 9c 31 24 e4 fb e3 8e dd b5 b3 |Z.. .].1$.......| Disabling WDT... Ok Reading RTC Baseband Power Up (0xa0710000)... 0x0001 Reading RTC Power Key 1 (0xa0710050)... 0xa357 Reading RTC Power Key 2 (0xa0710054)... 0x67d2 Setting seconds... Ok Disabling alarm IRQs... Ok Disabling RTC IRQ interval... Ok Enabling transfers from core to RTC... Ok Reading RTC Baseband Power Up (0xa0710000)... 0x0001 Getting security configuration... Unable to read from Sec Conf buffer: Success Getting PSRAM mapping... 0x0000 Disabling PSRAM -> ROM remapping... Ok Checking PSRAM mapping... 0x0002 Checking on PSRAM mapping again... 0x0002 Updating PSRAM mapping again for some reason... Ok Reading some fuses... 0x00000007 <=============================   3  E- Enabling UART... 0x0000 Loading Fernly USB loader... !! First response is 0x1d0d, not 0 !!       (0xE2 )  0x80  RSA ,    0x10    0xE3. 

Source: https://habr.com/ru/post/368879/


All Articles