Hello all.
This document shows how to play the puzzle game “2048” on the RIoTboard running Ubuntu. The RIoTboard is an open source platform featuring the powerful i.MX 6Solo, a multimedia application processor with ARM Cortex-A9 core at 1 GHz.For complete information regarding RIoTboard characteristics and its user manual, you could refer to the following links:
First, we need to get the Ubuntu image and Mfg Tool from the following page:
Once getting the software, it is required to configure the Boot Configuration Select switches (SW1) for Serial Downloader Mode as shown below:
After completing the download of the software, it is requiered to configure the switches for booting from eMMC, as shown below:
For additional details regarding Boot modes, you could refer to chapter 4 of the RioTboard User Manual.
By default, the Debug serial port of the RioTboard is routed to the J18 header (labeled as “Debug”), so, if you have a EVBUSB2SER board, you could use it to access to this serial port by USB.
In order to avoid damages between boards, please ensure of the following (on the EVBUSB2SER board):
Finally, the connections between EVBUSB2SER and RioTboard should be as follows:
Pin Number on EVBUSB2SER header P1 | Pin Number on RIoTboard header J18 | |
7 (RXD) | <-----> | 1 (UART2_TXD) |
8 (TXD) | <-----> | 2 (UART2_RXD) |
9 (GND) | <-----> | 3 (GND) |
The following image shows both board connected as mentioned:
With the serial console connected, you could see the boot log, and stop the boot process for enter to U-Boot for changing the HDMI display resolution (enviroment variable “bootargs”). If you want to know the default vales, you could call the following command:
printenv bootargs
So, for changing the resolution to 1920x1080 and then booting, you should do the following:
setenv bootargs console=ttymxc1,115200 nosmp video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb1:off
saveenv
boot
On the following webpage you could find the source code of a working 2048 game on a single C file:
https://github.com/mevdschee/2048.c
On the same page are included the instructions for downloading and compiling it, which are the shown below (using either Serial Debug console or a Terminal window). The Ubuntu image should already include the gcc compiler:
wget https://raw.githubusercontent.com/mevdschee/2048.c/master/2048.c
gcc -o 2048 2048.c
If you want to visualize the source code you could try:
cat 2048.c
Either using Serial Debug console or a Terminal window (or both) you could now launch the 2048 game my simply launching the compiled executable:
./2048
Below you can find screen captures of the game running on both scenarios:
Hope this will be useful and funny for you.
Best regards!
/Carlos
Hi,
Thanks for sharing, any ideas where to get an pre-compiled Ubuntu 14 image for the board?