Apache NuttX RTOS PMC

It is my great honor to become a PMC (Project Management Committee) member in the Open-Source Apache NuttX RTOS [1]. Thank you for inviting me into this great community and totally amazing project! :-)

NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are Posix and ANSI standards. Additional standard APIs from Unix and other common RTOS’s (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()).

[1] https://nuttx.apache.org/

NuttX RTOS is now Apache TLP

My favorite NuttX RTOS [1] that is “Tiny Unix on MCU” has graduated to Apache Top-Level-Project [2], congratulations! :-)

Apache NuttX [1] is a real-time operating system (RTOS) that emphasizes standards compliance and small footprint, usable in all but the tightest micro-controller environments. It runs on 8-bit, 16-bit, 32-bit, and 64-bit microcontrollers across RISC-V, ARM, MIPS, ESP32, AVR, x86, and other architectures with a high degree of standards compliance. NuttX is used to power the Fitbit fitness tracker, as well as satellites, IoT devices, bluetooth headphones, drones, and more.

What I like most in NuttX is the development team / community.. and scalability starting upwards from 8-bit CPU’s. One day I wish porting NuttX to my 8-bit Atari and 16-bit Amiga and Atari ST and push new life to these amazing machines :-)

[1] https://nuttx.apache.org
[2] https://news.apache.org/foundation/entry/the-apache-software-foundation-announces-apache-nuttx-as-a-top-level-project

CED 7000 battery replacement

If you need to replace battery for CED 7000 timer [1] you can either buy a HLP 443450 3.7V 800mAh 2.96Wh accumulator [2] or dedicated inexpensive Power Bank [3] that contains two accumulators inside – one for quick replacement of the timer battery and the other to charge timer over the USB cable – this way you can also safely carry a backup and replacement power source at hand :-) One thing that could be improved here is using both accumulators in the Power Bank so capacity is doubled and both are always charged – that should also prevent self-discharge below safe point of the unused unit.





[1] https://www.cedhk.com/ced7000-shot-timer
[2] https://www.cedhk.com/ced7000-replacement-battery
[3] https://www.halinka-arms.pl/timery-i-akcesoria/1096-power-bank-do-timera-ced-7000.html

ZEPHYR RTOS ROX!

If you never heard about Free-and-Open-Source ZEPHYR RTOS [1] (Apache 2.0 licensed) then it will make your day as the best platform out there for your new embedded electronics design :-) It works on anything.. even on Open-Source-Hardware RISC-V CPU [2] :-)

[1] https://zephyrproject.org/
[2] https://riscv.org/

Xilinx USB JTAG Platform Cable Vivado Linux

If you work with Xilnx Vivado Design Suite [1] for FPGA development using USB JTAG interface such as Xilinx USB Platform Cable [2] or its cheaper clone from WaveShare [3], everything seems to be connected properly, but it cannot find the Target for programming, you probably need to perform drivers setup manually [4]. Error message looks like this:

ERROR: [Labtoolstcl 44-494] There is no active target available for server at localhost.
Targets(s) ", jsn3" may be locked by another hw_server.

Error message may indicate that another instance of hw_server is running in the background but that is not the case. Check your drivers first [4]. Some hints:

  • Run as root and be careful as this will modify your OS.
  • Install script location is Vivado/2020.2/data/xicom/cable_drivers/lin64/install_script/install_drivers.
  • Platform Cable USB interface is pcusb.
  • Make sure UDEV rules are installed in /etc/udev/rules.d/ (i.e. 52-xilinx-pcusb.rules file).
  • After drivers are set up remember to restart UDEV with service udev restart command and re-attach your USB JTAG cable.

[1] https://www.xilinx.com/products/design-tools/vivado.html
[2] https://www.xilinx.com/products/boards-and-kits/hw-usb-ii-g.html
[3] https://www.waveshare.com/platform-cable-usb.htm
[4] https://www.xilinx.com/support/answers/54381.html

DSO QUAD MINI SCOPE ACCU REPLACEMENT

If you are happy user of DSO QUAD pocket oscilloscope from Seeed Studio [1] then probably after all those years you need to replace the accumulator. Because stock model PL384070 3.7V 1000mAh is not available anymore you can safely use CL404070 3.7V 1300mAh that is only 0.2mm thicker but it also fits the scope very well and you gain 30% capacity. You only have to solder the plug from the old accumulator. Enjoy :-)







[1] https://www.seeedstudio.com/DSO-Quad-Aluminium-Alloy-Black-p-1034.html

Synaptics TouchPad on Panasonic CF-MX4

This wulf7 [1] is a really nice guy that helped me run full featured Synaptics TouchPad with FreeBSD on Panasonic Toughbook CF-MX4 [2][3]. Now it works for moused and libinput with all multitouch gestures like two or three finger scroll, scale, etc! The problem was in detection mechanism as device is connected over multiplexer with both PS/2 and SMBus but multitouch works only over SMBus. Although fix requires change and rebuild of FreeBSD Kernel I hope it gets quickly to the upstream [4]. I had a chance to exercise building whole FreeBSD distribution into the USB memstick image, so I could test driver fix on a target computer without even touching its hard drive contents :-)

/* psm has a special support for GenMouse + SynTouchpad combination */
if (active_ports_count >= 2) {
    for (port = 0; port < KBDC_AUX_MUX_NUM_PORTS; port++) {

That 2 above had to be changed into 1 in /usr/src/sys/dev/atkbdc/psm.c. Nice? That’s what I call a one-bit-fix :-)

In addition, when you work with Synaptics Touchpad in Xorg and you want to use its all features like tap-to-click, natural (swapped) two finger scroll, two and three finger gestures, don’t use moused,xmodmap, or xinput as this will produce inconsistent behavior in applications based on different toolkits (i.e. GTK will scroll up while Qt will scroll down etc), instead use the new way of input based on libinput and modify MatchIsTouchpad section of /usr/local/share/X11/xorg.conf.d/40-libinput.conf like:

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event5"
        Option "NaturalScrolling" "on"
        Option "Tapping" "on"
        Option "ClickMethod" "clickfinger"
        Driver "libinput"
EndSection

[1] https://github.com/wulf7/iichid
[2] https://github.com/wulf7/iichid/issues/51
[3] https://github.com/wulf7/iichid/issues/53
[4] https://reviews.freebsd.org/D28502

ARM mbed OS DAPLink pyOCD

It is my great honor to join Free-and-Open-Source ARM mbed [1] development team! :-)

[1] https://www.mbed.com

JTAGulator

I just did a self-assembly of JTAGulator. This simple and amazing device indeed works and shortens JTAG pinout search from days to seconds. AMAZING! I have some spare devices to sale cheap in EU, if you want one let me know! :-)

JTAGulator is an open source hardware tool, created by Joe Grand / Grand Idea Studio, that assists in identifying OCD connections from test points, vias, or component pads on a target device. All you need is a target device, bunch of tap wires / cables, USB-Mini cable, and serial terminal to operate JTAGulator.



On-chip debug (OCD) interfaces can provide chip-level control of a target device and are a primary vector used by engineers, researchers, and hackers to extract program code or data, modify memory contents, or affect device operation on-the-fly. Depending on the complexity of the target device, manually locating available OCD connections can be a difficult and time consuming task, sometimes requiring physical destruction or modification of the device.

LibSWD-0.7 RELEASE

It is my great pleasure to inform you folks that, almost after four years, I did a new release of LibSWD-0.7 [1], a low-level embedded systems access open framework. Special thanks goes to Andrew Parlane of Carallon Ltd [2] for his much appreciated contributions! Well now I feel like I need to invent some nice small device based on ARM Cortex-M0 CPU :-)

[1] https://github.com/cederom/LibSWD
[2] http://www.carallon.com/

OrangeADE: Orange Autonomous Device Evaluation

I have recently started the OrangeADE project [1], that is Orange Autonomous Device Evaluation, an online platform to evaluate security level of network equipment and verify against known vulnerabilities. OrangeADE is released as Open-Source under the “new” 3-Clause BSD license. Enjoy the work in progress! :-)

[1] https://github.com/CeDeROM/OrangeADE

Is Blend4Web a Blender Game Engine replacement?

You just need to see this awsome Mars Curiosity [1] simuluator [2] made by NASAJPL [3] with Blender3D [4] Blend4Web [5] HTML5 [6] WebGL [7] Free and Open-Source Software :-)

Screen Shot 2017-01-15 at 15.25.15

[1] https://www.nasa.gov/mission_pages/msl
[2] https://eyes.nasa.gov/curiosity
[3] http://www.jpl.nasa.gov
[4] https://www.blender.org
[5] https://www.blend4web.com
[6] https://www.w3.org/TR/html5
[7] https://www.khronos.org/webgl

Blender 3D and DS4 PS4 Bluetooth controller

Blender 3D can work with DualShock4 Playstation4 wireless controller over Bluetooth [1].

[1] http://www.blendswap.com/blends/view/78315

FreeBSD Synaptics Trackpad/Touchpad

Use advanced features of your Synaptics Trackpad on a laptop running FreeBSD [1] with:

  • set in /boot/loader.conf:
    hw.psm.synaptics_support="1"
  • set in /etc/rc.conf:
    moused_enable="YES"
  • set in /etc/X11/xorg.conf:
    Section "InputDevice"
        Identifier      "Mouse0"
        Driver          "mouse"
        Option          "Protocol"      "auto"
        Option          "Device"        "/dev/sysmouse"
        Option          "ZAxisMapping"  "4 5 6 7"
    EndSection

If you want to have “MacBook” like two-finger scrolling along with other parameters you can set in /etc/sysctl.conf:

hw.psm.synaptics.min_pressure=16
hw.psm.synaptics.max_pressure=220
hw.psm.synaptics.max_width=10

hw.psm.synaptics.vscroll_hor_area=1300
hw.psm.synaptics.vscroll_ver_area=-600
hw.psm.synaptics.vscroll_min_delta=50
hw.psm.synaptics.vscroll_div_min=100
hw.psm.synaptics.vscroll_div_max=150

hw.psm.synaptics.weight_current=3
hw.psm.synaptics.weight_previous=6
hw.psm.synaptics.weight_previous_na=20
hw.psm.synaptics.weight_len_squared=2000

hw.psm.synaptics.div_min=9
hw.psm.synaptics.div_max=17
hw.psm.synaptics.div_max_na=30
hw.psm.synaptics.div_len=100

hw.psm.synaptics.margin_top=200
hw.psm.synaptics.margin_right=200
hw.psm.synaptics.margin_bottom=200
hw.psm.synaptics.margin_left=200

hw.psm.synaptics.window_min=4
hw.psm.synaptics.window_max=10
hw.psm.synaptics.multiplicator=10000

[1] https://wiki.freebsd.org/SynapticsTouchpad

Cura Configuration Reference Manual

Starting up the Configuration Reference Manual for Ultimaker CURA 3D printing Open-Source software :-)

https://github.com/Ultimaker/Cura/wiki/Cura-Configuration-Reference-Manual

Sony Xperia Unlocked Mobile Firmware Restore

Sony Xperia phones are my favorite. Very good and durable electronics, amazing photo camera, nice utilities on top of standard Google Android OS. I have also always respected Xperia for allowing users to unlock their phones for Open-Source Firmware Customization on this amazing hardware..

xperiacompanionfail

Unfortunately, Sony seems to have this habit to make a bad decisions, so amazing hardware is not always followed with a good software. This is why Open-Source Customization is so important. I have already found several nice devices with a really bad firmware. What is more, this corruption seems to spread, and Sony blocks factory firmware restore for an unlocked devices with their official Xperia Companion utility. This means unlocking a device does not only Voids a Warranty, but also silently makes it Impossible to Go Back to a Stock Firmware! This is really bad idea.

emma

Luckily smart people tends to predict and help each other out. Developer team of Sony Mobile released EMMA utility (nice name by the way) that allows you to re-flash mobile that is unlocked in case something goes wrong or you simply want to get back to a stock firmware.

Open-Source Firmware Customization will become a standard, even for large enterprises, with mutual benefit to their customers, because looking at the big picture we are part of the same eco(no)system..

NXP Technology Days 2016

It was fun to take part in NXP Technology Days 2016. Last year fusion of Freescale into NXP looks good, lots of useful solutions and possibilities gathered in one place. Very interesting On-Chip Security Mechanisms for Embedded Systems and Open-Source implementations for i.MX6 CPU family. Let’s hope that (probably upcoming) fusion of NXP into Qualcomm will not affect Open-Source Community in a bad way..

20161004-nxptechdays-tcedro-small

CeDeROM CASING for M24LR-DISCOVERY

As an exercise, I have just designed (using FreeCAD) and 3D-Printed (using semi-translucent PLA material) a casing for M24LR-DISCOVERY (CR95HF NFC Reader). Let me know if you need one :-)

Read More

Xperia Android Bootloader Unlock

It is very kind of Sony that they created an easy way to unlock Bootloader of Xperia Android Smartphones. You can now customize your phone firmware and OS :-)

http://developer.sonymobile.com/unlockbootloader/unlock-yourboot-loader/

Sony Xperia M5 Bugs

I have just bought next inexpensive Xperia M5 phone with pretty nice hardware. However I already found those things to be missing or deliberately removed:

  • USB OTG does not work (solved).
  • CardBoard VR does not work.

Update regarding USB OTG – “it’s not a bug its a feature” – after you connect a USB device using OTG cable you need to run “Detect USB device” application that will make OTG work. Considering security this may be a good choice to allow external devices by hand.

Dualshock4 PS4 Controller Bluetooth Pairing

dualshock4-bluetooth-pair-cederom

There is one simple way I have discovered to pair with Dualshock4 Playstation4 controller using standard Bluetooth Pairing Procedure. Make sure controller is turned off, then press and hold SHARE button, then press and hold PLAYSTATION button until LED starts to blink (two short white blinks every few seconds). You can now discover and enjoy your Dualshock4 controller with any Bluetooth (HID) enabled device. No cables and no additional applications necessary! :-)

Dualshock4 is a really nice high quality and precise controller that can be used in many more interesting applications than only playing games. It is compatible with Bluetooth HID and USB HID standard. It contains 2 analog joysticks, 2 analog sliders, 13 buttons, touch-pad, accelerometer, vibrator, audio speaker with headset port, RGB LED, micro-USB port, and external expansion port..

Unfortunately, lack of self-compatibility seems to be a strong disadvantage of Playstation platform. Not only because PS4 does not run old software. Dualshock4 seems to have different way of handling button events as compared to Dualshock3 (default Playstation3 controller). It has some sort of auto-repeat feature (like PC BIOS keyboard) instead of button change events (like MIDI). This renders Dualshock4 unreliable on Playstation3 platform because of massive control glitches. Also DS4 PS button does not produce system menu on PS3, so you cannot use it as the main controller replacement. Sadly, it is impossible to use DS3 controller on PS4 as well. Hopefully, switching CPU to AMD64 and OS to FreeBSD could bring more self-compatibility to Playstation in future..

HackRF(One) on FreeBSD

My port of HackRF has been committed. Enjoy your HackRF One SDR on FreeBSD OS! =)

RAID HDD and UEFI BIOS

If you want to build your own disk array, let’s say RAID, on your computer to increase disk space and efficiency, you should know about few important things in general:

  • You can consider MBR and x86 obsolete. New way is GPT, UEFI, AMD64.
  • Large RAID arrays (over 2TB) will not work with older hardware and OS (except FreeBSD) due to architecture limitations.
  • To use large RAID volumes you must use GPT partition scheme. MBR will not do the job.
  • Some systems can use GPT only with UEFI BIOS (i.e. Windows works with GPT only via UEFI). You may be forced to buy new motherboard.
  • UEFI and GPT is totally different way of bootstrap so you can forget what you know about BIOS and MBR here.
  • Hard Drives have hidden corruption-fix mechanisms in firmware that will make your RAID array fail to operate. For RAID choose dedicated drives such as WD RED (not Green, not Black, not Blue).

In order to use GPT and UEFI I have replaced my nice ASUS M4A88TD-V EVO/USB3 motherboard with M5A97 R2.0 only because M4 series did not support UEFI. New BIOS is totally different, but I am not really sure if replacing the hardware was mandatory..

Summing up, if you want to use large RAID volumes make sure first that you can use GPT and UEFI BIOS is present on your AMD64 hardware. If not, still you can use the FreeBSD as it knows how to bypass some limitations. Also remember to use dedicated HDD for RAID operations.

Mac OSX Bluetooth Modem resource busy

In case you wonder why your device does not connect as Modem via Bluetooth to the Mac OSX, or you cannot see COM port on Windows, your mobile device may not simply support or provide DUN (Dial Up Network) and/or SPP (Serial Port Profile) profile.

On Mac OSX I got following error, until I tried another device and/or starting by hand DUN service on a mobile/client machine:

cannot open /dev/cu.Bluetooth-Modem: Resource busy

Notes:

  • Read Bluetooth specification for Serial Port Profile.
  • Read Bluetooth specification for Dial-Up Network Profile.
  • Modern mobile phones / USB 3G dongles, unfortunately, do not provide direct AT/Hayes access to the Radio Modem anymore.
  • You can install DUN application for your smartphone, but it will be only a simple dummy wrapper imitating modem for simple applications, but they do not provide full modem functionality, beware, its a fake.
  • Its only necessary for devices to be paired first in order to get SPP/DUN working. If device does not provide serial port over bluetooth when devices are paired and online, probably its just not there implemented.

LibSWD 0.6 release

I am happy to announce a new release of LibSWD-0.6! Most important feature of this release is the standalone Application with an example of Command Line Interface (CLI), FTDI driver and ARM Cortex-M3 Core Debug and Flash support demonstration. Please report issues via Ticket System. Have fun! :-)

KT-LINK FT2232H based interface on FreeBSD

I have created a simple patch for FreeBSD Operating System to detect and support FT2232H based KT-LINK interface. FTDI chips are already supported using uftdi driver and they can provide various serial and parallel protocols over USB such as RS232, JTAG, SWD, SPI, I2C, 1Wire, etc. My patch allows to use RS232 port on the KT-LINK which in conjunction with Minicom terminal software allows to talk to the Serial Console Port on various embedded systems. KT-LINK is really nice inexpensive (50EUR) and versatile tool for embedded system developers, now it became all-in-one tool on my FreeBSD box :-)

http://www.freebsd.org/cgi/query-pr.cgi?pr=175893

OpenOCD and LibSWD integration complete

Patches that integrate LibSWD with OpenOCD has been already sent, so the platform independent Serial Wire Debug in Open-Source becomes a reality! Mr. Gerrit takes care of the source code review part, while Mr. Jenkins takes care of proper binary build for various platforms and operating systems. This is the right moment to make use of developers mailing list for feedback, asking questions, blaming, testing, adding new features and voting to accept the patches, so the code becomes an integral part of the OpenOCD release! :-)

Orange Labs provided R&D environment for initial stages of the research. Warsaw University of Technology made this possible as part of my MSc and PhD thesis. Krzysztof Kajstura designed and provided his generic KT-LINK (FT2232H based) interface to work with. David Brownell first introduced the Transport layer in OpenOCD in 2010 to split Target from JTAG. Simon Qian was working in parallel on his own SWD implementation for a Versaloon interface (as part of intelligent firmware). Øyvind HarboePeter StugeSpencer Oliver, Rodrigo Rosa helped me on GIT usage and OpenOCD internals,  Freddie Chopin helped me a lot with commited patches to match OpenOCD coding standards, Akos Vandra helped me to test functionality as the program was created… and my other friends should be also noted here for their support :-)

Power of the few outweights power of the many! Thank you for your support! :-)

LibSWD 0.5 Released

LibSWD 0.5 is out! It brings mainly the rename of all function prefix due API conflicts with other existing solutions.

Please visit Project Website for more information :-)

LibSWD 0.4 Released

LibSWD 0.4 is out! It brings various bugfixes and improvements, but most of all stable API to be used with OpenOCD and other external applications.

See Project Website for more information :-)

LibSWD on FedCSIS 2012

“LibSWD serial wire debug open framework for low-level embedded systems access” has been presented on FedCSIS 2012 international conference and the paper has been already published by IEEE Xplore Digital Library.

All my publications are listed on Google Scholar.

First steps of LibSWD and OpenOCD

The LibSWD and OpenOCD has just made its first steps into flash memory access and writing program code to the ARM Cortex-M3 based Stm32Primer2 device using cheap and generic FT2232H‘s based JTAG/SWD KT-LINK interface :-) The current connection speed is around 10sec/1kB but still I have some ideas on how to improve it, even with the USB bottleneck. The LibSWD is platform independent, so it can drive any other type of hardware (RLink, GPIO based, Parallel Port, etc), also it can be uploaded into dedicated hardware dongle if necessary :-) Feedback and testing are welcome :-)

You can get the code from remote GIT repository at http://repo.or.cz/w/openocd/libswd.git. The project implementation details and history is at http://stm32primer2swd.sf.net/.

%telnet localhost 4444
 Trying 127.0.0.1...
 Connected to localhost.
 Escape character is '^]'.
 Open On-Chip Debugger
 > halt
 target was in unknown state when halt was requested
 > flash probe 0
 device id = 0x10016414
 flash size = 512kbytes
 device id = 0x10016414
 flash size = 512kbytes
 flash 'stm32x' found at 0x08000000
 > stm32x mass_erase 0
 stm32x mass erase complete
 > flash write_image toggle.hex
 wrote 1936 bytes from file toggle.hex in 18.636387s (0.101 KiB/s)

KT-LINK interface driver for UrJTAG

I have sent patches with KT-LINK interface driver (FT2232H based, full-featured, low-cost, SWJ capable design by Krzysztof Kajstura) working in JTAG mode for UrJTAG low-level access software utility with GNU license. I have also created a dedicated fork of UrJTAG for LibSWD integration, which is open and available at http://repo.or.cz/w/urjtag/libswd.git. When the job on LibSWD error handling is finished and fully functional with OpenOCD, I will make a release of LibSWD that will be also integrated with UrJTAG using git submodule mechanism just as in my OpenOCD+LibSWD fork :-)