Making firmware hacking easier


#121

What is the proper orientation of the jtag adapter plug from the olimex to the jtag pins on braids? Can someone post a picture please?


#122

Nothing will get damaged if the wrong orientation is used, but you’ll get an error message form openocd. If this happens, try the other orientation.


#123

its possible to upload the firmware to a built warps with the wav file? or do i need to upload the file with ARM-USB-OCD-H or FTDI ? thanks


#124

If by built you mean a module you built yourself, you can’t use the WAV.


#125

Newbie here. I’ve just created the VM from the mutable dev environment zip, and am using an Olimex arm-usb-ocd-h JTAG debugger with Tides. I’m running Yosemite 10.10.5 on a 2008 Mac Pro; 2.8Ghz Quad-Core Intel Xeon.

I continue to get the following error when I get to the upload step make -f tides/makefile upload

Open On-Chip Debugger 0.9.0 (2016-07-05-18:43)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag’
adapter speed: 1000 kHz
adapter_nsrst_delay: 200
jtag_ntrst_delay: 200
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
Warn : Using DEPRECATED interface driver 'ft2232’
Info : Consider using the ‘ftdi’ interface driver, with configuration files in interface/ftdi/…
Info : max TCK change to: 30000 kHz
Info : clock speed 1000 kHz
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08004aac msp: 0x20000668
Info : device id = 0x20036410
Info : ignoring flash probed value, using configured bank size
Info : flash size = 256kbytes
stm32x mass erase complete
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
Error: stm32.cpu – clearing lockup after double fault
target state: halted
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffdc
Polling target stm32.cpu failed, trying to reexamine
Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints
wrote 87392 bytes from file build/tides/tides_bootloader_combo.bin to flash bank 0 at offset 0x00000000 in 2.957745s (28.854 KiB/s)
verified 87392 bytes in 1.483368s (57.534 KiB/s)
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
Error: DP initialisation failed
in procedure ‘reset’ called at file “stmlib/programming/jtag/postlude.cfg”, line 24
in procedure 'ocd_bouncer’
make: ***** [upload_combo_jtag] Error 1
**

In stmlib/Makefile.inc, wouldn’t these be the correct settings for the Olimex arm-usb-ocd-h jtag interface?

TOOLCHAIN_PATH ?= /usr/local/arm/
PGM_INTERFACE ?= arm-usb-ocd-h
PGM_INTERFACE_TYPE ?= jtag
PGM_SERIAL_PORT ?= /dev/ftdi-usbserial
PGM_SERIAL_BAUD_RATE ?= 115200
PGM_SERIAL_VERIFY ?= -v

Olimex arm-usb-ocd-h is seen by lsusb, and USB is enabled in VirtualBox’s VM settings.
“Bus 001 Device 003: ID 15ba:002b Olimex Ltd. ARM-USB-OCD-H JTAG+RS232”

It appears that the debugger driver and arm tool chain were installed with “vagrant up,” correct?

The tides still seems to work, and I’ve not begun altering the tides files, but sometimes tides appears to turn off if it’s still connected to the debugger, and i’m getting an error when executing make -f tides/makefile debug_server. I’m new to gdb and openOCD so I could be missing something obvious… Thanks in advance!

Edit:
“Warn : Using DEPRECATED interface driver 'ft2232’
Info : Consider using the ‘ftdi’ interface driver, with configuration files in interface/ftdi/…”

Is there something I should be changing in the following arm-usb-ocd-h.cfg settings?

  1. Interface configuration
    interface ft2232
    ft2232_layout olimex-jtag

ft2232_vid_pid 0x15BA 0x002b
ft2232_device_desc “Olimex OpenOCD JTAG ARM-USB-OCD-H”


#126

Is anyone using an ST-Link V2 on macOS Sierra?

This is my first build (elements) and my day of digging shows that I should be seeing my ST-Link on both the mac side via 'ioreg p IOUSB’ and/or with lsusb but I can’t see it on either.

STLINK is checked for all ports on vbox port settings (but, yes, I’m using ‘vagrant ssh’ to log in). I’m guessing either the macOS Sierra driver is boogered, or the cable is bad. The ST-Link just blinks red about once per second.


#127

Ok, that was indeed a bad cable.

Now onto debugging the build/soldering…


#128

Hi!
I’m running el capitan on a 2009 macbook.
I get this error message trying to upload:
Open On-Chip Debugger 0.9.0 (2016-12-02-05:09)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
hla_jtag
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Error: open failed
in procedure ‘init’ called at file “stmlib/programming/jtag/prelude_f4xx.cfg”, line 23
in procedure ‘ocd_bouncer’

make: ***** [upload_combo_jtag] Error 1

relatively new to this, any help would be greatly appreciated


#129

i have setup the linuxbox with the toolchain. everything works fine the first time it’s started. when i shut it down and back up, then the shared folders do not mount again.
it seems that the guest additions in the virtual machine do not match.
how can i upgrade the “Guest Additions Version: 4.3.36” in the linuxbox? or where can i find the statement for it in the vagrant setupfiles?

Problem solved:

  • install build-essential and module-assistant
  • mount guest additions into guestOS
  • install guest additons
  • vagrant reload

#130

Hi ! I’m having some issues installing the vagrant mutable dev environment on MacOS. I installed vagrant, virtualbox and the extension pack and i ran the “vagrant up” command. After about 15min of everything going fine i get a series of errors, starting with “==> default: ./configure: line 1513: printf: write error: Read-only file system” and the i get a bunch of read only file system errors and it all ends by this message :
"The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command should be in the log above. Please read the output to determine what went wrong."
I can’t figure out what happenned, i tried googling that but couldn’t understand what was the issue here. I’m completely lost :frowning:

Here is the log where it starts giving errors :

> default: ./configure: line 1513: printf: write error: Read-only file system
> default: rm: cannot remove ‘conftest.err’: Read-only file system
> default: rm: cannot remove ‘conftest.o’: Read-only file system
> default: rm: cannot remove ‘conftest.c’: Read-only file system
> default: ./configure: line 3576: printf: write error: Read-only file system
> default: none needed
> default: ./configure: line 3601: printf: write error: Read-only file system
> default: checking whether gcc understands -c and -o together…
> default: ./configure: line 3606: cannot create temp file for here-document: Read-only file system
> default: ./configure: line 3623: echo: write error: Read-only file system
> default: ./configure: line 3622: 2434 Aborted ( $CC -c conftest.$ac_ext -o conftest2.$ac_objext ) 1>&5 2>&5
> default: ./configure: line 3626: echo: write error: Read-only file system
> default: rm:
> default: cannot remove ‘conftest.c’
> default: : Read-only file system
> default: rm:
> default: cannot remove ‘conftest.err’
> default: : Read-only file system
> default: rm:
> default: cannot remove ‘conftest.o’
> default: : Read-only file system
> default: ./configure: line 3638: printf: write error: Read-only file system
> default: no
> default: ./configure: line 3660: confinc: Read-only file system
> default: ./configure: line 3666: printf: write error: Read-only file system
> default: checking for style of include used by make…
> default: ./configure: line 3672: confmf: Read-only file system
> default: ./configure: line 3683: confmf: Read-only file system
> default: ./configure: line 3694: printf: write error: Read-only file system
> default: none
> default: ./configure: line 3720: printf: write error: Read-only file system
> default: checking dependency style of /home/vagrant/stlink-1.1.0/compile gcc…
> default: mkdir:
> default: cannot create directory ‘conftest.dir’
> default: : Read-only file system
> default: ./configure: line 3735: /bin/cp: Input/output error
> default: ./configure: line 3736: cd: conftest.dir: No such file or directory
> default: ./configure: line 3830: 2449 Bus error mkdir sub
> default: ./configure: line 3747: sed: command not found
> default: ./configure: line 3825: rm: command not found
> default: ./configure: line 3831: printf: write error: Read-only file system
> default: none
> default: ./configure: line 3849: 2455 Bus error $SHELL “$ac_aux_dir/config.sub” sun4 > /dev/null 2>&1
> default: ./configure: line 416: printf: write error: Read-only file system
> default: configure: error: cannot run /bin/bash ./config.sub
> default: ./configure: line 4: echo: write error: Read-only file system
> default: ./configure: line 8: printf: write error: Read-only file system
> default: ./configure: line 9: echo: write error: Read-only file system
> default: ./configure: line 12: sed: command not found
> default: ./configure: line 38: sort: command not found
> default: ./configure: line 35: sed: command not found
> default: ./configure: line 40: echo: write error: Read-only file system
> default: ./configure: line 44: printf: write error: Read-only file system
> default: ./configure: line 45: echo: write error: Read-only file system
> default: ./configure: line 53: sort: command not found
> default: ./configure: line 54: echo: write error: Read-only file system
> default: ./configure: line 82: printf: write error: Read-only file system
> default: ./configure: line 84: rm: command not found
> default: /tmp/vagrant-shell: line 64: /usr/bin/make: No such file or directory
> default: /tmp/vagrant-shell: line 65: 2471 Bus error sudo make install
> default: /tmp/vagrant-shell: line 66: 2473 Bus error sudo cp 49-stlink*.rules /etc/udev/rules.d/
> default: /tmp/vagrant-shell: line 68: /bin/rm: No such file or directory
> default: /tmp/vagrant-shell: line 69: /bin/rm: No such file or directory
> default: /tmp/vagrant-shell: line 73: /etc/udev/rules.d/60-programmers.rules: No such file or directory
> default: /tmp/vagrant-shell: line 74: /etc/udev/rules.d/60-programmers.rules: No such file or directory
> default: /tmp/vagrant-shell: line 75: /etc/udev/rules.d/60-programmers.rules: No such file or directory
> default: /tmp/vagrant-shell: line 76: /etc/udev/rules.d/60-programmers.rules: No such file or directory
> default: /tmp/vagrant-shell: line 77: /etc/udev/rules.d/60-programmers.rules: No such file or directory
> default: /tmp/vagrant-shell: line 78: 2477 Bus error sudo udevadm control --reload-rules
> default: /tmp/vagrant-shell: line 79: 2479 Bus error sudo udevadm trigger
> default: /tmp/vagrant-shell: line 83: /usr/bin/wget: No such file or directory
> default: /tmp/vagrant-shell: line 84: /bin/tar: No such file or directory
> default: /tmp/vagrant-shell: line 85: 2483 Bus error sudo mv gcc-arm-none-eabi-4_8-2013q4 /usr/local/arm-4.8.3/
> default: /tmp/vagrant-shell: line 86: /bin/rm: No such file or directory
> default: /tmp/vagrant-shell: line 89: ln: command not found
> default: /tmp/vagrant-shell: line 92: /home/vagrant/.bashrc: Read-only file system
> default: /tmp/vagrant-shell: line 93: /home/vagrant/.bashrc: Read-only file system
> default: /tmp/vagrant-shell: line 94: /home/vagrant/.bashrc: Read-only file system
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.


#131

Fixed ! I don’t know how but i deleted everything then reinstalled and it now works :slight_smile:


#132

Hi All,
I’ve been having issues getting my ftdi friend to work, (it has before, used it to flash my clouds back to stock, and same with my tides) so I decided to burn down my vagrant machine and actually uninstalled VBox and just get a full fresh start with the cozy environ.

I am fully able to compile firmware and all that good stuff but when I use the “upload_combo_serial” command I get something like “/dev/ftdi-usbserial directory not found”

Its been a few days of head scratching, reinstalling VBox, the vbox extension pack, vagrant, rebuilding the machine. Looking at the the build log this most recent time I came across this line:

" default: modprobe: FATAL: Module ftdi_sio not found."

any thoughts? is this why I can’t find “/dev/ftdi-usbserial” ?


#133

Absolutely.

Apparently, the ftdi drivers are not part of the default images for virtual machines. They need to be added by installing an extra package.


#134

Thank you Oliver!

I’ll give that a try