Quick jump:  What's new

 
Go to:
 
Weblog: recent changes   
in Dobrica Pavlinušić's random unstructured stuff
miraclecast

Connect external monitors to your system via Wifi-Display specification also known as Miracast

https://github.com/albfan/miraclecast/



Hostname is misleading, this is rpi3

root@rpi2:/nuc/miraclecast/res# tail -14 /proc/cpuinfo 

processor       : 3
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

Hardware        : BCM2835
Revision        : a02082
Serial          : 000000004d092298

check wifi chipset compatibility


root@rpi2:/nuc/miraclecast/res# ./test-hardware-capabilities.sh 
wlan0 supports P2P


compile and install


root@rpi2:/nuc/miraclecast# git remote -v
origin https://github.com/albfan/miraclecast (fetch)
origin https://github.com/albfan/miraclecast (push)

pi@rpi2 /nuc/miraclecast $ sudo apt-get install libudev-dev libreadline-dev gstreamer1.0-tools

pi@rpi2 /nuc/miraclecast $

./autogen.sh c
make
sudo make install


connect from Android


root@rpi2:~# miracle-wifid --log-level trace &

root@rpi2:/home/pi/miraclecast# miracle-sinkctl 
[ADD] Link: 3
[miraclectl] # run 3
now running on link 3


try to connect from android phone and fail


[ADD] Peer: ce:fa:00:af:9a:5a@3
[PROV] Peer: ce:fa:00:af:9a:5a@3 Type: pbc PIN: 
[GO NEG] Peer: ce:fa:00:af:9a:5a@3 Type: pbc PIN: 
[GO NEG] Peer: ce:fa:00:af:9a:5a@3 Type: pbc PIN: 
[FAIL] Peer: ce:fa:00:af:9a:5a@3 Reason: group owner negotiation failed
[miraclectl] #

permalink
Hauppauge Nova-T Stick
n516950085_2337724_7335.jpg

Second try at buying USB TV card that works under Linux

And sure, 22 EUR later (chepest card in the shop which included remote) I had working DVB-T under Linux



Info

http://linuxtv.org/wiki/index.php/Hauppauge_WinTV-NOVA-T-Stick

Firmware

cd /lib/firmware/
wget http://www.wi-bw.tfh-wildau.de/~pboettch/home/linux-dvb-firmware/dvb-usb-dib0700-1.10.fw

info

dpavlin@t61p:~$ lsusb | grep Nova
Bus 002 Device 003: ID 2040:7070 Hauppauge Nova-T Stick 3

Zagreb frequencies

T 754000000 8MHz 2/3 NONE AUTO 8k 1/8 NONE    # CH27:
T 642000000 8MHz 2/3 NONE AUTO 8k 1/8 NONE    # CH27:
T 690000000 8MHz 2/3 NONE AUTO 8k 1/8 NONE    # CH27:

Feed that file to scan from dvb-apps to get output for mplayer's channels.conf

EeePC as TV for my mother

fetchrss: http://svn.rot13.org/index.cgi/mplayer-eee-tv/rss
  • There was an error: 404 Not Found


dmesg

[352538.540055] usb 3-1.1: new high-speed USB device number 32 using ehci-pci
[352538.648944] usb 3-1.1: New USB device found, idVendor=2040, idProduct=7070, bcdDevice= 1.00
[352538.648951] usb 3-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[352538.648956] usb 3-1.1: Product: Nova-T Stick
[352538.648960] usb 3-1.1: Manufacturer: Hauppauge
[352538.648964] usb 3-1.1: SerialNumber: 4032258708
[352538.682065] dvb-usb: found a 'Hauppauge Nova-T Stick' in cold state, will try to load a firmware
[352538.682869] usb 3-1.1: firmware: direct-loading firmware dvb-usb-dib0700-1.20.fw
[352538.885559] dib0700: firmware started successfully.
[352539.420241] dvb-usb: found a 'Hauppauge Nova-T Stick' in warm state.
[352539.420476] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[352539.420571] dvbdev: DVB: registering new adapter (Hauppauge Nova-T Stick)
[352539.664695] usb 3-1.1: DVB: registering adapter 0 frontend 0 (DiBcom 7000PC)...
[352539.903507] dib0070: DiB0070: successfully identified
[352539.936061] Registered IR keymap rc-dib0700-rc5
[352539.936410] rc rc0: Hauppauge Nova-T Stick as /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.1/rc/rc0
[352539.936486] input: Hauppauge Nova-T Stick as /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.1/rc/rc0/input13
[352539.936674] rc rc0: lirc_dev: driver dib0700 registered at minor = 0, scancode receiver, no transmitter
[352539.936678] dvb-usb: schedule remote query interval to 50 msecs.
[352539.936682] dvb-usb: Hauppauge Nova-T Stick successfully initialized and connected.
[352539.936876] usbcore: registered new interface driver dvb_usb_dib0700



scan


dpavlin@klin:~$ mkdir ~/.{a,c,s,t}zap


dpavlin@klin:~$ scan -v /usr/share/dvb/dvb-legacy/dvb-t/hr-All > .tzap/channels.conf

dumping lists (4 services)
[0015]:690000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2011:2012:21
[0016]:690000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2021:2022:22
[0017]:690000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2031:2032:23
[0018]:690000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2041:2042:24

dpavlin@klin:~$ /usr/bin/tzap -r -c ~/.tzap/channels.conf "[0018]"
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
reading channels from file '/home/dpavlin/.tzap/channels.conf'
Version: 5.11    FE_CAN { DVB-T }
tuning to 690000000 Hz
video pid 0x07f9, audio pid 0x07fa
status 0f | signal 9dca | snr 00ad | ber 001fffff | unc 00000000 | 
status 1f | signal 9cd0 | snr 00bc | ber 000060a0 | unc 00000000 | FE_HAS_LOCK

dpavlin@klin:~$ mplayer /dev/dvb/adapter0/dvr0

permalink
Printrbot Plus
PrintrBot_Plus_LC.diff

Old 3D printer which never worked well.

DXF files: https://www.youmagine.com/designs/printrbot-lc-1302

https://web.archive.org/web/20130115210644/http://printrbot.com/shop/plus/

Contents: [Dobrica Pavlinušić's random unstructured stuff]


PrintrBot Plus LC

The Printrbot PLUS is the larger printrbot kit–containing an 8x8x8 build volume, laser cut birch construction, an assembled Ubis hot end, and 12mm Z-axis rods in an all-in-one kit. This kit also includes 1 lb of ABS filament.

This kit includes everything you need to build the printrbot PLUS:

  • printrboard: all-in-one assembled electronics with integrated SD card slot (no soldering required)
  • 5 NEMA 17 stepper motors complete with cable ends attached
  • laser cut birch construction
  • a few printed plastic parts (gears, etc)
  • WOOD Extruder Kit
  • hardware (8mm smooth rods, threaded rods, and bearings
    • Z axis is 12mm smooth rods and 12 mm linear bearings )
  • assembled Ubis hot end
  • nuts, bolts, washers, zip ties
  • laser cut print bed
  • 8×8 heated bed
  • misc assembled cables (no soldering required)
  • 3 mechanical end stops (no soldering required)
  • micro USB cable

nozzle

The Getting Started Guide says that all Printrbots currently ship with 0.4mm nozzles.
The convention for identifying nozzles is based on notches (or "rings") cut into the sides (vertices) of the hexagonal brass "nut".
No notch = 0.5mm
1 notch = 0.4mm
2 notches = 0.35mm

info

Most of information about it vanished from internet so here is some overview:

Rev.B https://github.com/Printrbot/printrboard/releases/tag/revB

PrintrBoard pinout

Annotated headers from http://blog.think3dprint3d.com/2012/07/panelolu-with-printrboard.html

Printrboard Headers.JPG

serial

[Sun Mar 18 08:23:50 2018] usb 2-4.4: new full-speed USB device number 61 using xhci_hcd
[Sun Mar 18 08:23:50 2018] usb 2-4.4: New USB device found, idVendor=16c0, idProduct=0483
[Sun Mar 18 08:23:50 2018] usb 2-4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Sun Mar 18 08:23:50 2018] usb 2-4.4: Product: USB Serial
[Sun Mar 18 08:23:50 2018] usb 2-4.4: Manufacturer: Teensyduino
[Sun Mar 18 08:23:50 2018] usb 2-4.4: SerialNumber: 12345
[Sun Mar 18 08:23:50 2018] cdc_acm 2-4.4:1.0: ttyACM0: USB ACM device

dpavlin@nuc:~$ microcom p /dev/ttyACM0 
connected to /dev/ttyACM0
Escape character: Ctrl\
Type the escape character to get to the prompt.


start
echo:PowerUp
 Brown out Reset
Marlin: 1.0.0 RC2
echo: Last Updated: 2012-02-25 | Author: erik
echo: Free Memory: 4907  Pla




echo:SD init fail
workDir open failed
echo:Unknown command:"echo"
ok
echo:Unknown command:"SD init fail"
ok
echo:Unknown command:"workDir open failed"
ok

settings

https://github.com/Printrbot/Marlin

M501
echo:Stored settings retreived:
echo:Steps per unit:
echo:  M92 X62.11 Y64.67 Z2272.72 E536.00
echo:Maximum feedrates (mm/s):
echo:  M203 X60.00 Y60.00 Z2.00 E14.00
echo:Maximum Acceleration (mm/s2):
echo:  M201 X2000 Y2000 Z30 E10000
echo:Acceleration: S=acceleration, T=retract acceleration
echo:  M204 S3000.00 T3000.00
echo:Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum xY jerk (mm/s),  Z=maximum Z jerk (mm/s)
echo:  M205 S0.00 T0.00 B20000 X20.00 Z0.40 E5.00
echo:PID settings:
echo:   M301 P22.20 I1.08 D114.00

M115
FIRMWARE_NAME:Marlin V1; Sprinter/grbl mashup for gen6 FIRMWARE_URL:http://www.mendel-parts.com PROTOCOL_VERSION:1.0 MACHINE_TYPE:Mendel EXTRUDER_COUNT:1


If this doesn't work, you can try M503 which should display all settings without loading them from flash.

software bed leveler

schematics

Printrboard_RevB_Schematic150.png

Printrboard-schematics.pdf

Marlin

dpavlin@nuc:/nuc/PrintrBot$ git clone https://github.com/dpavlin/Marlin

dpavlin@nuc:/nuc/PrintrBot$ cd Marlin/

compile Marlin 1.1.8

https://github.com/dpavlin/Marlin/tree/PrintrBot_Plus_LC-1.1.8

dpavlin@nuc:/nuc/PrintrBot/Marlin$ git checkout PrintrBot_Plus_LC-1.1.8 

dpavlin@nuc:/nuc/PrintrBot/Marlin$ platformio run -e printrboard
Warning! Ignore unknown `envs_dir` option in `[platformio]` section

Processing printrboard (platform: teensy; board: teensy20pp; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Teensy > Teensy++ 2.0
SYSTEM: AT90USB1286 16MHz 8KB RAM (127KB Flash)

compile Marlin 1.1.9

different enviroment compared to 1.1.8?

dpavlin@nuc:/nuc/PrintrBot/Marlin$ git checkout PrintrBot_Plus_LC-1.1.9 

dpavlin@nuc:/nuc/PrintrBot/Marlin$ platformio run -e teensy20

flashing

open boot jumper, press button

[Sun Apr 15 12:20:34 2018] usb 1-1.1: new full-speed USB device number 30 using xhci_hcd
[Sun Apr 15 12:20:34 2018] usb 1-1.1: unable to get BOS descriptor
[Sun Apr 15 12:20:34 2018] usb 1-1.1: New USB device found, idVendor=03eb, idProduct=2ffb
[Sun Apr 15 12:20:34 2018] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Sun Apr 15 12:20:34 2018] usb 1-1.1: Product: AT90USB128 DFU
[Sun Apr 15 12:20:34 2018] usb 1-1.1: Manufacturer: ATMEL
[Sun Apr 15 12:20:34 2018] usb 1-1.1: SerialNumber: 1.0.0


root@nuc:/nuc/PrintrBot/Marlin# apt-get install dfu-programmer


root@nuc:/nuc/PrintrBot/Marlin# dfu-programmer --targets 2>&1 | grep at90usb128
    at89c5132          at90usb1287        at90usb1286        at90usb1287-4k
    at90usb1286-4k     at90usb647         at90usb646         at90usb162

root@nuc:/nuc/PrintrBot/Marlin# dfu-programmer at90usb1286 dump --debug 99
     target: at90usb1286
    chip_id: 0x2ffb
  vendor_id: 0x03eb
    command: dump
      quiet: false
      debug: 99
device_type: AVR
------ command specific below ------

commands.c:625: dump 122880 bytes
atmel.c:579: atmel_read_flash( 0x7ffe83facaf0, 0x00000000, 0x0001e000, 0x564ef5df7000, 122880, false )
atmel.c:847: atmel_select_page( 0x7ffe83facaf0, 0 )
atmel.c:510: __atmel_read_page( 0x7ffe83facaf0, 0, 65536, 0x564ef5df7000, false )
atmel.c:537: result: -9
Unknown error.  Try enabling debug.
Failed to read 122880 bytes from device.




other useful debug levels are 100, 200, 300 - https://www.avrfreaks.net/forum/how-use-dfu-programmer

hmmm... can't backup firmware?

flash firmware

dpavlin@nuc:/nuc/PrintrBot/Marlin$ dfu-programmer at90usb1286 erase
dpavlin@nuc:/nuc/PrintrBot/Marlin$ dfu-programmer at90usb1286 flash .pioenvs/printrboard/firmware.hex
Validating...
Flash did not validate. Did you erase first?

dpavlin@nuc:/nuc/PrintrBot/Marlin$ dfu-programmer at90usb1286 erase --debug 100
     target: at90usb1286
    chip_id: 0x2ffb
  vendor_id: 0x03eb
    command: erase
      quiet: false
      debug: 100
device_type: AVR
------ command specific below ------
   validate: true

commands.c:69: erase 122879 bytes
atmel.c:281: atmel_erase_flash( 0x7ffc5df9bff0, 4 )
atmel.c:671: atmel_blank_check( 0x7ffc5df9bff0, 0x00000000, 0x0001dfff )
atmel.c:847: atmel_select_page( 0x7ffc5df9bff0, 0 )
atmel.c:647: __atmel_blank_check_internal( 0x7ffc5df9bff0, 0x00000000, 0x0000ffff )
atmel.c:847: atmel_select_page( 0x7ffc5df9bff0, 1 )
atmel.c:647: __atmel_blank_check_internal( 0x7ffc5df9bff0, 0x00000000, 0x0000dfff )


teensy setup pjrc

udev rule: https://www.pjrc.com/teensy/49-teensy.rules
loader: https://github.com/PaulStoffregen/teensy_loader_cli

unlock chip using flip

It seems that chip is protected. However, trying to erase and program it did destry data in it (expect bootloader) for some reason, and it seem that dfu-programmer doesn't know how to work with protection features.

So, next step is to try atmel's flip under linux but this also doesn't work well.

root@nuc:/nuc/PrintrBot/flip.3.2.1# cat debian-install.sh 
sudo apt-get install openjdk-9-jre:i386 libusb-0.1-4:i386

root@nuc:/nuc/PrintrBot/flip.3.2.1# cat env.sh 
export JAVA_HOME=/usr/lib/jvm/java-9-openjdk-i386/
export FLIP_HOME=/nuc/PrintrBot/flip.3.2.1/bin/


root@nuc:/nuc/PrintrBot/flip.3.2.1# cd bin/
root@nuc:/nuc/PrintrBot/flip.3.2.1/bin# cp -apv libatlibusbdfu.so libatlibusbdfu.so.orig
root@nuc:/nuc/PrintrBot/flip.3.2.1/bin# sed 's/\/sys\/bus\/usb/\/dev\/bus\/usb/g' libatlibusbdfu.so.orig > libatlibusbdfu.so


# run from bin directory or it won't work (?!)

root@nuc:/nuc/PrintrBot/flip.3.2.1/bin# ./flip.sh


avrdude

made cable to convert 10 pin ICSP on usbasp to 6 pin ICSP on printrboard

http://reprap.org/wiki/Printrboard#Bootloaders

Pin 1 (not red wire on my harness because of re-wiring) is closest to the SD card slot.

root@nuc:/nuc/PrintrBot# avrdude -p usb1286 -c usbasp 

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9782 (probably usb1287)

avrdude: safemode: Fuses OK (E:F3, H:99, L:5E)

avrdude done.  Thank you.

ok, factory bootloader

fuses

# disable jtag
avrdude -c usbtiny -p at90usb1286 -U lfuse:w:0xde:m -U hfuse:w:0xdb:m -U efuse:w:0xf0:m

# enabled jtag
avrdude -c usbtiny -p at90usb1286 -U lfuse:w:0xDE:m -U hfuse:w:0x9B:m -U efuse:w:0xF0:m

root@nuc:/nuc/PrintrBot# avrdude -c usbtiny -p at90usb1286 -U lfuse:w:0xde:m -U hfuse:w:0xdb:m -U efuse:w:0xf0:m
avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)

avrdude done.  Thank you.

root@nuc:/nuc/PrintrBot# avrdude -c usbasp -p at90usb1286 -U lfuse:w:0xde:m -U hfuse:w:0xdb:m -U efuse:w:0xf0:m

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9782 (probably usb1287)
avrdude: reading input file "0xde"
avrdude: writing lfuse (1 bytes):

Writing |                                                    | 0% 0.00s ***failed;
Writing | ################################################## | 100% 0.06s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xde:
avrdude: load data lfuse data from input file 0xde:
avrdude: input file 0xde contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x5e != 0xde
avrdude: verification error; content mismatch

avrdude: safemode: lfuse changed! Was de, and is now 5e
[Tue Apr 17 07:12:19 2018] usb 1-1.4: USB disconnect, device number 20
[Tue Apr 17 07:12:19 2018] usb 1-1.4: USB disconnect, device number 20
Would you like this fuse to be changed back? [y/n]
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: Fuses OK (E:F3, H:99, L:DE)

avrdude done.  Thank you.


root@nuc:/nuc/PrintrBot# avrdude -p usb1286 -c usbasp 

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9782 (probably usb1287)

avrdude: safemode: Fuses OK (E:F3, H:99, L:5E)

avrdude done.  Thank you.


flash bootloader

huh, hum, program bootloader anyway from http://blog.lincomatic.com/?p=548

root@nuc:/nuc/PrintrBot# avrdude -p usb1286 -c usbasp -U flash:w:BootloaderDFU.hex

power cycle, return jumper re-try programming fuses

root@nuc:/nuc/PrintrBot# avrdude -c usbasp -p at90usb1286 -U lfuse:w:0xDE:m -U hfuse:w:0x9B:m -U efuse:w:0xF0:m

dfu programming works

re-try dfu programming

root@nuc:/nuc/PrintrBot# dfu-programmer at90usb1286 erase
root@nuc:/nuc/PrintrBot# dfu-programmer at90usb1286 flash Marlin/.pioenvs/printrboard/firmware.hex
Validating...
61322 bytes used (49.90%)



avrdude programming

dpavlin@nuc:/nuc/PrintrBot/Marlin$ avrdude -c usbasp -p usb1286 -U flash:w:.pioenvs/printrboard/firmware.hex

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9782 (probably usb1287)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: reading input file ".pioenvs/printrboard/firmware.hex"
avrdude: input file .pioenvs/printrboard/firmware.hex auto detected as Intel Hex
avrdude: writing flash (87280 bytes):

Writing | ################################################## | 100% 58.04s

avrdude: 87280 bytes of flash written
avrdude: verifying flash memory against .pioenvs/printrboard/firmware.hex:
avrdude: load data flash data from input file .pioenvs/printrboard/firmware.hex:
avrdude: input file .pioenvs/printrboard/firmware.hex auto detected as Intel Hex
avrdude: input file .pioenvs/printrboard/firmware.hex contains 87280 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 38.49s

avrdude: verifying ...
avrdude: 87280 bytes of flash verified

avrdude: safemode: Fuses OK (E:F0, H:9B, L:DE)

avrdude done.  Thank you.

RepRapDiscount Full Graphic Smart Controller

pinouts

printrboard-lcd-pinout.png

printrboard-lcd-pinout-800px.png

Marlin pinout

diff --git a/Marlin/pins_PRINTRBOARD.h b/Marlin/pins_PRINTRBOARD.h
index 42632d174..8146505a3 100644
--- a/Marlin/pins_PRINTRBOARD.h
+++ b/Marlin/pins_PRINTRBOARD.h
@@ -166,3 +166,19 @@
   #endif
 
 #endif // ULTRA_LCD && NEWPANEL
+
+// XXX dpavlin -- my pinout
+#define LCD_PINS_RS       9   // E1       JP11-11
+#define LCD_PINS_ENABLE   8   // E0       JP11-10
+#define LCD_PINS_D4       7   // D7       JP11-8
+#define LCD_PINS_D5       6   // D6       JP11-7
+#define LCD_PINS_D6       5   // D5       JP11-6
+#define LCD_PINS_D7       4   // D4       JP11-5
+
+#define BTN_EN1        10   // C0       JP11-12
+#define BTN_EN2        11   // C1       JP11-13
+#define BTN_ENC        12   // C2       JP11-14
+
+// display delays are added to
+// Marlin/ultralcd_st7920_u8glib_rrd.h
+
diff --git a/Marlin/ultralcd_st7920_u8glib_rrd.h b/Marlin/ultralcd_st7920_u8glib_rrd.h
index db6224e47..8474bef24 100644
--- a/Marlin/ultralcd_st7920_u8glib_rrd.h
+++ b/Marlin/ultralcd_st7920_u8glib_rrd.h
@@ -49,7 +49,7 @@
   #define CPU_ST7920_DELAY_1 DELAY_NS(0)
   #define CPU_ST7920_DELAY_2 DELAY_NS(0)
   #define CPU_ST7920_DELAY_3 DELAY_NS(50)
-#elif MB(3DRAG) || MB(K8200) || MB(K8400) || MB(SILVER_GATE)
+#elif MB(3DRAG) || MB(K8200) || MB(K8400) || MB(SILVER_GATE) || MB(PRINTRBOARD)
   #define CPU_ST7920_DELAY_1 DELAY_NS(0)
   #define CPU_ST7920_DELAY_2 DELAY_NS(188)
   #define CPU_ST7920_DELAY_3 DELAY_NS(0)

Hardware upgrade

RAMPS1.4 LCD 12864

LM8UU

Y axis coupler

belts and pulleys

Y axes rod

Needs 3d printed adapter for nut to fit: https://www.thingiverse.com/thing:2963508

Nut is friction fit which I consider somewhat as safety feature, if I found problems with it, I will probably add a bit of ABS goo in holes to fix it in place

bed leveling

self-made sensor from RFID card, paper clip and case intrusion switch, connected in parallel with z-axis switch (it has to be normally closed, so that trigger interrupts signal)

BL touch

http://www.geeetech.com/wiki/index.php/3DTouch_Auto_Leveling_Sensor

pinout, right to left

pin wire color board label
5 green G
4 red 5V
3 yellow S
2 black G
1 white Z-

Needs additional pin for servo control (S - servo)

Marlin configuration

commit 18396a8cd25585d5d562d4345ed851b91fb58821 (HEAD -> PrintrBot_Plus_LC-1.1.9)
Author: Dobrica Pavlinusic <dpavlin@rot13.org>
Date:   Sat Sep 8 11:05:54 2018 +0200

    probe offset from extruder

diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 438494220..aeed322a7 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -770,8 +770,8 @@
  *      O-- FRONT --+
  *    (0,0)
  */
-#define X_PROBE_OFFSET_FROM_EXTRUDER 10  // X offset: -left  +right  [of the nozzle]
-#define Y_PROBE_OFFSET_FROM_EXTRUDER 10  // Y offset: -front +behind [the nozzle]
+#define X_PROBE_OFFSET_FROM_EXTRUDER 35  // X offset: -left  +right  [of the nozzle]
+#define Y_PROBE_OFFSET_FROM_EXTRUDER 5   // Y offset: -front +behind [the nozzle]
 #define Z_PROBE_OFFSET_FROM_EXTRUDER 0   // Z offset: -below +above  [the nozzle]
 
 // Certain types of probes need to stay away from edges

commit 2329e561e0f2997e78495c249706e9ce62608293
Author: Dobrica Pavlinusic <dpavlin@rot13.org>
Date:   Sat Sep 8 10:51:07 2018 +0200

    enable bed leveling
    
    AUTO_BED_LEVELING_UBL doesn't seem to compile for me ATM

diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 38e0c343b..438494220 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -969,7 +969,7 @@
  */
 //#define AUTO_BED_LEVELING_3POINT
 //#define AUTO_BED_LEVELING_LINEAR
-//#define AUTO_BED_LEVELING_BILINEAR
+#define AUTO_BED_LEVELING_BILINEAR
 //#define AUTO_BED_LEVELING_UBL
 //#define MESH_BED_LEVELING
 
@@ -1023,6 +1023,8 @@
   //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE
   //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - MIN_PROBE_EDGE)
 
+  #define RIGHT_PROBE_BED_POSITION 190 // dpavlin -- probe overhangs on the right
+
   // Probe along the Y axis, advancing X after each column
   //#define PROBE_Y_FIRST
 

commit b867a948cd3b64d69e900b99a1306631d62753df
Author: Dobrica Pavlinusic <dpavlin@rot13.org>
Date:   Sun Sep 2 08:40:52 2018 +0200

    added bltouch config and pin on e-stop

diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index fd8463456..38e0c343b 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -721,7 +721,7 @@
 /**
  * The BLTouch probe uses a Hall effect sensor and emulates a servo.
  */
-//#define BLTOUCH
+#define BLTOUCH
 #if ENABLED(BLTOUCH)
   //#define BLTOUCH_DELAY 375   // (ms) Enable and increase if needed
 #endif
@@ -1909,7 +1909,7 @@
  * Set this manually if there are extra servos needing manual control.
  * Leave undefined or set to 0 to entirely disable the servo subsystem.
  */
-//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
+#define NUM_SERVOS 1 // Servo index starts with 0 for M280 command
 
 // Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle.
 // 300ms is a good value but you can try less delay.
diff --git a/Marlin/pins_PRINTRBOARD.h b/Marlin/pins_PRINTRBOARD.h
index 8146505a3..a68802725 100644
--- a/Marlin/pins_PRINTRBOARD.h
+++ b/Marlin/pins_PRINTRBOARD.h
@@ -182,3 +182,9 @@
 // display delays are added to
 // Marlin/ultralcd_st7920_u8glib_rrd.h
 
+// bltouch - use e-stop for servo
+// dpavlin@nuc:/nuc/PrintrBot/Marlin$ grep E5 m43-pins.txt 
+// PIN:  37   Port: E5        <unused/unknown>            Input  = 1
+//
+#define SERVO0_PIN	37	// E5 E-STOP
+

gcode for bl-touch

M280 P0 S10 ; pushes the pin down

M280 P0 S90 ; pulls the pin up

M280 P0 S120 ; Self test – keeps going until you do pin up/down or release alarm

M280 P0 S160 ; Release alarm

M420 V ; display bed leveling

Bilinear Leveling Grid:
      0      1      2
 0 +0.445 +0.402 +0.284
 1 -0.083 +0.013 +0.023
 2 -0.678 -0.432 -0.264

echo:Bed Leveling On 
echo:Fade Height Off


Notes for Ender 3 V1.1.3

  • install sanguino board support in ardunino ide https://github.com/Lauszus/Sanguino
  • turn on power supply when flashing if you didn't disconnect steppers or it won't get enough power
  • burn boot loader using usbasp programmer from arduino ide to make arudino ide work for upload
permalink
Toshiba AC100
Compal_LA-6352P_PAZ00_AC100.pdf

Contents: [Dobrica Pavlinušić's random unstructured stuff]


Tegra 2 device

kernel

cpuinfo

$ cat /proc/cpuinfo
Processor       : ARMv7 Processor rev 0 (v7l)
processor       : 0
BogoMIPS        : 1998.84

Features        : swp half thumb fastmult vfp edsp vfpv3 vfpv3d16 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x1
CPU part        : 0xc09
CPU revision    : 0

Hardware        : NVIDIA Harmony Development System
Revision        : 0000
Serial          : 0000000000000000

$ cat /proc/meminfo
MemTotal:         383348 kB
MemFree:          106528 kB
Buffers:           30116 kB
Cached:           123316 kB
SwapCached:            0 kB
Active:           164792 kB
Inactive:          85020 kB
Active(anon):      96692 kB
Inactive(anon):        0 kB
Active(file):      68100 kB
Inactive(file):    85020 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         96412 kB
Mapped:            44536 kB
Shmem:               312 kB
Slab:               8940 kB
SReclaimable:       4848 kB
SUnreclaim:         4092 kB
KernelStack:        2528 kB
PageTables:         8324 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      191672 kB
Committed_AS:    6569284 kB
VmallocTotal:     614400 kB
VmallocUsed:       30656 kB
VmallocChunk:     520068 kB

Rooting

nvflash

Press CTRL + ESC + power button to get into APX mode

[Thu Oct 11 06:31:57 2018] usb 2-2.4: new high-speed USB device number 13 using xhci_hcd
[Thu Oct 11 06:31:57 2018] usb 2-2.4: New USB device found, idVendor=0955, idProduct=7820, bcdDevice= 1.02
[Thu Oct 11 06:31:57 2018] usb 2-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Thu Oct 11 06:31:57 2018] usb 2-2.4: Product: APX
[Thu Oct 11 06:31:57 2018] usb 2-2.4: Manufacturer: NVIDIA Corp.

In theory. In practice driver package from

is everything you need. It's from http://developer.nvidia.com/content/linux-tegra-release-12-alpha-1-released

fastboot.stock.bin

t61p:/home/dpavlin/Downloads/ldk/bootloader/alt# wget https://github.com/muromec/putusb/raw/master/bin/fastboot.stock.bin
--2011-09-12 20:40:17--  https://github.com/muromec/putusb/raw/master/bin/fastboot.stock.bin
Resolving github.com (github.com)... 207.97.227.239
Connecting to github.com (github.com)|207.97.227.239|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.github.com/muromec/putusb/master/bin/fastboot.stock.bin [following]
--2011-09-12 20:40:19--  https://raw.github.com/muromec/putusb/master/bin/fastboot.stock.bin
Resolving raw.github.com (raw.github.com)... 207.97.227.243
Connecting to raw.github.com (raw.github.com)|207.97.227.243|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 936016 (914K) [application/octet-stream]
Saving to: `fastboot.stock.bin'

100%[=====================================================>] 936,016      645K/s   in 1.4s    

2011-09-12 20:40:22 (645 KB/s) - `fastboot.stock.bin' saved [936016/936016]

t61p:/home/dpavlin/Downloads/ldk/bootloader/alt# md5sum fastboot.stock.bin 
9197365fb42c5801b4124e75ea00512c  fastboot.stock.bin

backup

Following instructions at http://gitorious.org/ac100/pages/Installation

t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash --bl fastboot.stock.bin --go
Nvflash started
rcm version 0X20001
System Information:
   chip name: t20
   chip id: 0x20 major: 1 minor: 2
   chip sku: 0x8
   chip uid: 0x1700618943a00317
   macrovision: disabled
   hdcp: enabled
   sbk burned: false
   dk burned: false
   boot device: emmc
   operating mode: 3
   device config strap: 0
   device config fuse: 0
   sdram config strap: 0

downloading bootloader -- load address: 0x108000 entry point: 0x108000
sending file: fastboot.stock.bin
| 936016/936016 bytes sent
fastboot.stock.bin sent successfully
waiting for bootloader to initialize
bootloader downloaded successfully


t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --getpartitiontable partitiontable.txt
Nvflash started
[resume mode]
Succesfully updated partition table information to partitiontable.txt


t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 2 part-2.img
Nvflash started
[resume mode]
receiving file: part-2.img, expected size: 3145728 bytes
/ 3145728/3145728 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 3 part-3.img
Nvflash started
[resume mode]
receiving file: part-3.img, expected size: 524288 bytes
/ 524288/524288 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# /nvflash -r --read 4 part-4.img
bash: /nvflash: No such file or directory
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 4 part-4.img
Nvflash started
[resume mode]
receiving file: part-4.img, expected size: 2097152 bytes
/ 2097152/2097152 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 5 part-5.img
Nvflash started
[resume mode]
receiving file: part-5.img, expected size: 5242880 bytes
/ 5242880/5242880 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 6 part-6.img
Nvflash started
[resume mode]
receiving file: part-6.img, expected size: 8388608 bytes
/ 8388608/8388608 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 7 part-7.img
Nvflash started
[resume mode]
receiving file: part-7.img, expected size: 1048576 bytes
/ 1048576/1048576 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 8 part-8.img
Nvflash started
[resume mode]
receiving file: part-8.img, expected size: 314572800 bytes
/ 314572800/314572800 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 9 part-9.img
Nvflash started
[resume mode]
receiving file: part-9.img, expected size: 419430400 bytes
/ 419430400/419430400 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 10 part-10.img
Nvflash started
[resume mode]
receiving file: part-10.img, expected size: 2097152 bytes
/ 2097152/2097152 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 11 part-11.img
Nvflash started
[resume mode]
receiving file: part-11.img, expected size: 524288 bytes
/ 524288/524288 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 12 part-12.img
Nvflash started
[resume mode]
receiving file: part-12.img, expected size: 1294991360 bytes
/ 1294991360/1294991360 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 13 part-13.img
Nvflash started
[resume mode]
receiving file: part-13.img, expected size: 524288 bytes
/ 524288/524288 bytes received
file received successfully
t61p:/home/dpavlin/Downloads/ldk/bootloader# ./nvflash -r --read 14 part-14.img
Nvflash started
[resume mode]
receiving file: part-14.img, expected size: 5891424256 bytes
/ 5891424256/5891424256 bytes received
file received successfully



Linux

fetchrss: http://feeds.delicious.com/v2/rss/dpavlin/ac100?count=15
  • There was an error: 500 Can't connect to feeds.delicious.com:80 (Bad hostname 'feeds.delicious.com')


phh 2.6.32 kernel with working suspend and audio

t61p:/home/dpavlin/ac100/linux4tegra_10.9.3# LD_LIBRARY_PATH=./nvflash/ ./nvflash/nvflash --bl ./prebuilt/fastboot.stock.bin --read 6 tegra_partition_6.bin --go
Nvflash started
rcm version 0X20001
System Information:
   chip name: t20
   chip id: 0x20 major: 1 minor: 2
   chip sku: 0x8
   chip uid: 0x1700618943a00317
   macrovision: disabled
   hdcp: enabled
   sbk burned: false
   dk burned: false
   boot device: emmc
   operating mode: 3
   device config strap: 0
   device config fuse: 0
   sdram config strap: 0

downloading bootloader -- load address: 0x108000 entry point: 0x108000
sending file: ./prebuilt/fastboot.stock.bin
| 936016/936016 bytes sent
./prebuilt/fastboot.stock.bin sent successfully
waiting for bootloader to initialize
bootloader downloaded successfully
receiving file: tegra_partition_6.bin, expected size: 8388608 bytes
/ 8388608/8388608 bytes received
file received successfully



t61p:/home/dpavlin/ac100/linux4tegra_10.9.3# LD_LIBRARY_PATH=./nvflash/ ./nvflash/nvflash --wait --bl ./prebuilt/fastboot.stock.bin --download 6 ../32.boot.menu.v1.img --go
Nvflash started
rcm version 0X20001
System Information:
   chip name: t20
   chip id: 0x20 major: 1 minor: 2
   chip sku: 0x8
   chip uid: 0x1700618943a00317
   macrovision: disabled
   hdcp: enabled
   sbk burned: false
   dk burned: false
   boot device: emmc
   operating mode: 3
   device config strap: 0
   device config fuse: 0
   sdram config strap: 0

downloading bootloader -- load address: 0x108000 entry point: 0x108000
sending file: ./prebuilt/fastboot.stock.bin
| 936016/936016 bytes sent
./prebuilt/fastboot.stock.bin sent successfully
waiting for bootloader to initialize
bootloader downloaded successfully
sending file: ../32.boot.menu.v1.img
/ 8388608/8388608 bytes sent
../32.boot.menu.v1.img sent successfully


mainline kernel

u-boot from APX

This should allow you to send u-boot, kernel and initramfs to any tegra2 board which can be in APX mode without
modifying internal storage.

build u-boot

dpavlin@klin:/klin/u-boot$ cat env.sh 
export CROSS_COMPILE="arm-none-eabi-" ARCH=arm
dpavlin@klin:/klin/u-boot$ . env.sh 

dpavlin@klin:/klin/u-boot$ make paz00_defconfig

make



build kernel

dpavlin@klin:/klin/Tegra/linux$ git remote -v
origin  https://github.com/grate-driver/linux (fetch)
origin  https://github.com/grate-driver/linux (push)
samsung-tab-10.1        https://github.com/Decatf/linux (fetch)
samsung-tab-10.1        https://github.com/Decatf/linux (push)

dpavlin@klin:/klin/Tegra/linux$ git branch -vv
* master 63a6317580f8 [origin/master] ARM: tegra: Clear EMC interrupts on resume from LP1 on Tegra30+

dpavlin@klin:/klin/Tegra/linux$ cat /klin/u-boot/env.sh 
export CROSS_COMPILE="arm-none-eabi-" ARCH=arm
dpavlin@klin:/klin/Tegra/linux$ . /klin/u-boot/env.sh

dpavlin@klin:/klin/Tegra/linux$ make tegra_defconfig

make



create initrd with new modules

dpavlin@klin:/klin/Tegra/linux$ cat tegra-ramdisk.sh 
#!/bin/sh -xe

test -d initrd && rm -Rf initrd

mkdir initrd
cd initrd

gzip -cd  /tmp/initrd.img | fakeroot -- cpio -i -d -H newc --no-absolute-filenames

rm -R lib/modules/*

cd ..
make modules_install INSTALL_MOD_PATH=initrd/ INSTALL_MOD_STRIP=1

cd initrd

find . | cpio -o -R 0:0 -H newc > ../initrd.new.cpio

cd ..

gzip -f -6 initrd.new.cpio

/klin/u-boot/tools/mkimage -A arm -O linux -T ramdisk -C gzip -n uInitrd -d initrd.new.cpio.gz uInitrd.new

run it to create initrd:

dpavlin@klin:/klin/Tegra/linux$ ./tegra-ramdisk.sh 

Image Name:   uInitrd
Created:      Fri Oct 12 11:20:42 2018
Image Type:   ARM Linux RAMDisk Image (gzip compressed)
Data Size:    4082917 Bytes = 3987.22 KiB = 3.89 MiB
Load Address: 00000000
Entry Point:  00000000


create bootloader file

latest version seems to be: https://gitlab.com/uboot-ac100/create_bootimage.git

dpavlin@nuc:/nuc/Tegra/ac100/create_bootimage/example$ ../create_image.pl /mnt/klin/klin/u-boot/u-boot-dtb-tegra.bin /m
nt/klin/klin/Tegra/linux/arch/arm/boot/zImage /tmp/postmarketOS-export/initrd.img /mnt/klin/klin/Tegra/linux/arch/arm/b
oot/dts/tegra20-paz00.dtb uboot.scr boot.img
Creating boot image for tegrarcm ...

./tmp_uboot.scr
image layout:
section  loadaddr       size
=================================
uboot   : 0x108000      505627
kernel  : 0x190000      6485800
initrd  : 0x7c0000      4082981
fdt     : 0xbb0000      29659
script  : 0xbc0000      226

image written to boot.img

Now press CTRL + ESC + power on to enter APX mode

dpavlin@nuc:/nuc/Tegra/ac100/create_bootimage/example$ sudo apt-get install libcrypto++6

dpavlin@nuc:/nuc/Tegra/ac100/create_bootimage/example$ /mnt/klin/klin/Tegra/tegrarcm/src/tegrarcm --bct paz00-micron-toshiba-8g.bct --bootloader boot.img --loadaddr 0x108000 
bct file: paz00-micron-toshiba-8g.bct
bootloader file: boot.img
load addr 0x108000
entry addr 0x108000
device id: 0x7820
uid:  0x1700618943a00317
RCM version: 2.1
downloading miniloader to target at address 0x40008000 (132976 bytes)...
miniloader downloaded successfully
Chip UID:                0x00000000000000001700618943a00317
Chip ID:                 0x20
Chip ID Major Version:   0x1
Chip ID Minor Version:   0x2
Chip SKU:                0x8 (t20)
Boot ROM Version:        0x1
Boot Device:             0x2 (EMMC)
Operating Mode:          0x3 (developer mode)
Device Config Strap:     0x0
Device Config Fuse:      0x0
SDRAM Config Strap:      0x0
sending file: paz00-micron-toshiba-8g.bct
- 4080/4080 bytes sent
paz00-micron-toshiba-8g.bct sent successfully
sending file: boot.img
- 11239650/11239650 bytes sent
boot.img sent successfully


u-boot loads detects initrd (it's small enough thanks to MODULES_STRIP to be detected without CRC errors) but no output from kernel.

https://archlinuxarm.org/forum/viewtopic.php?f=23&t=10044&p=51142&hilit=ac100#p51142

suggests CONFIG_TEGRA_DEBUG_UARTA instead of CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA but it doesn't work for me.

dpavlin@klin:/klin/Tegra/linux$ grep 'TEGRA.*UART' .config
# CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA is not set
CONFIG_TEGRA_DEBUG_UARTA=y
# CONFIG_TEGRA_DEBUG_UARTB is not set
# CONFIG_TEGRA_DEBUG_UARTC is not set
# CONFIG_TEGRA_DEBUG_UARTD is not set
# CONFIG_TEGRA_DEBUG_UARTE is not set
CONFIG_DEBUG_TEGRA_UART=y



serial port

https://ac100.grandou.net/serial_port_modification

IMG_20181014_181159-800px.jpg

The serial port is the JP1 connector, near the left speaker connector. Pinout, from right to left:

  • 1 - in - RX UART1
  • 2 - out - TX UART1
  • 3 - out - T20_WAKE#
  • 4 - out - +3V
  • 5 - out - +1.8V
  • 6
  • 7
  • 8 - in - SYSTEM_RESET#
  • 9 - in - EC_TX80_PDATA
  • 10 - in - GND

I decided to solder GND to outer pin of connector to the right of pin 1 as opposed to other side of connector.

After that, a peace of capton tape was put over solder connectors to somewhat re-enforce them and provide insulation
to keyboard cover.

Serial is 3.3V, 115200 8n1.

Output is:

dpavlin@nuc:/nuc/Tegra$ microcom -p /dev/ttyUSB2
connected to /dev/ttyUSB2
Escape character: Ctrl-\
Type the escape character to get to the prompt.

U-Boot SPL 2018.11-rc1-00130-g0a60a81ba3 (Oct 12 2018 - 11:18:01 +0200)
Trying to boot from RAM


U-Boot 2018.11-rc1-00130-g0a60a81ba3 (Oct 12 2018 - 11:18:01 +0200)

TEGRA20
Model: Toshiba AC100 / Dynabook AZ
Board: Compal Paz00
DRAM:  512 MiB
MMC:   sdhci@c8000000: 1, sdhci@c8000600: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
Hit any key to stop autoboot:  0
## Executing script at 00b30000
## Loading init Ramdisk from Legacy Image at 00700000 ...
   Image Name:   uInitrd
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    4269789 Bytes = 4.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 00b20000
   Booting using the fdt blob at 0xb20000
   Using Device Tree in place at 00b20000, end 00b2a3da

Starting kernel ...


Error: invalid dtb and unrecognized/unsupported machine ID
  r1=0x00000c38, r2=0x00000000
Available machine support:

ID (hex)        NAME
ffffffff        Generic DT based system
ffffffff        NVIDIA Tegra SoC (Flattened Device Tree)

Please check your kernel config and/or bootloader.


According to http://billauer.co.il/blog/2014/02/uboot-linux-dtb-fdt-device-tree/ this means that kernel didn't found valid device tree and tries to detect board usin machine ID registrars.

Solution for this seems to use u-boot variables for loading kernel, ramfs and dtb as opposed to values which script creates,
so this works (loading from usb keychain):

fatload usb 0:1 ${kernel_addr_r} /boot/zImage
fatload usb 0:1 ${fdt_addr_r} /boot/tegra20-paz00.dtb
fatload usb 0:1 ${ramdisk_addr_r} /boot/uInitrd.new
bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

Here are also known working addresses which u-boot uses:

Tegra20 (Paz00) MOD # echo ${kernel_addr_r}
0x01000000
Tegra20 (Paz00) MOD # echo ${fdt_addr_r}
0x02000000
Tegra20 (Paz00) MOD # echo ${ramdisk_addr_r} 
0x02100000

so much higher in memory map than create_image script. However, u-boot seems to want to load at 0x108000 so it's inpractical
to generate huge image to load kernel, dtb and initramfs at correct addresses.

bootstrap debian

based on https://wiki.debian.org/InstallingDebianOn/Toshiba/AC100

dpavlin@nuc:/mnt$ sudo debootstrap --foreign --arch=armhf stretch sdd1 http://ftp.hr.debian.org/debian

dpavlin@nuc:/mnt$ df sdd1/
Filesystem     1K-blocks   Used Available Use% Mounted on
/dev/sdd1        1021948 169056    784596  18% /mnt/sdd1

dpavlin@nuc:/mnt$ sudo cp /usr/bin/qemu-arm-static sdd1/usr/bin

dpavlin@nuc:/mnt$ sudo chroot sdd1 /debootstrap/debootstrap --second-stage

dpavlin@nuc:/mnt$ cd sdd1/
dpavlin@nuc:/mnt/sdd1$ sudo mount --bind /sys sys
dpavlin@nuc:/mnt/sdd1$ sudo mount --bind /dev dev
dpavlin@nuc:/mnt/sdd1$ sudo mount --bind /proc proc
dpavlin@nuc:/mnt/sdd1$ sudo chroot .

root@nuc:/# apt-get install u-boot-tools

root@ac100:/boot# cat boot.cmd 
ext2load usb 0:1 ${kernel_addr_r} /boot/zImage
ext2load usb 0:1 ${fdt_addr_r} /boot/tegra20-paz00.dtb
ext2load usb 0:1 ${ramdisk_addr_r} /boot/uInitrd
setenv bootargs root=/dev/sda1 rootwait CMA=64M tegrapart=recovery:300:a00:800,boot:d00:1000:800,mbr:1d00:200:800
bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr






u-boot over pax, usb filesystem

dpavlin@nuc:/nuc/Tegra/ac100/create_bootimage/example$ /mnt/klin/klin/Tegra/tegrarcm/src/tegrarcm --bct paz00-micron-toshiba-8g.bct --bootloader /mnt/klin/klin/Tegra/u-boot-tegra/u-boot-dtb-tegra.bin --loadaddr 0x108000
bct file: paz00-micron-toshiba-8g.bct


Serial output:

U-Boot SPL 2018.09-rc2-38340-g3d186cf3f3 (Oct 20 2018 - 10:46:53 +0200)
Trying to boot from RAM


U-Boot 2018.09-rc2-38340-g3d186cf3f3 (Oct 20 2018 - 10:46:53 +0200)

TEGRA20
Model: Toshiba AC100 / Dynabook AZ
Board: Compal Paz00
DRAM:  512 MiB
MMC:   sdhci@c8000000: 1, sdhci@c8000600: 0
Loading Environment from MMC... OK
In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
starting USB...
USB0:   USB EHCI 1.00
USB1:   No code to set up ULPI controller, please enableCONFIG_USB_ULPI and CONFIG_USB_ULPI_VIEWPORTprobe failed, error -38
USB2:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Hit any key to stop autoboot:  0
Tegra20 (Paz00) MOD # run usb_boot


wifi

root@ac100:/etc/network/interfaces.d# apt-get install firmware-ralink wpasupplicant

root@ac100:/etc/network/interfaces.d# cat wlx6c626d1788b3 
allow-hotplug wlx6c626d1788b3
iface wlx6c626d1788b3 inet dhcp
        wpa-ssid dreamhouse
        wpa-psk xxxxxxxx


disk speed

root@ac100:~# hdparm -tT /dev/sda /dev/mmcblk1

/dev/sda:
 Timing cached reads:   560 MB in  2.01 seconds = 279.14 MB/sec
 Timing buffered disk reads:  32 MB in  3.07 seconds =  10.43 MB/sec

/dev/mmcblk1:
 Timing cached reads:   598 MB in  2.00 seconds = 298.86 MB/sec
 Timing buffered disk reads: 108 MB in  3.01 seconds =  35.83 MB/sec

tuhing block size

root@ac100:/home/dpavlin/flashbench# ./flashbench -a /dev/mmcblk1 --blocksize=1024
align 2147483648        pre 727µs      on 1.07ms       post 784µs     diff 316µs
align 1073741824        pre 833µs      on 1.13ms       post 789µs     diff 320µs
align 536870912 pre 798µs      on 1.13ms       post 825µs     diff 317µs
align 268435456 pre 816µs      on 1.15ms       post 795µs     diff 342µs
align 134217728 pre 742µs      on 1.12ms       post 843µs     diff 327µs
align 67108864  pre 669µs      on 987µs       post 701µs     diff 303µs
align 33554432  pre 662µs      on 1.04ms       post 643µs     diff 385µs
align 16777216  pre 837µs      on 1.09ms       post 864µs     diff 242µs
align 8388608   pre 800µs      on 1.1ms        post 881µs     diff 262µs
align 4194304   pre 812µs      on 1.07ms       post 838µs     diff 246µs
align 2097152   pre 807µs      on 1.07ms       post 808µs     diff 258µs
align 1048576   pre 832µs      on 960µs       post 838µs     diff 125µs
align 524288    pre 833µs      on 959µs       post 838µs     diff 124µs
align 262144    pre 833µs      on 959µs       post 838µs     diff 124µs
align 131072    pre 833µs      on 962µs       post 840µs     diff 126µs
align 65536     pre 825µs      on 951µs       post 838µs     diff 120µs
align 32768     pre 826µs      on 956µs       post 825µs     diff 130µs
align 16384     pre 812µs      on 924µs       post 824µs     diff 106µs
align 8192      pre 809µs      on 841µs       post 808µs     diff 32.4µs
align 4096      pre 808µs      on 836µs       post 808µs     diff 27.7µs
align 2048      pre 808µs      on 836µs       post 809µs     diff 27.6µs

8192 seems good, re-test

root@ac100:/home/dpavlin/flashbench# ./flashbench -a /dev/mmcblk1 --blocksize=4096
align 2147483648        pre 696µs      on 1.04ms       post 725µs     diff 331µs
align 1073741824        pre 917µs      on 1.18ms       post 870µs     diff 289µs
align 536870912 pre 880µs      on 1.18ms       post 907µs     diff 291µs
align 268435456 pre 899µs      on 1.2ms        post 877µs     diff 311µs
align 134217728 pre 825µs      on 1.18ms       post 927µs     diff 300µs
align 67108864  pre 864µs      on 1.11ms       post 842µs     diff 253µs
align 33554432  pre 914µs      on 1.12ms       post 897µs     diff 212µs
align 16777216  pre 921µs      on 1.14ms       post 948µs     diff 210µs
align 8388608   pre 884µs      on 1.15ms       post 965µs     diff 229µs
align 4194304   pre 895µs      on 1.12ms       post 922µs     diff 215µs
align 2097152   pre 890µs      on 1.12ms       post 890µs     diff 227µs
align 1048576   pre 916µs      on 1.01ms       post 922µs     diff 89.7µs
align 524288    pre 916µs      on 1.01ms       post 922µs     diff 90µs
align 262144    pre 916µs      on 1.01ms       post 923µs     diff 89.1µs
align 131072    pre 916µs      on 1.01ms       post 924µs     diff 91.1µs
align 65536     pre 908µs      on 1ms  post 921µs     diff 85.9µs
align 32768     pre 911µs      on 1.01ms       post 908µs     diff 96.2µs
align 16384     pre 895µs      on 973µs       post 908µs     diff 71.4µs
align 8192      pre 892µs      on 896µs       post 892µs     diff 4.57µs

create filesystem

root@ac100:/home/dpavlin/flashbench# mkfs -t ext4 -v -b 4096 -E stride=2,stripe-width=2 /dev/mmcblk1p6 

cp -ax ....

root@ac100:~# mount /dev/mmcblk1p1 /tmp/1/
root@ac100:~# cat /tmp/1/boot/boot.cmd 
ext2load mmc 0:6 ${kernel_addr_r} /boot/zImage
ext2load mmc 0:6 ${fdt_addr_r} /boot/tegra20-paz00.dtb
ext2load mmc 0:6 ${ramdisk_addr_r} /boot/uInitrd
setenv bootargs root=/dev/mmcblk1p6 rootwait CMA=64M tegrapart=recovery:300:a00:800,boot:d00:1000:800,mbr:1d00:200:800
bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

# mkimage -C none -A arm -T script -d boot.cmd boot.scr



flash u-boot to mmc

based on https://paz00.ru/index.php?title=Flashing_Uboot_to_MMC&setlang=en

tegrarcm to get bct

dpavlin@nuc:/nuc/Tegra$ git clone https://github.com/NVIDIA/tegrarcm

dpavlin@nuc:/nuc/Tegra$ cd tegrarcm/

dpavlin@nuc:/nuc/Tegra/tegrarcm$ sudo apt-get install libcrypto++-dev

dpavlin@nuc:/nuc/Tegra/tegrarcm$ ./autogen.sh

dpavlin@nuc:/nuc/Tegra/tegrarcm$ make

dpavlin@nuc:/nuc/Tegra/tegrarcm$ ./src/tegrarcm --version
tegrarcm 1.8

create boot image

dpavlin@nuc:/nuc/Tegra/cbootimage$ git remote -v
origin  https://github.com/NVIDIA/cbootimage (fetch)
origin  https://github.com/NVIDIA/cbootimage (push)

dpavlin@nuc:/nuc/Tegra/cbootimage$ ./autogen.sh
dpavlin@nuc:/nuc/Tegra/cbootimage$ make


dpavlin@nuc:/nuc/Tegra/cbootimage$ cat > u-boot.cfg
Version       = 0x00020001;
Bctcopy       = 1;
Bctfile       = ac100.bct;
BootLoader    = u-boot.bin,0x00108000,0x00108000,Complete;


dpavlin@nuc:/nuc/Tegra/cbootimage$ cp ../ac100/create_bootimage/example/ac100-dpavlin.bct ac100.bct

dpavlin@nuc:/nuc/Tegra/cbootimage$ cp /mnt/klin/klin/Tegra/u-boot-tegra/u-boot-tegra.bin u-boot.bin

dpavlin@nuc:/nuc/Tegra/cbootimage$ ./src/cbootimage -d u-boot.cfg ac100.bct.new
bct size: 4080
**update_bl()
begin_update(): bct data: b=14 p=9
writing bootloader
  redundancy = 1
  BL[0]: 131073 0001 0000 518563 0x00108000 0x00108000
8e52c9639cb433e9e1e369cf718595c5
  BL[1]: 131073 0002 0000 302746 0x00108000 0x00108000
a9014f31e7ccafab319512de6bc48f81
**BL[2]: 0 0000 0000 0000 0x00000000 0x00000000
00000000000000000000000000000000
**BL[3]: 0 0000 0000 0000 0x00000000 0x00000000
00000000000000000000000000000000
Image file ac100.bct.new has been successfully generated!

dpavlin@nuc:/nuc/Tegra/cbootimage$ scp ac100.bct.new ac100:

dpavlin@nuc:/nuc/Tegra/cbootimage$ ssh root@ac100

# flash new boot image on ac100

root@ac100:~# echo 0 > /sys/block/mmcblk1boot0/force_ro
root@ac100:~# dd if=/home/dpavlin/ac100.bct.new of=/dev/mmcblk1boot0 
1045+0 records in
1045+0 records out
535040 bytes (535 kB, 522 KiB) copied, 0.135589 s, 3.9 MB/s
root@ac100:~# echo 1 > /sys/block/mmcblk1boot0/force_ro 




create bct backup

dpavlin@ac100:~$ sudo dd if=/dev/mmcblk1boot0 of=ac100-dpavlin-0.bct bs=4080 count=1
[sudo] password for dpavlin: 
1+0 records in
1+0 records out
4080 bytes (4.1 kB, 4.0 KiB) copied, 0.0018642 s, 2.2 MB/s
dpavlin@ac100:~$ sudo dd if=/dev/mmcblk1boot1 of=ac100-dpavlin-1.bct bs=4080 count=1
1+0 records in
1+0 records out
4080 bytes (4.1 kB, 4.0 KiB) copied, 0.0019622 s, 2.1 MB/s

in my case, first bct doesn't have OdmData, while 2nd does:

dpavlin@nuc:/nuc/Tegra$ grep Odm 0 1
0:OdmData       = 0x00000000;
1:OdmData       = 0x800c0075;



i2c

root@ac100:~# i2cdetect -y -r 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- UU -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 4f 
50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
root@ac100:~# i2cdetect -y -r 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
root@ac100:~# i2cdetect -y -r 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
permalink
Xilinx CoolRunner-II

open source support

dpavlin@klin:/klin/FPGA$ sudo apt-get install cargo

dpavlin@klin:/klin/FPGA$ git clone https://github.com/azonenberg/openfpga

dpavlin@klin:/klin/FPGA$ cd openfpga/src/xc2par/

dpavlin@klin:/klin/FPGA/openfpga/src/xc2par$ cargo build --release


dpavlin@klin:/klin/FPGA/openfpga/src/xc2par$ cargo install --root /usr/local
warning: Using `cargo install` to install the binaries for the project in current working directory is deprecated, use `cargo install --path .` instead. Use `cargo build` if you want to simply build the package.
  Installing xc2par v0.0.2 (/klin/FPGA/openfpga/src/xc2par)
    Finished release [optimized] target(s) in 0.07s                                            
  Installing /usr/local/bin/yosys-json-to-intermed-json
  Installing /usr/local/bin/inputgraph-json-par
  Installing /usr/local/bin/intermed-json-to-inputgraph-json
  Installing /usr/local/bin/demo-driver
  Installing /usr/local/bin/xc2par

dpavlin@klin:/klin/FPGA$ yosys -p "synth_coolrunner2 -json blinky.json" blinky.v
dpavlin@klin:/klin/FPGA$ xc2par -p xc2c32a-4-vq44 blinky.json
dpavlin@klin:/klin/FPGA$ ls -al blinky.jed 
-rw-r--r-- 1 dpavlin dpavlin 15870 Nov  5 14:33 blinky.jed


dpavlin@klin:/klin/FPGA$ git clone https://github.com/azonenberg/jtaghal-cmake
dpavlin@klin:/klin/FPGA$ cd jtaghal-cmake/
dpavlin@klin:/klin/FPGA/jtaghal-cmake$ git submodule init
dpavlin@klin:/klin/FPGA/jtaghal-cmake$ git submodule update
dpavlin@klin:/klin/FPGA/jtaghal-cmake$ mkdir build
dpavlin@klin:/klin/FPGA/jtaghal-cmake$ cd build/
dpavlin@klin:/klin/FPGA/jtaghal-cmake/build$ sudo apt-get install libprotobuf-dev protobuf-compiler libedit-dev
dpavlin@klin:/klin/FPGA/jtaghal-cmake/build$ cmake ..
dpavlin@klin:/klin/FPGA/jtaghal-cmake/build$ make




boards

I have two CoolRunner-II boards from Dangerous Prototypes:

XC2C32A Bus Blaster

XC95144XL breakout board

permalink
H801

ESP8266 based H801 LED Wifi Controller

dpavlin@nuc:/nuc/esptool$ wget https://github.com/arendst/Sonoff-Tasmota/releases/download/v6.2.1/sonoff-sensors.bin

pi@rpi2 /nuc/esptool $ ./esptool.py --port /dev/ttyUSB2 write_flash -fs 1MB -fm dout 0x0 ./sonoff-sensors.bin 
esptool.py v2.3-dev
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Compressed 506336 bytes to 345467...
Wrote 506336 bytes (345467 compressed) at 0x00000000 in 31.6 seconds (effective 128.3 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Now turn off board, remove jumper and blindly type in terminal

module 20

This didn't work for me, so I opened new wifi network on Android phone and configured wifi there.

permalink
CH340G serial
ch340g-3v3.png

ch340g-5v.png

Some of those serial dongles (I have one which is intended for esp01) have been configured for 5V operation instead of 3.3V.

You can check that by measuring RX and TX while plugged in in USB and if they are more than 3.3V your dongle is not really
3.3V.

permalink
Rigol


LAN

dpavlin@x200:/rest/cvs$ git clone https://github.com/RoGeorge/DS1054Z_screen_capture
Cloning into 'DS1054Z_screen_capture'...
remote: Counting objects: 77, done.
remote: Total 77 (delta 0), reused 0 (delta 0), pack-reused 77
Unpacking objects: 100% (77/77), done.
Checking connectivity... done.
dpavlin@x200:/rest/cvs$ cd DS1054Z_screen_capture/
dpavlin@x200:/rest/cvs/DS1054Z_screen_capture$ 

dpavlin@x200:/rest/cvs/DS1054Z_screen_capture$ python OscScreenGrabLAN.py png 192.168.3.250
Instrument ID: RIGOL TECHNOLOGIES,DS1104Z,DS1ZA172114616,00.04.03.SP2

Receiving screen capture...
Saved file: DS1104Z_DS1ZA172114616_2015-12-31_14.11.17.png

dpavlin@x200:/rest/cvs$ git clone https://github.com/pklaus/ds1054z
Cloning into 'ds1054z'...
remote: Counting objects: 693, done.
remote: Total 693 (delta 0), reused 0 (delta 0), pack-reused 693
Receiving objects: 100% (693/693), 136.88 KiB | 0 bytes/s, done.
Resolving deltas: 100% (340/340), done.
Checking connectivity... done.
dpavlin@x200:/rest/cvs$ cd ds1054z/
dpavlin@x200:/rest/cvs/ds1054z$ sudo python setup.py install
dpavlin@x200:/rest/cvs/ds1054z$ sudo apt-get install python-zeroconf

dpavlin@x200:/rest/cvs/ds1054z$ ds1054z discover
192.168.3.250

dpavlin@x200:/rest/cvs/ds1054z$ ds1054z info

Vendor:   RIGOL TECHNOLOGIES
Product:  DS1104Z
Serial:   DS1ZA172114___
Firmware: 00.04.03.SP2

dpavlin@x200:/rest/cvs/ds1054z$ ds1054z save-screen
ds1054z-scope-display_2015-12-31_14-19-52.png

VISA

USB

firmware update

dpavlin@x200:/tmp$ unzip -t DS1000Z\(ARM\)Update_00.04.03.02.03.zip 
Archive:  DS1000Z(ARM)Update_00.04.03.02.03.zip
    testing: DS1000Z(ARM)Update_00.04.03.02.03/   OK
    testing: DS1000Z(ARM)Update_00.04.03.02.03/DS1000ZUpdate.GEL   OK
No errors detected in compressed data of DS1000Z(ARM)Update_00.04.03.02.03.zip.

hints

  • Menu, Menu, Force, Menu - access system info menu

plugins for firmware

https://www.eevblog.com/forum/testgear/rigol-ds1000z-firmware-patch-plugins/

permalink
Galaxy Nexus i9250

Schematics and service manual for i9250: Samsung_i9250_schem_sm.rar



127|root@maguro:/ # cat /proc/cpuinfo                                          
Processor       : ARMv7 Processor rev 10 (v7l)
processor       : 0
BogoMIPS        : 1194.24

processor       : 1
BogoMIPS        : 1194.24

Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x2
CPU part        : 0xc09
CPU revision    : 10

Hardware        : Tuna
Revision        : 0009
Serial          : 014994b30201c013

BLE

GSM modem over serial port

HID keyboard

Unlegacy Android

ASOP for OMAP4 devices:

https://forum.xda-developers.com/galaxy-nexus/development/rom-omap4-aosp-project-t3334574

https://github.com/Unlegacy-Android/

kernel

http://unlegacy-android.cf/

https://github.com/Unlegacy-Android/android_kernel_samsung_tuna

dpavlin@klin:/virtual/android/galaxy-nexus$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/

dpavlin@klin:/virtual/android/galaxy-nexus/omap$ git checkout -b asop-7.1 unlegacy/aosp-7.1

dpavlin@klin:/virtual/android/galaxy-nexus/omap$ make tuna_defconfig ARCH=arm

dpavlin@klin:/virtual/android/galaxy-nexus/omap$ cp include/linux/compiler-gcc4.h include/linux/compiler-gcc5.h


dpavlin@klin:/virtual/android/galaxy-nexus/omap$ make -j9 ARCH=arm CROSS_COMPILE=arm-none-eabi-

OMAP4 USB boot

Somewhat interesting things that I can take a look at some time in the future:

To compile it needs following change:

dpavlin@nuc:/nuc/Galaxy-Nexus-i9250/usbboot-omap4$ git diff
diff --git a/Makefile b/Makefile
index 2d10c73..9ea9461 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,7 @@ BINDIR ?= $(DESTDIR)/usr/bin
 DATADIR ?= $(DESTDIR)/usr/share/usbboot
 DOCDIR ?= $(DESTDIR)/usr/share/doc/usbboot
 
-BOARD ?= panda
+BOARD ?= tuna
 
 TARGET_CC := $(TOOLCHAIN)gcc
 TARGET_LD := $(TOOLCHAIN)ld
diff --git a/tools/usb-linux.c b/tools/usb-linux.c
index e3492a1..09c40de 100755
--- a/tools/usb-linux.c
+++ b/tools/usb-linux.c
@@ -10,7 +10,7 @@ int linux_usb_init(void)
        r = libusb_init(&ctx);
        if (r != 0)
                return r;
-       libusb_set_debug(ctx,0x1);
+       //libusb_set_debug(ctx,0x1);
     return 0;
 }

Odin

serial

Nexus-usb-debug.png

Device Codename Resistor (R3) Connected VCC
Google Galaxy Nexus (GSM) samsung-maguro 619K ohm No
Samsung Galaxy Mini 2 samsung-s6500d 530K ohm No
Samsung Galaxy S4 Mini LTE samsung-i9195 619K ohm No
Samsung Galaxy S5 samsung-klte 619K ohm No

It seems that other suggestion is 150k from https://redmine.replicant.us/projects/replicant/wiki/SamsungSerial - I will have to test which value works

UART modes

Resistance Jig Boot
150k Inactive Inactive
523k Active Inactive
619k Active Active

RID_USB_OTG_MODE,	/* 0 0 0 0 0 	GND 		USB OTG Mode              */
RID_AUD_SEND_END_BTN,	/* 0 0 0 0 1 	2K		Audio Send_End Button*/
RID_AUD_REMOTE_S1_BTN,	/* 0 0 0 1 0 	2.604K		Audio Remote S1 Button */
RID_AUD_REMOTE_S2_BTN,	/* 0 0 0 1 1 	3.208K		Audio Remote S2 Button                         */
RID_AUD_REMOTE_S3_BTN,	/* 0 0 1 0 0 	4.014K		Audio Remote S3 Button */
RID_AUD_REMOTE_S4_BTN,	/* 0 0 1 0 1 	4.82K		Audio Remote S4 Button */
RID_AUD_REMOTE_S5_BTN,	/* 0 0 1 1 0 	6.03K		Audio Remote S5 Button */
RID_AUD_REMOTE_S6_BTN,	/* 0 0 1 1 1 	8.03K		Audio Remote S6 Button */
RID_AUD_REMOTE_S7_BTN,	/* 0 1 0 0 0 	10.03K		Audio Remote S7 Button */
RID_AUD_REMOTE_S8_BTN,	/* 0 1 0 0 1 	12.03K		Audio Remote S8 Button */
RID_AUD_REMOTE_S9_BTN,	/* 0 1 0 1 0 	14.46K		Audio Remote S9 Button */
RID_AUD_REMOTE_S10_BTN,	/* 0 1 0 1 1 	17.26K		Audio Remote S10 Button */
RID_AUD_REMOTE_S11_BTN,	/* 0 1 1 0 0 	20.5K		Audio Remote S11 Button */
RID_AUD_REMOTE_S12_BTN,	/* 0 1 1 0 1 	24.07K		Audio Remote S12 Button */
RID_RESERVED_1,		/* 0 1 1 1 0 	28.7K		Reserved Accessory #1 */
RID_RESERVED_2,		/* 0 1 1 1 1 	34K 		Reserved Accessory #2 */
RID_RESERVED_3,		/* 1 0 0 0 0 	40.2K		Reserved Accessory #3 */
RID_RESERVED_4,		/* 1 0 0 0 1 	49.9K		Reserved Accessory #4 */
RID_RESERVED_5,		/* 1 0 0 1 0 	64.9K		Reserved Accessory #5 */
RID_AUD_DEV_TY_2,	/* 1 0 0 1 1 	80.07K		Audio Device Type 2 */
RID_PHONE_PWD_DEV,	/* 1 0 1 0 0 	102K		Phone Powered Device */
RID_TTY_CONVERTER,	/* 1 0 1 0 1 	121K		TTY Converter */
RID_UART_CABLE,		/* 1 0 1 1 0 	150K		UART Cable */
RID_CEA936A_TY_1,	/* 1 0 1 1 1 	200K		CEA936A Type-1 Charger(1) */
RID_FM_BOOT_OFF_USB,	/* 1 1 0 0 0 	255K		Factory Mode Boot OFF-USB */
RID_FM_BOOT_ON_USB,	/* 1 1 0 0 1 	301K		Factory Mode Boot ON-USB */
RID_AUD_VDO_CABLE,	/* 1 1 0 1 0 	365K		Audio/Video Cable */
RID_CEA936A_TY_2,	/* 1 1 0 1 1 	442K		CEA936A Type-2 Charger(1) */
RID_FM_BOOT_OFF_UART,	/* 1 1 1 0 0 	523K		Factory Mode Boot OFF-UART */
RID_FM_BOOT_ON_UART,	/* 1 1 1 0 1 	619K		Factory Mode Boot ON-UART */
RID_AUD_DEV_TY_1_REMOTE, /* 1 1 1 1 0 	1000.07K	Audio Device Type 1 with Remote(1) */
RID_AUD_DEV_TY_1_SEND = RID_AUD_DEV_TY_1_REMOTE , /* 1 1 1 1 0 	1002K		Audio Device Type 1 / Only Send-End(2) */
RID_USB_MODE,		/* 1 1 1 1 1 	Open		USB Mode, Dedicated Charger or Accessory Detach */

usbid_allresistorvalues.png

PostmarketOS

dpavlin@nuc:/nuc/pmbootstrap$ ./pmbootstrap.py install --no-fde
[17:54:17] *** (1/5) PREPARE NATIVE CHROOT ***
[17:54:18] *** (2/5) CREATE DEVICE ROOTFS ("samsung-maguro") ***
[17:54:23] (rootfs_samsung-maguro) install
[17:54:27] (rootfs_samsung-maguro) install
[17:54:30] (rootfs_samsung-maguro) write /etc/os-release
[17:54:30] (rootfs_samsung-maguro) mkinitfs samsung-maguro
[17:54:34]  *** SET LOGIN PASSWORD FOR: 'dpavlin' ***
New password:
Retype new password:
passwd: password updated successfully
[17:54:43] NOTE: No valid keymap specified for device
[17:54:46] *** (3/5) PREPARE INSTALL BLOCKDEVICE ***
[17:54:47] (native) create samsung-maguro.img (361M)
[17:54:47] (native) mount /dev/install (samsung-maguro.img)
[17:54:47] (native) partition /dev/install (boot: 31M, root: the rest)
[17:54:47] (native) format /dev/installp2
[17:54:48] (native) mount /dev/installp2 to /mnt/install
[Tue Sep 25 17:55:21 2018] EXT4-fs (loop0p2): mounted filesystem with ordered data mode. Opts: (null)
[17:54:48] (native) format /dev/installp1 (boot, ext2), mount to /mnt/install/boot
[Tue Sep 25 17:55:21 2018] EXT4-fs (loop0p1): mounting ext2 file system using the ext4 subsystem
[Tue Sep 25 17:55:21 2018] EXT4-fs (loop0p1): mounted filesystem without journal. Opts: (null)
[17:54:48] *** (4/5) FILL INSTALL BLOCKDEVICE ***
[17:54:48] (native) copy rootfs_samsung-maguro to /mnt/install/
[17:54:53] *** (5/5) FLASHING TO DEVICE ***
[17:54:53] Run the following to flash your installation to the target device:
[17:54:53] * pmbootstrap flasher flash_rootfs
[17:54:53]   Flashes the generated rootfs image to your device:
[17:54:53]   /nuc/pmbootstrap-work/chroot_native/home/pmos/rootfs/samsung-maguro.img
[17:54:53]   (NOTE: This file has a partition table, which contains /boot and / subpartitions. That way we don't need to change the partition layout on your device.)
[17:54:53] * pmbootstrap flasher flash_kernel
[17:54:53]   Flashes the kernel + initramfs to your device:
[17:54:53]   /nuc/pmbootstrap-work/chroot_rootfs_samsung-maguro/boot
[17:54:53]   (NOTE: fastboot also supports booting the kernel/initramfs directly without flashing. Use 'pmbootstrap flasher boot' to do that.)
[17:54:53] * If the above steps do not work, you can also create symlinks to the generated files with 'pmbootstrap export' and flash outside of pmbootstrap.
[17:54:53] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)
[17:54:53] Done

dpavlin@nuc:/nuc/pmbootstrap$ alias pmbootstrap=/nuc/pmbootstrap/pmbootstrap.py
dpavlin@nuc:/nuc/pmbootstrap$ pmbootstrap flasher flash_rootfs
[17:57:10] (native) flash rootfs image
< waiting for any device >
[Tue Sep 25 17:59:17 2018] usb 2-3.1: new high-speed USB device number 22 using xhci_hcd
[Tue Sep 25 17:59:17 2018] usb 2-3.1: New USB device found, idVendor=18d1, idProduct=4e30, bcdDevice= 1.00
[Tue Sep 25 17:59:17 2018] usb 2-3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Tue Sep 25 17:59:17 2018] usb 2-3.1: Product: Android 1.0
[Tue Sep 25 17:59:17 2018] usb 2-3.1: Manufacturer: Google, Inc
[Tue Sep 25 17:59:17 2018] usb 2-3.1: SerialNumber: 014994B00C01A013
target didn't report max-download-size
Erasing 'system'...
OKAY [  0.047s]
Sending 'system' (369664 KB)...
OKAY [ 50.498s]
Writing 'system'...
OKAY [ 26.436s]
Finished. Total time: 77.024s
[18:00:02] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)
[18:00:02] Done
dpavlin@nuc:/nuc/pmbootstrap$ [Tue Sep 25 19:24:27 2018] usb 2-3.1: USB disconnect, device number 22
[Tue Sep 25 19:24:27 2018] usb 2-3.1: new high-speed USB device number 23 using xhci_hcd
[Tue Sep 25 19:24:27 2018] usb 2-3.1: unable to get BOS descriptor
[Tue Sep 25 19:24:27 2018] usb 2-3.1: New USB device found, idVendor=0451, idProduct=d010, bcdDevice= 0.00
[Tue Sep 25 19:24:27 2018] usb 2-3.1: New USB device strings: Mfr=33, Product=37, SerialNumber=0
[Tue Sep 25 19:24:27 2018] usb 2-3.1: Product: OMAP4440
[Tue Sep 25 19:24:27 2018] usb 2-3.1: Manufacturer: Texas Instruments
[Tue Sep 25 19:24:30 2018] usb 2-3.1: USB disconnect, device number 23

u-boot

permalink
ZPB30A1
load_detail1.jpg

dummy-load-sch.pdf

ZHIYU ZPB30A1 60W dummy load

input voltage: 12V 0.5A (11-14V)
constant current: 0.20-9.99 A

modes

hold run button at power on

Fun1 - dc load (continue working on voltage alarm)
Fun2 - battery test (stop load at specified voltage)8n

serial

115200 8n1

pins from bottom of the board upwards

G - GND
R - RX
T - TX
L - always low?
F - 50 Khz quare wave
Vc - input voltage

3 byte output, first two bytes are BCD voltage (3.35V) and last one is status (1=ok, 0=under voltage alarm)

pi@rpi2 ~ $ microcom -s 115200 -p /dev/ttyUSB4 | od -An -t x1 -w3
 04 35 01
*
 04 36 01
 04 35 01
*
 04 36 01
*
 04 35 01
*
 04 36 01
 04 35 01

replacement firmware

permalink
Weblog Navigation
Loading...
Weblog Archives
  • Loading...