Quick jump:  What's new

 
Go to:
 
Weblog: recent changes   
in Dobrica Pavlinušić's random unstructured stuff
RaspberryPi
mount-rpi-image.sh

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




Interestring projects

TODO: test them out and write full description on this wiki :-)

development

OV7670

DHT11/DHT22

BlinkM + i2c

CEC - control your TV

http://www.raspberrypi.org/forum/viewtopic.php?f=35&t=15749

root@raspberrypi:/home/pi# git clone https://github.com/Pulse-Eight/libcec.git
root@raspberrypi:/home/pi# cd libcec/
root@raspberrypi:/home/pi/libcec# apt-get install autoconf automake libtool liblockdev1-dev libudev-dev libraspberrypi-dev
root@raspberrypi:/home/pi/libcec# sh -x bootstrap
root@raspberrypi:/home/pi/libcec# ./configure --with-rpi-include-path=/opt/vc/include/ --with-rpi-lib-path=/opt/vc/lib/

##############################################################################

libCEC version 2:1:0 configured

Compilation flags:
  CXXFLAGS :       -g -O2 -fPIC -Wall -Wextra -Wno-missing-field-initializers  -Wno-psabi
  libCEC LDFLAGS : -lbcm_host -llockdev -lrt -ldl -lpthread  -L/opt/vc/lib/ -lvcos -lvchiq_arm -ludev  
  client LDFLAGS : -lrt -ldl -lpthread 

Configured features:
  Pulse-Eight CEC Adapter :             yes
  Pulse-Eight CEC Adapter detection :   yes
  Raspberry Pi support :                yes
  TDA995x support :                     no

You can now build libCEC by running:
  make

##############################################################################

make install

TV on

pi@raspberrypi ~ $ echo "on 0" | cec-client -s

Hints from forum

screen saver

http://www.raspberrypi.org/phpBB3/viewtopic.php?p=84831#p84831

# prevent screensaver from powering down display
setterm -blank 0 -powerdown 0 > /dev/tty0

# clear the display and turn off the flashing cursor
clear > /dev/tty0
setterm -cursor 0 > /dev/tty0

# turn the cursor back on when done with omxplayer
setterm -cursor 1 > /dev/tty0

YouTube transcoding in VLC

http://www.raspberrypi.org/phpBB3/viewtopic.php?p=163658#p163658

cvlc 'youtube.com/watch?v=XXXXXXXXXX' :sout='#transcode{vcodec=h264,vb=0,fps=0,scale=0,height=720,acodec=mp4a,ab=128,channels=2,samplerate=44100}:http{mux=ffmpeg{mux=flv},dst=:8080/youtube}' :sout-keep

Education materials

Raspberry Pi Accessories Starter Kit

http://www.conrad.com/ce/en/product/409208/Raspberry-Pi-Accessories-Starter-Kit?ref=searchDetail

  • 1x Rapberry sticker

GPU

Arduino

JTAG

Arduino ProMini 3.3V 8MHz

Disable serial port console

edit /boot/cmdline.txt and remove all ttyAMA0 leaving:

pi@raspberrypi ~ $ cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait bcm2708.w1_gpio_pin=4

also, comment out ttyAMA0 in /etc/inittab

connect Arduino serial

RX->TX
TX->RX

https://github.com/dpavlin/avrdude-rpi/tree/fix_channel_in_use

pin definitions in GPIO.RPi are physical pins on board not BCM or wiring ip!

gpio1.png

flasing

dpavlin@blue:~/Arduino/RF433_Sockets$ scp /tmp/build*.tmp/*.hex pi@rpi.tv:/tmp/
RF433_Sockets.cpp.hex                                        100%   19KB  18.6KB/s   00:00

pi@raspberrypi ~ $ cat avrdude.sh 
#!/bin/sh
hex=`ls -t /tmp/*.hex | head -1`
echo "flash hex: $hex"
sudo /home/pi/avrdude-rpi/avrdude-autoreset -C /home/pi/avrdude.conf -v -v -patmega328p -carduino -P/dev/ttyAMA0 -b57600 -D -Uflash:w:$hex:i 

pi@raspberrypi ~ $ ./avrdude.sh
flash hex: /tmp/RF433_Sockets.cpp.hex

avrdude: Version 6.1, compiled on Sep 17 2014 at 05:41:35
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/pi/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyAMA0
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
done with autoreset
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 2
         Firmware Version: 1.16
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: reading input file "/tmp/RF433_Sockets.cpp.hex"
avrdude: writing flash (6770 bytes):

Writing | ################################################## | 100% 1.98s

avrdude: 6770 bytes of flash written
avrdude: verifying flash memory against /tmp/RF433_Sockets.cpp.hex:
avrdude: load data flash data from input file /tmp/RF433_Sockets.cpp.hex:
avrdude: input file /tmp/RF433_Sockets.cpp.hex contains 6770 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.49s

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

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe
strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe

avrdude done.  Thank you.

strace: |/home/pi/avrdude-rpi/autoreset: Broken pipe

DS1307 Tiny RTC

Check if module has 5V pull-up I2C resistors! If it does (like Tiny RTC has R2 and R3) you will have to remove them.

tiny-rtc-3.3v-remote-r2-r3.jpg

root@raspberrypi:/home/pi# apt-get install i2c-tools

root@raspberrypi:/home/pi# modprobe i2c-dev

root@raspberrypi:/home/pi# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

root@raspberrypi:/home/pi# modprobe rtc-ds1307

root@raspberrypi:/home/pi# echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device

root@raspberrypi:/home/pi# hwclock --systohc -D --noadjfile --utc
hwclock from util-linux 2.20.1
Using /dev interface to clock.
Assuming hardware clock is kept in UTC time.
Time elapsed since reference time has been 0.722720 seconds.
Delaying further to reach the new time.
Setting Hardware Clock to 11:53:41 = 1429876421 seconds since 1969
ioctl(RTC_SET_TIME) was successful.

DS18B20

root@raspberrypi:/home/pi# grep w1 /boot/config.txt 
dtoverlay=w1-gpio

# reboot

root@raspberrypi:/home/pi# cat /sys/bus/w1/devices/28-0000043c5507/w1_slave 
50 05 4b 46 7f ff 0c 10 1c : crc=1c YES
50 05 4b 46 7f ff 0c 10 1c t=85000

Hmm, you will also want to remove R1 pullup to make it work?

avrdude

Using Raspberry Pi as Arduino ISP programmer

root@raspberrypi:/home/pi# avrdude -c linuxgpio -p atmega328p

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f

avrdude: safemode: Fuses OK (E:05, H:DA, L:FF)

avrdude done.  Thank you.

logic analyzer

rotary encoder

http://www.bobrathbone.com/raspberrypi_rotary.htm

SWD

http://www.disk91.com/2015/technology/programming/swd-programming-using-a-raspberrypi/
https://github.com/disk91/PySWD

pi@raspberrypi ~ $ git clone https://github.com/disk91/PySWD
pi@raspberrypi ~ $ cd PySWD/


PIC

esp8089

PS/2 GPIO

GPIO header annotations

Signal generator

pi@rpi2 ~/WsprryPi $ sudo ./wspr --test-tone 1000000
A test tone will be generated at frequency 1.000000 MHz

Using local mbox device file with major 249.
Transmitting test tone on frequency 1.000000 MHz
Press CTRL-C to exit!

LCD panels

http://blog.reasonablycorrect.com/raw-dpi-raspberry-pi/

Pi Zero USB OTG

libcomposite

PATA IDE emulation

DPI LCD screen

i2c clock stretching

permalink
Olympus C-5050 ZOOM
permalink
WiFi@SDCF

links

info

WIFI Adapter Memory Card TF Micro-SD to CF Compact Flash Card Kit for Digit Y8X8

Insert your Micro-SD HC card into WiFi CF adapter and you can access high quality photos and videos sent wirelessly from your camera via Wi-Fi to your Smartphone or tablet to share.
Supports "with the beat-per-view" feature and both Apple Ios & Android devices
WiFi-CF settings: WiFi password,AP Mode and Station Mode switch, IP, channels, number or users, SSID.
some camera don't support wifi function, then the wifi unavailable.
Please check the camera manual before you use the wifi function.
Insert your Micro-SD HC card into WiFi CF adapter and you can access high
quality photos and videos sent wirelessly from your camera via Wi-Fi to
your Smartphone or tablet to share.
1.Connect up to 3 devices simultaneously
2.Supports "with the beat-per-view" feature.
3.Supports both Apple Ios & Android devices.
4.WiFi-CF settings: WiFi password,AP Mode and Station Mode switch, IP,
channels, number or users, SSID.
5. Please choose the quality,performance,higher microSDHC Card(recommend
Class 10).
6. Capacity: based on your microSDHC / microSDXC card.
7. SD browse file formats supported:
1) Photo (photo): JPG,PNG,BMP.
2) Video(Video): MP4,AVI,MOV.
3) Music(Music): MP3,WAV.
Note: WiFi-CF can display above file formats,but the ability to play
depends on whether the Wi-Fi device you use can support.
WIFI-CF Default Password: 999999 or 99999999
WIFI-CF Apps Default Username: admin
WIFI-CF Apps Default Password: admin
colour: black+white
Material: ABS
Package Contents:
1*WIFI Adapter Memory Card
Note: WiFi-CF can display above file formats,but the ability to play depends on whether the Wi-Fi device you use can support.
The TF Micro-SD memory card is not included.
Only the above package content, other products are not included.
Note: Light shooting and different displays may cause the color of the item in t

permalink
Announcements and Links
permalink
PICkit

PICKit 2

pk2cmd

pi@rpi2 ~ $ git clone https://github.com/psmay/pk2cmd
pi@rpi2 ~ $ cd pk2cmd/pk2cmd
pi@rpi2 ~/pk2cmd/pk2cmd $ make linux

pi@rpi2 ~/pk2cmd/pk2cmd $ ./pk2cmd -P
Auto-Detect: Found part PIC16F684.

# power on target from pickit 2
pi@rpi2 ~/pk2cmd/pk2cmd $ ./pk2cmd -PPIC16F684 -T

serial

https://github.com/majenkotech/pk2serial

permalink
Sputnik OpenBeacon tag

Original from CCC, let's try to compile with sdcc for it.

https://events.ccc.de/camp/2007/Fahrplan/attachments/1337-Sputnik%20Slides

The OpenBeacon Tag consists of

    nRF24L01 2.4GHz transceiver (1/2MBps)
    PIC16F684 PIC14 microcontroller



Schematics

OpenBeacon.pdf

pinout

(same as pickit)

1 VPP/RA3 (Square pin)
2 VDD
3 GND
4 ICSPDAT/RA0
5 ICSPCLK/RA1 (also connected to touch sensor)
6 PGM (seems to be unconnected)

PicKit 2

pi@rpi2 ~ $ git clone https://github.com/psmay/pk2cmd
pi@rpi2 ~ $ cd pk2cmd/pk2cmd
pi@rpi2 ~/pk2cmd/pk2cmd $ make linux

pi@rpi2 ~/pk2cmd/pk2cmd $ ./pk2cmd -P
Auto-Detect: Found part PIC16F684.

# power on target of pickit 2 which is sputlink tag
pi@rpi2 ~/pk2cmd/pk2cmd $ ./pk2cmd -PPIC16F684 -T


Source

dpavlin@klin:/rest/cvs$ git clone https://github.com/meriac/openbeacon


archival links

permalink
rtl-sdr


calibration

https://github.com/steve-m/kalibrate-rtl

dpavlin@nuc:/nuc/kalibrate-rtl$ ./src/kal -s GSM900
Found 1 device(s):
  0:  Terratec T Stick PLUS

Using device 0: Terratec T Stick PLUS
Found Elonics E4000 tuner
Exact sample rate is: 270833.002142 Hz
kal: Scanning for GSM-900 base stations.
GSM-900:
        chan: 53 (945.6MHz - 14.311kHz) power: 873627.18
        chan: 61 (947.2MHz - 14.203kHz) power: 5086424.19
        chan: 69 (948.8MHz - 14.217kHz) power: 925674.55
        chan: 82 (951.4MHz - 14.368kHz) power: 1267065.47
        chan: 89 (952.8MHz - 14.430kHz) power: 914349.18
        chan: 99 (954.8MHz - 14.352kHz) power: 902132.81
        chan: 105 (956.0MHz - 14.380kHz)        power: 990434.19
        chan: 108 (956.6MHz - 14.350kHz)        power: 2682914.97

dpavlin@nuc:/nuc/kalibrate-rtl$ ./src/kal -c 61
Found 1 device(s):
  0:  Terratec T Stick PLUS

Using device 0: Terratec T Stick PLUS
Found Elonics E4000 tuner
Exact sample rate is: 270833.002142 Hz
kal: Calculating clock frequency offset.
Using GSM-900 channel 61 (947.2MHz)
average         [min, max]      (range, stddev)
- 14.238kHz             [-14257, -14220]        (37, 8.682419)
overruns: 0
not found: 0
average absolute error: 15.032 ppm



dpavlin@nuc:/nuc/kalibrate-rtl$ ./src/kal -c 61
Found 2 device(s):
  0:  Generic RTL2832U OEM
  1:  Terratec T Stick PLUS

Using device 0: Generic RTL2832U OEM
Found Fitipower FC0012 tuner
Exact sample rate is: 270833.002142 Hz
kal: Calculating clock frequency offset.
Using GSM-900 channel 61 (947.2MHz)
average         [min, max]      (range, stddev)
- 36.021kHz             [-36032, -36011]        (21, 5.899949)
overruns: 0
not found: 0
average absolute error: 38.028 ppm



DVB-T Digital TV Receiver USB Dongle w/ FM / Remote Control / Antenna - Black

http://dx.com/p/dvb-t-digital-tv-receiver-usb-dongle-w-fm-remote-control-antenna-black-149928

dpavlin@blue:~$ lsusb | grep DVB
Bus 001 Device 007: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T

dpavlin@blue:~$ sudo rtl_test -t
[sudo] password for dpavlin: 
Found 1 device(s):
  0:  ezcap USB 2.0 DVB-T/DAB/FM dongle

Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6 
No E4000 tuner found, aborting.


dpavlin@blue:/blue/rtl-sdr/rtl-sdr/build$ sudo rtl_tcp 
Found 1 device(s).
Found Rafael Micro R820T tuner
Using ezcap USB 2.0 DVB-T/DAB/FM dongle
Tuned to 100000000 Hz.
listening...
Use the device argument 'rtl_tcp=127.0.0.1:1234' in OsmoSDR (gr-osmosdr) source
to receive samples in GRC and control rtl_tcp parameters (frequency, gain, ...).

E4000+2832U USB DVB-T TV Receiver Stick

http://dx.com/p/e4000-2832u-usb-dvb-t-tv-receiver-stick-white-black-172105

dpavlin@blue:~$ rtl_test -t
Found 1 device(s):
  0:  Terratec T Stick PLUS

Using device 0: Terratec T Stick PLUS
Found Elonics E4000 tuner
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0 
Benchmarking E4000 PLL...
[E4K] PLL not locked for 52000000 Hz!
[E4K] PLL not locked for 2227000000 Hz!
[E4K] PLL not locked for 1114000000 Hz!
[E4K] PLL not locked for 1274000000 Hz!
E4K range: 53 to 2226 MHz
E4K L-band gap: 1114 to 1274 MHz

Hama 53176

  • FC0013 tuner
Hama1.jpg

hama2.jpg

hama3.jpg

TV LV5TDLX

  • FC0012 tuner
LV51.jpg
LV52.jpg
LV53.jpg
permalink
osmo-fl2k

see also rtl-sdr for receiver part

dpavlin@nuc:~$ lsusb -d 1d5c:2000 
Bus 003 Device 007: ID 1d5c:2000  

dpavlin@nuc:~$ sudo fl2k_test -s 162e6
[sudo] password for dpavlin: 
Using 6 zero-copy buffers
libusb: error [op_dev_mem_alloc] alloc dev mem failed errno 12
Failed to allocate zerocopy buffer for transfer 4
Reporting PPM error measurement every 10 seconds...
Press ^C after a few minutes.
real sample rate: 144376742 current PPM: -108786 cumulative PPM: -108786
real sample rate: 144270861 current PPM: -109439 cumulative PPM: -109125
real sample rate: 144227755 current PPM: -109705 cumulative PPM: -109323
^CSignal caught, exiting!


permalink
nRF24LU1



pinout

nRF24L01_pinout.jpg

It seems that v2.0 devies are 32k while Internet wants us to beleve that they are 16k (v1.0 maybe?)

original firmware output

[11985.181504] usb 2-2.1: new full-speed USB device number 7 using xhci_hcd
[11985.285687] usb 2-2.1: New USB device found, idVendor=1915, idProduct=002b
[11985.285690] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[11985.285692] usb 2-2.1: Product: Nordic Semiconductor nRFready Basic Remote Dongle
[11985.285694] usb 2-2.1: Manufacturer: Nordic Semiconductor
[11985.285695] usb 2-2.1: SerialNumber: \xffffffef\xffffffbf\xffffffbf\xffffffef\xffffffbf\xffffffbf\xffffffef\xffffffbf\xffffffbf\xffffffef\xffffffbf\xffffffbf\xffffffef\xffffffbf\xffffffbf\xffffffef\xffffffbf\xffffffbf\xffffffef\xffffffbf\xffffffbf\xffffffef\xffffffbf\xffffffbf\xffffffef\xffffffbf\xffffffbf\xffffffef\xffffffbf\xffffffbf
[11985.301719] input: Nordic Semiconductor Nordic Semiconductor nRFready Basic Remote Dongle as /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2.1/2-2.1:1.0/0003:1915:002B.0005/input/input11
[11985.361937] hid-generic 0003:1915:002B.0005: input,hiddev0,hidraw2: USB HID v1.11 Keyboard [Nordic Semiconductor Nordic Semiconductor nRFready Basic Remote Dongle] on usb-0000:00:14.0-2.1/input0

mouse jack tools

https://github.com/BastilleResearch/mousejack

find device address

dpavlin@nuc:/nuc/nRF24L01/mousejack/nrf-research-firmware/tools$ ./nrf24-scanner.py 
[2017-01-07 13:50:59.174]  12   0  65:6F:91:A9:07  
[2017-01-07 13:51:07.012]   8  10  65:6F:91:A9:07  00:C2:00:00:F8:FF:FE:00:00:49
[2017-01-07 13:51:15.216]   8  10  65:6F:91:A9:07  00:C2:00:00:17:D0:FF:00:00:58
[2017-01-07 13:51:15.231]   8   0  65:6F:91:A9:07  
[2017-01-07 13:51:15.698]  12   0  65:6F:91:A9:07  
[2017-01-07 13:51:23.456]   8  10  65:6F:91:A9:07  00:C2:00:00:EB:BF:FF:00:00:95
[2017-01-07 13:51:23.503]   8  10  65:6F:91:A9:07  00:C2:00:00:FF:0F:FF:00:00:31
[2017-01-07 13:51:23.509]   8   0  65:6F:91:A9:07  
[2017-01-07 13:51:23.840]  12   0  65:6F:91:A9:07  

sniff

dpavlin@nuc:/nuc/nRF24L01/mousejack/nrf-research-firmware/tools$ ./nrf24-sniffer.py -c 8 12 -a 65:6F:91:A9:07
[2017-01-07 13:53:34.922]   8   5  65:6F:91:A9:07  00:40:00:08:B8
[2017-01-07 13:53:34.930]   8   5  65:6F:91:A9:07  00:40:00:08:B8
[2017-01-07 13:53:34.938]   8   5  65:6F:91:A9:07  00:40:00:08:B8
[2017-01-07 13:53:34.946]   8   5  65:6F:91:A9:07  00:40:00:08:B8
[2017-01-07 13:53:34.962]   8   5  65:6F:91:A9:07  00:40:00:08:B8
[2017-01-07 13:53:34.970]   8   5  65:6F:91:A9:07  00:40:00:08:B8
[2017-01-07 13:53:34.979]   8  22  65:6F:91:A9:07  00:D3:44:0F:5C:E6:CD:54:B5:71:8C:F9:99:33:00:00:00:00:00:00:00:00
[2017-01-07 13:53:34.986]   8   5  65:6F:91:A9:07  00:40:00:08:B8
[2017-01-07 13:53:34.994]   8  10  65:6F:91:A9:07  00:4F:00:01:18:00:00:00:00:98
[2017-01-07 13:53:35.125]   8   5  65:6F:91:A9:07  00:40:01:18:A7
[2017-01-07 13:53:35.278]   8  22  65:6F:91:A9:07  00:D3:B0:F4:B3:27:E3:BE:34:72:8C:F9:99:34:00:00:00:00:00:00:00:16
[2017-01-07 13:53:35.285]   8   5  65:6F:91:A9:07  00:40:00:08:B8
[2017-01-07 13:53:35.301]   8   5  65:6F:91:A9:07  00:40:00:08:B8

flashing

https://github.com/BastilleResearch/mousejack/issues/6
https://wiki.bitcraze.io/projects:crazyradio:spi_programming

bus pirate

https://github.com/koolatron/buspirate_nrf24lu1p

Bus Pirate   nRF24LU1+
3V3 -> VDD
AUX -> PROG
SCK -> SCK
MOSI -> MOSI
MISO -> MISO
CS -> CSN
GND -> GND

dpavlin@nuc:/nuc/nRF24L01/buspirate_nrf24lu1p$ ./flasher.pl -device /dev/ttyUSB0 -input ../mousejack/nrf-research-firmware/bin/dongle.bin 


bootloader

512 byte replacement

https://github.com/ahtn/nrf24lu1p-512-bootloader

original bootloader

https://github.com/al177/buspirate_nrf24lu1p

Logitech C-U0007

Version with fixed ctrl+c exit bug: https://github.com/cl0udz/mousejack

dpavlin@x230:/x230/mousejack$ git remote -v
cl0udz  https://github.com/cl0udz/mousejack (fetch)
cl0udz  https://github.com/cl0udz/mousejack (push)

dpavlin@x230:/x230/mousejack/nrf-research-firmware$ make logitech_install

[Fri Apr 27 22:10:16 2018] usb 1-1.2: new full-speed USB device number 23 using ehci-pci
[Fri Apr 27 22:10:16 2018] usb 1-1.2: New USB device found, idVendor=1915, idProduct=0102
[Fri Apr 27 22:10:16 2018] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Fri Apr 27 22:10:16 2018] usb 1-1.2: Product: Research Firmware
[Fri Apr 27 22:10:16 2018] usb 1-1.2: Manufacturer: RFStorm

dpavlin@x230:/x230/mousejack/nrf-research-firmware$ ./tools/nrf24-scanner.py 
[2018-04-29 14:23:51.370]   5  22  65:6F:91:A9:07  00:D3:D5:D7:4F:76:ED:63:55:70:EC:77:61:0F:00:00:00:00:00:00:00:D4
[2018-04-29 14:23:51.786]   9   5  65:6F:91:A9:07  00:40:00:08:B8




permalink
FST-01

update vid and pid in compiled binary

since version 1.2.8 you need to insert vid and pid into the binary by running

make build/gnuk-vidpid.elf

and than flash the resulting gnuk-vidpid.bin binary into your FST-01

SWD flashing using ST Link v2

usb 1-1.6.4: new full-speed USB device number 16 using ehci-pci
usb 1-1.6.4: New USB device found, idVendor=0483, idProduct=3748
usb 1-1.6.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.6.4: Product: STM32 STLink
usb 1-1.6.4: Manufacturer: STMicroelectronics
usb 1-1.6.4: SerialNumber: Qÿl^FH<85>PH'Q^C<87>

Problem:

dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk/tool$ ./stlinkv2.py -s
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0002 -> 0001
CORE: 0de01477, CHIP_ID: 00000000
Flash ROM read protection: off
Option bytes: 00000000
Core does not halt, try API V2 halt.
ValueError('Status of core is not halt.', 128)

after several re-runs:

dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk/tool$ ./stlinkv2.py -s
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0002 -> 0001
CORE: 1ba01477, CHIP_ID: a0036410
Flash ROM read protection: off
Option bytes: a0036410
Core does not halt, try API V2 halt.
ValueError('Status of core is not halt.', 128)

after a bit of fiddling with cables (it's always cables, right?)

Lovro contributed that if you are getting continous output like this

ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0002 -> 0001
Core does not halt, try API V2 halt.
ValueError('Status of core is not halt.', 128)

then run this while holding reset active (hold tweezers on both side of C3)
that should hand the uC in a mode that will enable stlinkv2.py script to turn off the flash rom protection and erase the flash while doing that

dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk$ sudo ./tool/stlinkv2.py -s
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0002 -> 0001
CORE: 1ba01477, CHIP_ID: 20036410
Flash ROM read protection: ON
Option bytes: 03fffffe
The MCU is now stopped.
SUCCESS

dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk$ sudo ./tool/stlinkv2.py -u
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0002 -> 0001
Status is 0081
CORE: 1ba01477, CHIP_ID: 20036410
Flash ROM read protection: ON
Option bytes: 03fffffe
Flash ROM read protection disabled.  Reset the board, now.
SUCCESS

# plugin, plugout st-link/v2

dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk$ sudo ./tool/stlinkv2.py -s
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0100 -> 0001
CORE: 1ba01477, CHIP_ID: 20036410
Flash ROM read protection: off
Option bytes: ffff5aa5
Flash ROM blank check: True
SUCCESS

dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk$ sudo ./tool/stlinkv2.py -b ../binaries/gnuk/gnuk.bin 
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0001 -> 0001
CORE: 1ba01477, CHIP_ID: 20036410
Flash ROM read protection: off
Option bytes: ffff5aa5
Flash ROM blank check: True
SPI Flash ROM ID: bf254a
WRITE
VERIFY
PROTECT
Flash ROM read protection enabled.  Reset the board to enable protection.
SUCCESS

# power cycle

dpavlin@blue:/blue-zfs/STM32/FST-01/gnuk$ sudo ./tool/stlinkv2.py -s
ST-Link/V2 version info: 2 17 4
Change ST-Link/V2 mode 0100 -> 0001
CORE: 1ba01477, CHIP_ID: 20036410
Flash ROM read protection: ON
Option bytes: 03fffffe
The MCU is now stopped.
SUCCESS

plugin just FST-01:

[ 9890.019368] usb 1-1.6.4: New USB device found, idVendor=234b, idProduct=0000
[ 9890.019372] usb 1-1.6.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 9890.019374] usb 1-1.6.4: Product: Gnuk Token
[ 9890.019375] usb 1-1.6.4: Manufacturer: Free Software Initiative of Japan
[ 9890.019377] usb 1-1.6.4: SerialNumber: FSIJ-1.0.4-50FF7006
permalink
Weblog Navigation
Loading...
Weblog Archives
  • Loading...