-
-
Notifications
You must be signed in to change notification settings - Fork 774
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
Install and pinout instructions unclear: Bluepill #1632
Comments
This is quite a long ticket, so we'll try and address things in parts (numbered based on which sections we're answering or giving some information on):
# set up ARM toolchain
export PATH="/opt/arm-gnu-toolchain-12.3/arm-none-eabi/bin:$PATH"
export PATH="/opt/arm-gnu-toolchain-12.3/bin:$PATH" Do not add the In relation to a lack of instruction - we've been working on that on the website repo - at least for windows
The ST-Link platform uses the same pinout as the official ST-Link - so this makes the pinout:
|
Didn't mean to close, I'm not sure why that button is next to "comment".
Thank you for the quick reply! I intend to keep using this setup, so I'll try to contribute to sorting this mess out. P.S. I'm certain this is the wrong place to ask, but how do you disable building for certain platforms? I've seen a few references to limiting which platforms are built to reduce generated binary size, but I haven't found any way to do this in the makefiles. |
The README files aren't, the code is. Unless you know absolutely otherwise (and figuring out what exactly that means has been the rub),
When you built the ST-Link platform for Blue Pill, you will have had 4 files created in the
The problem is they only work for distros that still make Python 3.8 available, and we get a lot of complaints when the instructions that are published do not work on, eg, current Ubuntu, Debian, or Arch. Trying to build universal instructions under these conditions is just not something we can do, and not for a lack of trying but because the packages to install just don't exist. If we can figure out a recommendation for Linux users on how to get a working Note that we recommend the toolchain for its GCC specifically - the backdrop to this is that if you install Ubuntu's With point 7, we beat you to it slightly - see PR #1633 😅 We'd much appreciate the help sorting out this particular issue and figuring out what is meant by "bluepill" in the swlink platform. We'd also note that it was point out to us a couple of days ago that the board should specifically be referred to as the Blue Pill, not Bluepill, so that also needs updating across the documentation. |
Specifically for python, as far as I know installing any version of python3.8 (ex. from the python website) works. The GNU-RM installation guidelines would be helpful. Ordinarily I'd agree it's an upstream issue, but I'm not expecting arm to change anything. For the python issue, posting instructions on making a venv (or pointing to a different python installation, don't know how windows works) and which variables to set (PYTHONHOME, PYTHONPATH) would go a long way toward helping people to figure it out themselves on other platforms. Who pointed out Blue Pill vs Bluepill? I was under the impression that was an unofficial title, with the semi-official being Shenzhen-LC stm32f103 board, Minimum System Development Board, or just calling it a clone of the original, which was from acorn(?), pine(?) or something a few years before the blue pill boards became popular. I'm setting up my soldering equipment to turn this blue pill into a decent BMP. |
Re Python 3.8: You can download a source tarball from the Python website, but you cannot download prebuilt packages. This then winds up bringing up the problem of "so where do we ask the user to install this custom build, that's outside their package manager", and so on. It's not about venvs, because those only apply after you've installed the Python binaries themselves, but the actual Python binaries - you can't just symlink libpython3.10.so to libpython3.8.so for example, as they're binary incompatible. It requires specifically Python 3.8 packages or a custom build - hence the problem. We can fix this for Windows easily enough as that is a prebuilt package installer (and ARM properly ships Python for Windows in that download of the toolchain), and we can sort of fix it for macOS - but that leaves Linux users out in the cold still. The Blue Pill name comes from WeActStudio originally, from what we've been able to tell. Specifically their Blue Pill+ board. All the clones of this get called the same, and hence the STM32 Base name and spacing. |
I'm afraid I still can't get any results from a scan.
Neither SW-DP not JTAG scan return any results. I've tried a few devices. |
Assuming a STM32F1 based processor on the target, the target's SWD interface is on pins 34 and 37 (PA13 - SWDIO, PA14 - SWCLK) so that bit's right. Looks like we transcribed the TMS/SWDIO pin wrong though - that should have been PB14. We'll update the PR accordingly if that then works - apologies. |
Oops! I shouldn't have trusted yet another secondhand source, next time I'll just consult platform.h. It DID seem weird to me that it was reusing PA14. |
Works now! |
Excellent, we've updated the platform PR with that fix and a note to readers to help prevent them making the same mistake |
Wonderful! I'm actually just learning to do arm programming on linux. I know how to program ARM processors in two ways:
It'll take me a while to get used to this, but I'll be glad when I get to stop using windows. |
I've found the official ARM instructions for installing the toolchain. They are incomplete. |
ARM released a new toolchain today, version 13.2Rel1. I'll see if anything has changed when I have time. It still requires python 3.8, but they have included instructions in the release notes.
|
OS: OpenSUSE Leap 20230925
Hardware: 2x bluepill (assumed legitimate), STLink V2 clone
Intended setup: bluepill A connected via microUSB to computer, bluepill B connected to bluepill A as target
Reproduction:
I extracted the tar archive to /opt/arm-gnu-toolchain-12.3
Then, I added to the end of my ~/.bashrc:
export PATH="/opt/arm-gnu-toolchain-12.3/arm-none-eabi/bin:$PATH"
Note: It was incredibly hard to find which probe host to use. I still can't find any one source for build instructions, only instructions in each platform's README.md. The 'stlink' readme does not mention the bluepill at all, but the 'swlink' readme does. However, the official website says that you should use 'stlink'. Neither binary seems to use the bluepill's status LED, I've confirmed the LED functions.
I connect the STLink V2 clone (original firmware) to the 3.3v, GND, SWDIO, and SWCLK pins and plug it into my computer.
Then I set the boot jumpers to boot0=1,boot1=0 and reset the board, just in case.
I set the boot jumpers back to boot0=0,boot1=0 and reset the board.
Verify blackmagic firmware is connected
I disconnect the STLink V2 clone, then connect bluepill A with a microUSB cable.
Next, I run
dmesg | tail
orsudo journalctl -ke
to make sure the device is registered, in my case as /dev/ttyACM0 and /dev/ttyACM1.Run arm-none-eabi-gdb
Unfortunately, this requires some setup.
To make arm-none-eabi-gdb work, I installed the old libncurses5 package from my vendor (my system uses libncurses6) and python3.8 (my system uses python3.11)
Next, I make a python3.8 virtual environment and a file I called start.sh in the folder
~/code/arm/
, with the virtual environment in the subfoldervenv
:To run arm-none-eabi-gdb, I execute:
I have yet to find any instructions on how to actually do this, specifically what pins map to what, or even how to use any blackmagic probe hardware with flying wires instead of a connector.
I use the pinouts from JeeLabs (site will go down soon) and blackmagic-bluepill (long out of date fork with altered pinout), since I can't find any pinout descriptions in any README.md, gpio.h, or stm32f1.c in the blackmagic code, nor anywhere on the official website, including the pinout glossary, EXCEPT in the swlink README.md, which is linked to via an old link on the JeeLabs website. Both JeeLabs and the swlink readme list the SWD pins as PA12 and PA13, so I use female<->female dupont cables to connect the SWD ports of bluepills A and B together. The power light of bluepill B comes on.
Using gdb, I run
monitor
:auto_scan
,swdp_scan
,swd_scan
. All three fail.Next, I try to use JTAG, connecting both PB4 (JTRST) together and connecting PA15 and PB3 (JTDI, JTDO) together. I try running
mon jtag_scan
, it fails, and I swap PA15 and PB3 connections and try again. This also fails.What am I doing wrong? I could build the firmware with debug enabled, but I don't know what to look for. I have tried replacing bluepill B, no change. I tried disconnecting PA15 and PB3, then connecting PB3 to PA3 on bluepill B as per the swlink readme, no change. I have connected bluepill A's 3.3v line to bluepill B's (not the ones on the SWD header), no change. I'm currently using a bluepill with stock firmware (blink) as bluepill B, what can I do to make this work?
If it wasn't clear, this issue is one of documentation, even if I am able to get this to work. It should not be closed until the documentation has been clarified, for all platforms, on how to:
The text was updated successfully, but these errors were encountered: