Board pinout editor

Post here first, or if you can't find a relevant section!
Post Reply
robca
Posts: 8
Joined: Sat Feb 29, 2020 10:59 pm

Board pinout editor

Post by robca »

I'm sorry about posting this here, but my Google-fu failed me so far.

I'm building a project using an F411-based black pill https://github.com/WeActTC/MiniF4-STM32 ... Balint.png

I would like to build my own custom version of the universally available pinout maps image (like the one I linked above, just using the actual names of my connections). I'm using all the pins on that board, and it's a bit of a waste having to look at the code (e.g. Encoder1A) then associate it with the right pin (e.g. PB04, in that case) and then find where PB04 is on the connector

It would be a lot easier to simply create a version of that pinout with my own names, print it and keep it next to the board

Since pretty much the majority of those pinouts for all the module use a very similar look, I assume that there is a tool everyone is using. And I'm kinda hoping it's a WYSIWYG tool

Is using Inkscape and possibly something like https://github.com/sparkfun/Graphical_Datasheets the only option? If so, does anyone have a good SVG for the Blue Pill to use as a starting point?
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Board pinout editor

Post by mrburnette »

Already supported: https://github.com/stm32duino/Arduino_C ... 2f4-boards
💚 STM32F401CC WeAct Black Pill 1.7.0 More info
💚 STM32F411CE WeAct Black Pill 1.9.0 More info
In the STM Official Core, the board
Generic_F411Cx [Generic] Define a default USER_BTN 6 months ago
Generic_F411Rx Update source files to new astyle config 7 months ago
are already defined. https://github.com/stm32duino/Arduino_C ... r/variants

Within the folder,https://github.com/stm32duino/Arduino_C ... ric_F411Cx
the file https://github.com/stm32duino/Arduino_C ... /variant.h
show pin definitions as below:

Code: Select all

//                  | DIGITAL | ANALOG | USART     | TWI                  | SPI                            | SPECIAL   |
//                  |---------|--------|-----------|----------------------|--------------------------------|-----------|
#define PA0  A0  // | 0       | A0     |           |                      |                                |           |
#define PA1  A1  // | 1       | A1     |           |                      | SPI4_MOSI                      |           |
#define PA2  A2  // | 2       | A2     | USART2_TX |                      |                                |           |
#define PA3  A3  // | 3       | A3     | USART2_RX |                      |                                |           |
#define PA4  A4  // | 4       | A4     |           |                      | SPI1_SS, (SPI3_SS)             |           |
#define PA5  A5  // | 5       | A5     |           |                      | SPI1_SCK                       |           |
#define PA6  A6  // | 6       | A6     |           |                      | SPI1_MISO                      |           |
#define PA7  A7  // | 7       | A7     |           |                      | SPI1_MOSI                      |           |
#define PA8  8   // | 8       |        |           | TWI3_SCL             |                                |           |
#define PA9  9   // | 9       |        | USART1_TX |                      |                                |           |
#define PA10 10  // | 10      |        | USART1_RX |                      | SPI5_MOSI                      |           |
#define PA11 11  // | 11      |        | USART6_TX |                      | SPI4_MISO                      |           |
#define PA12 12  // | 12      |        | USART6_RX |                      | SPI5_MISO                      |           |
#define PA13 13  // | 13      |        |           |                      |                                | SWD_SWDIO |
#define PA14 14  // | 14      |        |           |                      |                                | SWD_SWCLK |
#define PA15 15  // | 15      |        | USART1_TX |                      | SPI3_SS, (SPI1_SS)             |           |
//                  |---------|--------|-----------|----------------------|--------------------------------|-----------|
#define PB0  A8  // | 16      | A8     |           |                      | SPI5_SCK                       |           |
#define PB1  A9  // | 17      | A9     |           |                      | SPI5_SS                        |           |
#define PB2  18  // | 18      |        |           |                      |                                | BOOT1     |
#define PB3  19  // | 19      |        | USART1_RX | TWI2_SDA             | SPI3_SCK,  (SPI1_SCK)          |           |
#define PB4  20  // | 20      |        |           | TWI3_SDA             | SPI3_MISO, (SPI1_MISO)         |           |
#define PB5  21  // | 21      |        |           |                      | SPI3_MOSI, (SPI1_MOSI)         |           |
#define PB6  22  // | 22      |        | USART1_TX | TWI1_SCL             |                                |           |
#define PB7  23  // | 23      |        | USART1_RX | TWI1_SDA             |                                |           |
#define PB8  24  // | 24      |        |           | TWI1_SCL, (TWI3_SDA) | SPI5_MOSI                      |           |
#define PB9  25  // | 25      |        |           | TWI1_SDA, (TWI2_SDA) | SPI2_SS                        |           |
#define PB10 26  // | 26      |        |           | TWI2_SCL             | SPI2_SCK                       |           |
#define PB12 27  // | 27      |        |           |                      | SPI3_SCK, (SPI2_SS), (SPI4_SS) |           |
#define PB13 28  // | 28      |        |           |                      | SPI4_SCK, (SPI2_SCK)           |           |
#define PB14 29  // | 29      |        |           |                      | SPI2_MISO                      |           |
#define PB15 30  // | 30      |        |           |                      | SPI2_MOSI                      |           |
//                  |---------|--------|-----------|----------------------|--------------------------------|-----------|
#define PC13 31  // | 31      |        |           |                      |                                |           |
#define PC14 32  // | 32      |        |           |                      |                                | OSC32_IN  |
#define PC15 33  // | 33      |        |           |                      |                                | OSC32_OUT |
//                  |---------|--------|-----------|----------------------|--------------------------------|-----------|
#define PH0  34  // | 34      |        |           |                      |                                | OSC_IN    |
#define PH1  35  // | 35      |        |           |                      |                                | OSC_OUT   |
//                  |---------|--------|-----------|----------------------|--------------------------------|-----------|

Image
robca
Posts: 8
Joined: Sat Feb 29, 2020 10:59 pm

Re: Board pinout editor

Post by robca »

I'm sorry if I didn't make myself clear.

I know it's already supported, but the generic pinout (by definition) has all the functions for every pin, including alternate

I want to create a PNG file that shows where on the board a pin is and says, for example, PA0 Button00, nothing else (and not ADC0 in green, CTS2 in light blue, WKUP1 in white, etc)

I want to create an association specific to a single project I'm working on, not the generic pinout. Then I will use a printout of that PNG as a guide to solder the right wires to many boards
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Board pinout editor

Post by mrburnette »

robca wrote: Sun Oct 11, 2020 10:50 pm ...
I want to create an association specific to a single project I'm working on, not the generic pinout. Then I will use a printout of that PNG as a guide to solder the right wires to many boards
Maybe something like in main.ino:

Code: Select all

#include "./MyPinDefs.h"
in MyPinDefs.h (a Tab of main.ino)

Code: Select all

#define Encoder1A   PB04
// more defs below
Last edited by mrburnette on Mon Oct 12, 2020 12:01 am, edited 1 time in total.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Board pinout editor

Post by mrburnette »

In my own projects, I always have a "Notes.h" tab where I use ASCII art to define wiring, pin names, my thoughts ...
Since "Notes.h" IS NOT #included, you can have fun.

Code: Select all

/*
             +-----------------[USB]-----------------+
             | [Vcc]                           [Vcc] |
             | [Gnd]       +------------+      [Gnd] |
   [But|PB8] | [32]        |   Baite    |     [Vbat] |
  [SDA1|PB7] | [15]        | Maple Mini |       [14] | [PC13]
  [SCL1|PB6] | [16]        +------------+       [13] | [PC14]
       [PB5] | [17]                             [12] | [PC15]
       [PB4] | [18]         [LED|PB1|33]     [Reset] |
       [PB3] | [19]                             [11] | [PA0|A8]
      [PA15] | [20]                             [10] | [PA1|A7]
      [PA14] | [21]                             [ 9] | [PA2|A6|TX2]
      [PA13] | [22]                             [ 8] | [PA3|A5|RX2]
 [USB+|PA12] | [23]                             [ 7] | [PA4|A4|SS1]
 [USB-|PA11] | [24]                             [ 6] | [PA5|A3|SCK1]
  [RX1|PA10] | [25]                             [ 5] | [PA6|A2|MISO1]
   [TX1|PA9] | [26]           +-----+           [ 4] | [PA7|A1|MOSI1]
       [PA8] | [27]           |Reset|           [ 3] | [PB0|A0]
[MOSI2|PB15] | [28]           +-----+           [ 2] | [PB2|BOOT1]
[MISO2|PB14] | [29]           | But |           [ 1] | [PB10|SCL2|TX3]
 [SCK2|PB13] | [30]           +-----+           [ 0] | [PB11|SDA2|RX3]
  [SS2|PB12] | [31]                            [Vin] |
             +---------------------------------------+
*/

Code: Select all


Memory Utilization
=====================

'text' is what ends up in flash (only).
'data' is initialized variables: need to be storad in flash, then end up in RAM.
'bss' is uninitialized data: nothing in flash, but does consume RAM.

The "-x --format=sysv" flags to arm-none-eabi-size can be helpful.

Debugging
================

Access all registers:

    (gdb) x/x 0xE000ED14 
    0xe000ed14:     Cannot access memory at address 0xe000ed14
    (gdb) 
    0xe000ed18:     Cannot access memory at address 0xe000ed18
    (gdb) show mem inaccessible-by-default
    Unknown memory addresses will be treated as inaccessible.
    (gdb) set mem inaccessible-by-default off
    (gdb) x/x 0xE000ED14 
    0xe000ed14:     0x00000200

Uploading via SWD
====================

upload_blackmagic.sh:

    #!/bin/bash
    arm-none-eabi-gdb build/stm32f401cc_telemetry.elf < load_blackmagic.gdb
    sleep 1.0

load_blackmagic.gdb:

    target extended-remote /dev/ttyACM0
    monitor swdp_scan
    attach 1
    load
    quit

References
=============

Keil Application Note 209: Using Cortex-M3 and Cortex-M4 Fault Exceptions

ARM Cortex-M3 HardFault Status Register Documentation:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/Cihdjcfc.html

Code: Select all

Pin connections:
    #define TFT_DC 12
    #define TFT_CS 13
    #define TFT_RST 14
    the rest of the pins (MISO,MOSI,SCK) are the standard SPI pins of your mini.



  ILI9341 TFT GLCD display connections for hardware SPI:
  Signal           Maple Mini           Leonardo      LCD Display    UNO pins
  ===============  ===========          ========      ===========    ========
  #define _sclk         6         //         15       J2 pin 7          13
  #define _miso         5 NC      //         14          pin 9          12
  #define _mosi         4         //         16          pin 6          11
  #define TFT_CS       13         //         10          pin 3          10
  #define TFT_DC       12         //          9          pin 5           9
  #define TFT_RST      14         //          8          pin 4           8


 Color definitions for TFT SPI 2.2" Display
    ILI9341_BLACK   0x0000
    ILI9341_BLUE    0x001F
    ILI9341_RED     0xF800
    ILI9341_GREEN   0x07E0
    ILI9341_CYAN    0x07FF
    ILI9341_MAGENTA 0xF81F
    ILI9341_YELLOW  0xFFE0  
    ILI9341_WHITE   0xFFFF


**************************** ILI9341 320x240 DISPLAY LAYOUT ****************************
0,0
----------------------------------------------------------------------------> 319
| nnnT                                                                 DOW
|              lcd.fillRect( 0,  0, 319, 59, 0);     // blank top
|
|
|<- 059 
|
|              lcd.fillRect( 0, 60, 319, 114, 0);     // blank middle
|                              HH:MM:SS A
|
|
|
|<- 174
|              lcd.fillRect( 0, 175, 319, 64, 0);     // blank lower
|
| MON DD YYYY
|
|<- 239
*/

robca
Posts: 8
Joined: Sat Feb 29, 2020 10:59 pm

Re: Board pinout editor

Post by robca »

I must really suck at explaining what I want to do :)

I finally found an SVG, and managed to create what I wanted
black-pill_pinout_arcade.jpg
black-pill_pinout_arcade.jpg (83.15 KiB) Viewed 15498 times
It doesn't look great, but good enough for what I need
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Board pinout editor

Post by mrburnette »

... do not blame yourself ... I completely was off-earth in the ether.

Ray
robca
Posts: 8
Joined: Sat Feb 29, 2020 10:59 pm

Re: Board pinout editor

Post by robca »

mrburnette wrote: Mon Oct 12, 2020 12:04 am ... do not blame yourself ... I completely was off-earth in the ether.

Ray
:lol:

I do appreciate the help, even if not exactly on point. Thanks for playing along
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Board pinout editor

Post by mrburnette »

robca:

You may wish to identify the graphic software you finally selected to use and the download link along with your experience of the product as other readers may wish to follow your documentation method.
robca
Posts: 8
Joined: Sat Feb 29, 2020 10:59 pm

Re: Board pinout editor

Post by robca »

mrburnette wrote: Mon Oct 12, 2020 4:26 pm robca:

You may wish to identify the graphic software you finally selected to use and the download link along with your experience of the product as other readers may wish to follow your documentation method.
Good point. I simply used Inkscape, loaded the SVG I found (https://wiki.cuvoodoo.info/lib/exe/deta ... pinout.svg), replaced the picture of the STM32F103 blue pill with my STM32F411 black pill, deleted the elements I didn't need, and edited the text for the pins relevant to me. Not very elegant, but the result works for me, which is the most important part

I'm sure that there are better ways and I found automated Python scripts, but the investment in making the automated solution work was just not justified for this. So Inkscape and manual editing it was
Post Reply

Return to “General discussion”