Linux tip: How to reset device connected to USB port

Sometimes devices connected to USB ports need to be re-set. It’s not unusual GSM modems and WiFi dongles to freeze and the only way to bring them back to life is to remove and re-attach.

OLinuXino USB ports has power switches and current limiters which can be controller by Linux drivers.

After some experimenting we found that it’s not so easy actually to do it with the standard file system and shell.

A friend suggested to try this code. It worked very well, so here is how to use it. First you need to download and compile it, then to make it executable:

$ mkdir usbreset
$ cd usbreset
$ wget $ https://raw.githubusercontent.com/jkulesza/usbreset/master/usbreset.c
$ cc usbreset.c -o usbreset
$ chmod +x usbreset

Then you need to see where your USB device is. In our case I connected MOD-WIFI-R5370 WiFi USB dongle:

$ lsusb

you will see something like:

Bus 002 Device 039: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

to reset this device use the command:

./usbreset /dev/bus/usb/002/039

The device USB port will be power off for a second then power on again.

All above is tested and work with official Olimex Linux images from images.olimex.com, but should work on other Linux distributions too.

LIME2-SHIELD adds CAN, second SD-card, two UEXT connectors, Audio IN and OUT, breadboard friendly GPIOs to A20-OLinuXino-LIME2 Open Source Hardware Linux computer

A20-OLinuXino-LIME2 is with small compact design, this is why we couldn’t put on it all connectors for the functionality this board offers.

The existing 0.05″ step connectors are OK for cables and shields, but are pain when you want to breadboard something or to attach UEXT module.

This is why we made LIME2-SHIELD open source hardware shield. It has these signals available:

LIME2-SHIELD User manual explains how to prepare your SD-card for booting Linux on A20-OLinuXino-LIME2, then how to setup the board with different scripts and device tree.

Demo codes how to work with GPIO, I2C, SPI, CAN with C, Python and console are included:

The work on our most complex Open Source Hardware Linux board started – meet the Tukhla iMX8QuadMax SOC based board to be designed with KiCAD

We started working on our most complex OSHW board with KiCAD.

iMX8 is broad range of very different ARM architectures under same name which some people may find quite confusing.
Here is the table chart:

You can see by yourself:

  • iMX8X is quite humble with up to x4 Cortex-A35+Cortex-M4F cores, something less capable than Allwinner A13 or STM32MP1XX
  • iMX8M, Nano/Mini/Plus is x4 Cortex-A53 + Cortex-A7/M4F something in the range of power of Allwinner A64
  • finally iMX8QuadMax comes with different configurations, but the high end is Octa-core with x2 Cortex-A72 + x4 Cortex-A53 + x2 Cortex-M4F and is more powerful than the popular Rockchip RK3399

Why we did started working on such monster?

Company from EU which values the OSHW recognized the absence of high end open source Linux board and asked us to design one. They offered to cover all associated design costs. They specially requested this to be not yet another RK3399 board, but based on SOC with proper documentation and software support. NXP’s high end iMX8QuadMax matched their requirements perfectly.

Currently all powerful Cortex-A72 comes from Chinese or Korean origin and are always closed projects, the only published info in best case is PDF schematic which can’t be verified i.e. the final product may or may not match what they publish. The popular Raspberry Pi go even further and their “schemaitcs” are just connector diagrams.

This is how the Tukhla project was born, it will have:

  • MIMX8QM5AVUFFAB Octa-core SOC with: ( x2 Cortex-A72, x4 Cortex-A53, x2 Cortex-M4F, x4 GPUs with 16 Vec4-Shader GPU, 32 compute units OpenGL® ES 3.2 and Vulkan® support Tessellation and Geometry Shading, Split-GPU architecture enables 2x 8 Shader Cores, 4k h.265 Decode, 1080p h.264 encode)
  • x2 LPDDR4 x32 databus RAM memory with up to 16GB of RAM configuration
  • PMU taking all power lines from single 12V/4A source
  • micro SD card
  • eMMC Flash with differnt sizes
  • QSPI Flash
  • x1 SATA for external HDD/SSD drives
  • x2 single lane PCIe with M2 connectors for NVMe
  • HDMI input 1.4 RX with HDCP 2.2
  • HDMI output 2.0 TX with HDCP 2.2 4K
  • USB 2.0 OTG
  • USB 3.0 HOST
  • x2 Gigabit Ethernet
  • x2 MIPI CSI camera connectors

The price of MIMX8QM5AVUFFAB alone is around EUR 100 in small quantities and currently LPDDR4 4GB cost EUR 35, LPDDR4 8GB cost EUR 50, LPDDR4 16GB cost EUR 180.

So with BOM over EUR 200 this board will not be affordable for the most of Raspberry Pi $35 price range users.

This board targets professionals, who need high performance board and being not dependent by Chinese SOC vendors. With all hardware open, which gives them security for their business as the design is public.

iMX8QuadMax SOC is available in automotive AEC-Q100 Grade 3 (-40° to 125° C Tj), Industrial (-40° to 105° C Tj), Consumer (-20° to 105° C Tj)

Some of the features like HDMI input are not present in the Chinese SOCs at all.

iMX8QuadMax may have DSP and incorporate Vision and Speech Recognition interactivity via a powerful vision pipeline and audio processing subsystem.

The Software support include: Android™, Linux®, FreeRTOS, QNX™, Green Hills®, Dornerworks XEN™.

iMX8QuadMax is fully supported on NXP’s 10 and 15-year Longevity Program

Tukhla means Brick in Bulgarian (and other Slavish languages) and it will be the OSHW building block for whole range of different solutions.

How long it will take to finish this design?

We honestly don’t know. It took more than month just to capture the schematic in the state it is now:

There is long path now to create and verify all component packages (just the SOC is in 1313 BGA ball package), verify the schematic signals, place the components on the PCB, route high speed signals manually.

It may be 6 months or more. We got unofficial info that NXP engineers spent more than year to make the NXP iMX8QMax demo board.

Allwinner keep their promise for long term supply of T2 (industrial A20) SOC. If you wonder how 60K of Allwinner T2 SOC looks like you can see now

T2 is the industrial version of A20 – the most successful SOC in Allwinner history. It keeps selling for more than 8 years now and demand is steady.

We are proud that our OSHW designs with A20 are part of this success story.

T2 can work in extended temperature grade and is more expensive than A20, so the demand is not so big and used just by specific customers like in automotive and industrial equipment. During the last COVID-19 economy slow down these customers decreased and Allwinner stock of T2 was sold out. While NXP, ST etc always keep some kind of guarantee that they will produce this processor for XX years, Chinese companies are practical, they sell as long as it’s profitable for them and if demand is low they just stop.

This is why many people are afraid to place Chinese SOC in their products, they are afraid that this chip may stop being produced at some point of time and their design need to be changed.

Fortunately for Olimex our sales are big enough to be interesting and supported by Allwinner. We have enough business to place custom orders even for chips which are now with status “obsolete” and Allwinner keep producing them for us.

T2 automotive/industrial market for Allwinner now is not big enough for them to justify keeping it in stock, but Olimex placed order for these in January and 60Kpcs hit our warehouse few weeks ago.

The label show these T2 SOC are manufactured 18 of May 2020 🙂

So Allwinner keeps their part of the deal for long term delivery and manufacture for us even SOCs which are not available for sale officially, this means we can keep producing our boards with Allwinner SOC for our customers and they are safe with us.

Open Source Hardware Linux board with industrial grade -40+125C temperature STMP1-OLinuXino-Lime2 prototype is live

We have progress on this board software. It now boots, we have been fighting the hardware and of course the issue was RTFM in this case RTFE (Errata) where STM well documented thar this chip requires oscillator and will not work with only crystal. We were misleaded by their kit schematic where they made provisions for both crystal and osciallator and being cheap we first bet on the crystal 🙂 .

Anyway after replacing the crystal with oscillator STMP1-OLinuXino-Lime2 got alive and here is the boot log: https://pastebin.com/ev94Jbk0

Our design is quite different from STM demo kit, we use different PMU, PHY HDMI so many things have to be done on the Linux support, but the results so far are very good.

The Open Source Hardware OLinuXino boards are with new Linux Kernel 5.6 scripts to move Linux OS to eMMC or SATA are included

We are pleased to announce that now the images at http://images.olimex.com/release/ are with the lates Linux Kernel 5.6

All these are build with our Olimage script.

We still keep Ubuntu Bionic 18.04 LTS distribution and didn’t move to 20.04 LTS yet.

To addition for script which set boot from eMMC we add new one which allow you to boot from SATA.

The boot from eMMC and SATA is enabled for OLinuXino boards which has SPI Flash on them like:

  • A20-OLinuXino-LIME-e16Gs16M
  • A20-OLinuXino-LIME-e4Gs16M
  • A20-OLinuXino-LIME-s16M
  • T2-OLinuXino-LIME-e8Gs16M-IND
  • T2-OLinuXino-LIME-s16M-IND
  • A20-OLinuXino-LIME2-e16Gs16M
  • A20-OLinuXino-LIME2-e4Gs16M
  • A20-OLinuXino-LIME2-s16M
  • T2-OLinuXino-LIME2-e8Gs16M-IND
  • T2-OLinuXino-LIME2-s16M-IND
  • A20-OLinuXino-MICRO-e16Gs16M
  • A20-OLinuXino-MICRO-e4Gs16M
  • A20-OLinuXino-MICRO-s16M
  • T2-OLinuXino-MICRO-e8Gs16M-IND
  • T2-OLinuXino-MICRO-s16M-IND
  • A20-SOM-e16Gs16M
  • T2-SOM-e8Gs16M-IND
  • A20-SOM204-1Gs16Me16G-MC
  • T2-SOM204-1Gs16Me4G-C-I
  • T2-SOM204-1Gs16Me8G-MC-I

To make board booting from eMMC you have to boot from SD-card then execute:

$ sudo olinuxino-sd-to-emmc

then wait until script moves the OS to eMMC, remove the SD-card and reboot.

Similar if you want to make board boot from SATA you have to boot from SD-card then execute:

$ sudo olinuxino-sd-to-sata

Olimage – Mainline Linux images building script for all of our OLinuXino and SOM boards

DEBIANubuntu_904

We work for more than 6 month on our own Linux building script and now we are ready with it’s initial release, which is now on GitHub .

Why do we need it? The number of our boards with all variant hit over 70 pcs when you add to them the different LCD combinations and other peripherials the support and test of these images became little hell. Our latest Armbian based image was released 3-4 months ago as we didn’t manage to properly test all board features in the newer images.

So we first made universal images for all our groups of boards (based on the SOC used) and EEPROM where we store info so uboot and kernel to may recognize the board and configure properly the parameters at boot time.

Then we decided to make one-for-all build script which will automatically build images with recent kernel and uboot automatically.

We had to leave Armbian as we wanted things to be more under our control and decision. Also we wanted everything to be 100% tested when released. Armbian official builds are not tested at hardware level other than to see board boots, so many boards are with peripheral conflicts and we had to apply our patched on Armbian anyway to adjust the images for our boards.

Our official images now are at http://images.olimex.com.

There is release folder where we have minimal and basic images for Debian and Ubuntu and testing folder where new uboot and kernel images will be built and kept until properly tested. For instance Ubuntu 20.04 LTS and kernel 5.6 images will be put there in the next couple of weeks.

The Olimage script and repositories are developed in our internal Gitlab and will be only push to Github when everything is properly tested and images moved to release folder. Also we push all our patches upstream.

With the current kernel and uboot users can easily generate any Linux distribution as it’s matter of building rootfs.

Moving to the next release would be possible simple by

sudo apt-get update && apt-get dist-upgrade

then re-boot of the board, so when we release new images all you have to do is to run the above commands and you will have the latest images.

For the moments the builder has A10, A13, A20, A64.

iMX233 and RK3188 SOCs are obsolete and not produced anymore by Rockchip and NXP, so they will be not included in the script. We still produce and sell these boards, but they will be discontinued when we use our existing SOC stock.

AM3352-SOM and AM3359-SOM will be included in the script, but we have no fixed date when, as we have to put earlier S3-OLinuXino and STMP1-OLinuXino-LIME2 which are with higher priority.

The Industrial grade -40+125C Open Source Hardware Linux board which is hardware compatible with A20-OLinuxino-LIME2 but with ST Microelectronics STM32MP1xx SOC STMP1-OLinuXino routing is complete

TOP1

BOT1

STMP1-OLinuXino routing is complete. It took 6 months from the idea to the finish.

Why it took so long? We had several times to re-design the schematics around the DDR memory and power supply.

Our goal was to make it pin to pin compatible with OLinuXino-LIME2 and we achieved it.

STMP1-OLinuXino has:

  • Same size as LIME2
  • Same GPIOs on same places
  • Ethernet, USB, battery Lipo, buttons, HDMI, SD-card on same places
  • same mount holes
  • 1GB DDR3 memory
  • Gigabit Ethernet interface
  • HDMI interface
  • LCD interface
  • 2x USB hosts and 1x USB-OTG
  • micro SD-card
  • GPIOs have similar interfaces on the same positions
  • LiPo battery charger and step up converter for battery operation
  • CAN interface

There are few differences:

  • we add Flash connector where different flash modules will be attached: NAND Flash, SPI Flash, eMMC Flash, so instead to keep many different versions of the board with different Flash options like LIME2 this will be done with exchangeable modules
  • we put the STM32MP1 SOC on bottom where adding heatsink do not interference with the top GPIO connectors and add-on boards

The STM32MP1 devices work at -20/40+125C operating temperature by default which makes them perfect for industrial applications.

There will be different versions with STM32MP151/153/157 as they share same BGA package, also there will be some versions with commercial temperature grade components for lower cost.  Our preliminary estimations are the prices to be between EUR 35 and 70 depend on the different configurations.

Say Hello to Es-Ti-Em-Pai STMP1-OLinuXino the Open Source Hardware with mainline Linux support and -40+125C operating temperature

Screenshot from 2019-12-10 08-05-45

ST32MP1XX SOCs from ST Microelectronics has one unique feature: They operate from -40 up to +125 by default there is no other commercial or industrial or etc temperature range. What does this means – very well done production! It’s not secret that all SOC vendors produce their chips then test them and which pass -40+125 are classified automotive grade, which fail but pass -40+85C are classified industrial and it there are SOC which fail both automotive and industrial grade on tests are sold as commercial grade.

This chip has no other than automotive grade, so ST is confident in their process quality.

For this SOC ST Microelectronics guarantee 10 years rolling availability.

The peripherals ST32MP1XX has are also industrial and real time oriented:

  • Cortex-M4 co processor, we know Cortex-A series when run RTOS has latency which do not allow fast processed like motor control etc. This is where this co-processor release the main OS processor of such demanding tasks
  • FD-CAN ST32MP1 has two cans both support FD which offer less latency and faster speed, one of them has also time triggered CAN (TTCAN)
  • 2 × ADCs with 16-bit max. resolution (12 bits up to 4.5 Msps, 14 bits up to 4 Msps, 16 bits up to 3.6 Msps)
  • 2 × 12-bit D/A converters (1 MHz)
  • 8- to 14-bit camera interface up to 140 Mbyte/s
  • Gigabit Ethernet
  • 6 × SPI (50 Mbit/s)
  • 6 × I2C FM+ (1 Mbit/s, SMBus/PMBus)
  • Documented Trust Zone and Secure Boot (may be subject to some export restrictions)

We designed our STMP1-OLinuXino to be with same layout as A20-OLinuXino-LIME2, with all connectors on same positions, so people who used LIME2 to may migrate to STMP1 if necessary.

Screenshot from 2019-12-10 08-06-22

We put the SOC on bottom this time to may attach easier bigger heat sinks or even connect it to the BOX-LIME-BLACK metal and remove the need for aluminum heatsink.

Screenshot from 2019-12-10 08-06-47

Note that schematic is not verified yet and the PCB is not routed, we just placed the components on their approximate locations.

All preliminary files are put on GitHub so people who are interested how we wired the GPIOs to match LIME2 functionality and existing customers find potential conflicts with their current design may signal while still routing is not complete 🙂

Looking forward for your comments.

A64-OLinuXino got new metal box design

A64-1

After the blog for KODI image lot of people sent emails asking if we will release metal box for A64-OLinuXino, as it actually works very well as media player and can play 4K video @30fps according to Jernej:

Some remarks about blog post content:
"Both A20 and A64 decode up to 4K movies but of course can’t 
display  such resolutions." - A64 is actually capable displaying 
such resolutions. It supports up to 4K@30Hz. Kodi will render 
hardware decoded 4K videos without downsizing when connected 
to 4K TV/monitor.

 

So we start working on this and here is the result:

A64-2.jpg

А64-3

Now we have to laser-cut and bend some boxes and see if it’s done right 🙂

Previous Older Entries