вторник, 1 января 2019 г.

Ingenic Halley2, Uboot, Test push button and LED

I add to my stand 2 components:
1) a push button;
2) a LED.

Connection is follow.
A push button to pin BOOT_SEL0_PB28.
A LED to pin I2C0_SDA_SCC_DATA_PB24.
For more information about pins see X1000 Datasheet.

Both pins are in a group of port B. Their internal numbers are 60 and 56 respectively.

I made several scripts to test their functionality. They are here.

Update 07.01.2019. This is the photo of my stand.

Also I made the demo video with working script.


среда, 19 декабря 2018 г.

Ingenic Halley2, Uboot, loadb command

Be default Uboot version has not loadX commands. I wanted to test loading programs by serial line. So I did changes in board configuration to add set of commands loadX.
I added to configuration file (include/configs/halley2.h) follow lines:
#define CONFIG_CMDLINE_EDITING
#define CONFIG_CMD_LOAD
#define CONFIG_USE_XYZMODEM
#define CONFIG_CMD_LOADB
#define CONFIG_CMD_LOADS

After that new command appeared in Uboot command line interface.

When Uboot is compiled simple standalone program is compiled too. It is simple Hello World program. I used it for experiments with loading programs by serial line. There is loading and executing protocol for loadb command. I used ckermit program.

halley2-sfcnor# loadb 0x80200000
## Ready for binary (kermit) download to 0x80200000 at 115200 bps...

## Total Size      = 0x0000044c = 1100 Bytes
## Start Addr      = 0x80200000
halley2-sfcnor# go 0x80200000
## Starting application at 0x80200000 ...
Example expects ABI version 6
Actual U-Boot ABI version 6
Hello World
argc = 1
argv[0] = "0x80200000"
argv[1] = "<NULL>"
Hit any key to exit ... 

## Application terminated, rc = 0x0
halley2-sfcnor#

суббота, 15 декабря 2018 г.

Ingenic Halley2, First problem solving, Part 2

Now my stand is ready for programming.
For chips after JZ4770 Ingenic provides new programming utility USB Cloner. You can find it in SDK or download separately.
I connected my stand with UART and USB. I switched to USB Boot Mode. After that I used USB Cloner for programming.
And... It works. I prepared a demo video with programming process.

Ingenic Halley2, First problem solving, Part 1

I tried to find ways to rewrite flash memory content. Halley2 core module has not any connector of communication interface. I did UART connection but Uboot version doesn't support loadb command to load images. There are two other interfaces: USB and Ethernet. Ethernet is supported in Uboot but it requires external PHY chip and a electric transformer. I remembered that Ingenic's SoCs have BootROM with USB Mode Support. I found that Halley2 has needed pins for hardware connection. I connected button to pin BOOT_SEL0. And connected USB port to corresponding lines.
After starting my stand in USB Boot Mode I found new device in USB device list:
$ lsusb -s 1:
Bus 001 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 001 Device 007: ID a108:1000
Bus 001 Device 005: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

So I got my device prepared for flash memory reprogramming.

четверг, 13 декабря 2018 г.

Ingenic Halley2, First problem

I assembled an initial stand for experiments. It has one communication interface UART.
I didn't find information about settings of interface. But analyzing of Phoenix board schematic gave me follow info.
In Halley2 UART2 port is used for debugging purposes. Speed of interface is 115200 8N1.

When I boot stand for the first time I got follow:
I tried to read from flash chip with Uboot commands, but get 0x44 value from different areas.

I decided that it is a problem with incorrect software. Bootloader is for Phoenix board.

Ingenic Halley2, Introduction

Recently I bought a small module called Ingenic Halley2. It's based on SoC Ingenic X1000. You can find the reviews in Internet about that board but they are all content same common information. No photos, no details.
I will try give more info about it.
There are some photos with my small debug stand.




суббота, 22 октября 2016 г.

пятница, 21 октября 2016 г.

Openloongson Smart loong board: an image of SPI flash

I created a dump of the SPI flash memory chip. For that I used a cheap CH341a programmer and Flashrom program. Then I wrote the dump to a new SPI flash chip. After that I tried to load from the new chip and a result was successful. Below there are some photos of a programming process.


четверг, 20 октября 2016 г.

Openloongson Smart loong board: power consumption

I made a measurement of power consumption with a USB meter. See the photo below.

The value is about 0.582W.

Openloongson Smart loong board: using of serial debug interface

With the board I got a USB-to-UART adapter. There is a photo of the adapter in a user's guide but labels of wires in Chinese. I made expreriment and found a right configuration.
Wire color    Function
----------------------
Black         GND
Green         TX
White         RX

There is a place with UART connector in a user's guide.


воскресенье, 16 октября 2016 г.

Openloongson Smart loong board

Recently I bought a small development board that is based on Loongson SoC (and of course on Loongson CPU). Used CPU implements MIPS32 architecture. This SoC is fully designed and made in China.
I made the first demo video about the board.
I hope I will learn this board and create more posts about it.

воскресенье, 18 сентября 2016 г.

Bootloaders with MIPS support

I decided to do review of known bootloaders with MIPS architecture support. The results of review are showed below in form of time-line diagram.
20.09.2016 - updated for Algorithmics Ltd. node
16.10.2016 - updated for Broadcom's CFE


среда, 18 марта 2015 г.

Yuri Panchul's Digital Design and Computer Architecture test

Случайно обнаружил тест от Панчула. В этом тесте есть вопросы, касающиеся архитектуры MIPS: вопросы с номерами 4, 8, 9, 10. Я дал на них следующие ответы:
4  - d
8  - c
9  - e
10 - d

Short review of Britton's book

Закончил работу с книгой Britton'а MIPS Assembly Language Programming. Хочу поделиться впечатлениями от этой книги.
Большой плюс книги - наличие большого кол-ва упражнений по каждой теме.
В книге объясняется работа с симулятором Spim (правда, старой версии от 2003г).
Важно отметить, что на протяжении 8 первых глав предполагается, что идёт работа с процессором Simple Model.
Только в 9-ой главе вводится понятие конвейера и связанных с ним "подводных камней" (hazards).
Я делал упражнения в симуляторе MARS (почему, писал в одном из постов), но упражнения из 9 главы делал с помощью QtSpim, т.к. MARS не поддерживает конвейер.
Мне показалось, что в книге плохо представлен теоретический материал. Особенно по теме стека и подпрограмм.

воскресенье, 15 марта 2015 г.

Right shifting instruction in MIPS

В наборе инструкций MIPS32 имеются две инструкции для битового сдвига вправо: 1) sra - арифметический сдвиг; 2) srl - логический сдвиг.
При арифметическом сдвиге знак числа распространяется.
При описании операции >> в книгах по языку программирования Си указывается, что для чисел без знака будет использоваться логический сдвиг, а для чисел со знаком используемая операция зависит от реализации (в частности, от процессорной архитектуры, в которую транслируется код; есть ли там команда арифметического сдвига).

Написал маленькую тестовую программу на Си для проверки действий на процессорных архитектурах x86 и MIPS:
#include <stdio.h>
#include <inttypes.h>

int main ()
{
    int32_t val;
   
    val = 0x80000000;
   
    val = val >> 31;
   
    if (val == -1)  // -1 = 0xFFFFFFFF
      printf ("Arithetic shifting is used for right shifting\n");
    else
      printf ("Logical shifting is used for right shifting\n");
   
    return 0;
}


В двух вариантах архитектуры программа показала использование арифметического сдвига.