Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create How_To_Use_OpenOCD_UbuntuEd #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions howto/How_To_Use_OpenOCD_UbuntuEd
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filename should end with ".md" (markdown) which gets converted to html when it gets deployed on pod.hubbe.net.

Also, the file names are generally lower case (the title doesn't have to be though.)

title: Openocd On Ubuntu 64
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just call it "OpenOCD on Linux"

Then add a note below which specifies exactly what platform you used and tell people that something similar should work on other linux platforms.

redirect_from:
- /Openocd.html
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a redirect from /Openocd.html?
redirect_from is usually only used when a page is moved.

---
This How to covers, if I rip my usb how do I flash the Proffieboard or update it. there's a few things about this particular use case. In this article you will be using the ST-Linkv2 usb debugger that connects through single core and the operating system of your laptop or pc would be Ubuntu 64 bit or any linux distro that is 64 bit.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to -> how-to

there's a few things about this particular use case.

This sentence doesn't make sense to me.
What few things?
Also, it's not capitalized.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"connects through single core"
what does that mean?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, the structure of the text needs some work.
It reads more like "this is what I did" than "this is what you should do".


on a windows box these steps are not required because of the openocd files are located in the arduino ide folders. the main issue with Ubuntu 64 bit version is that the scripts on arduino require the 32 bit version and ubuntu has deprecated libudev.so.1, THERE IS A FIX THOUGH.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This article is about linux, no need to talk about how it's done on windows, especially since I think the openocd for windows doesn't actually work...


```
./openocd.bin: error while loading shared libraries: libudev.so.1: cannot open shared object file: No such file or directory
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to have this error here, because people aren't going to get this error if they follow these directions.

```

pre-requisites
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "##" to make it a sub-header

Maybe call it "setup" instead of prerequisites?

the hardware required is the ST-Linkv2 debugger USB, plus the male/female pinned cables and small pcb test points connect the female pins into the usb pins that correspond with 1. sdio 2. swdlck and 3 gnd. the male end will go to the corresponding pins on the proffieboard. use the pcb test points to hold the pins in place other wise the connection may be lost during the compiling stage.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be helpful to have a picture, and/or a link to an st-link v2.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could really really use an illustration or image on how this should be wired up.


1. Verify configuration in Arduino IDE and locate the file (ProffieOS.ino.elf) in the /tmp folder this can be found if you have debug enabled in the arduino preferences for the option of compiling. copy the hole output from arduino and then paste into a text file and run a search on the filename. e.g. "/tmp/arduino_build_610194/ProffieOS.ino.elf"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We how to tell people how to locate the build folder.
(Either tell people to find it in the compile output, or use a "find" command.)

2. navigate to Terminal and Install openocd
```
# sudo apt-get install openocd
```
3. navigate to the directory (please note that the number in the directory is randomly assigned and yours will be different)
```
# cd /tmp/arduino_build_610194/
```
4. in the terminal run the following command

```
openocd -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/variants/STM32L433CC-Proffieboard/openocd_scripts/stm32l433cc_butterfly.cfg -c “program ./ProffiOS.ino.elf verify reset ext”
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace /home/max with $HOME so it will work for everybody.

```

a successfuly compiling looks like this.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"compiling" is the wrong word here.
Arduino does the compilation (which means turning source code into binary code) this command just does the upload to the board.



```
root@Heironymous:/tmp/arduino_build_265075# openocd -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/variants/STM32L433CC-Proffieboard/openocd_scripts/stm32l433cc_butterfly.cfg -c "program ProffieOS.ino.elf verify reset exit"
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate

Info : clock speed 500 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.280851
Info : STM32L433.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for STM32L433.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x1fff3f36 msp: 0x20002c20
** Programming Started **
Info : device idcode = 0x10016435 (STM32L43/L44xx - Rev Z : 0x1001)
Info : flash size = 256kbytes
Info : flash mode : single-bank
Warn : Adding extra erase range, 0x08038a68 .. 0x08038fff
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
shutdown command invoked
```