¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Putting a W8BH Morse Tutor on a 'Blue Pill' with Linux #stm32

 

I made this wiring diagram for the ST-LINK V2 dongle and the STM32F103C8T6 'Blue Pill' (generic).


--
Regards,
Ken, KM4NFQ "Not Fully Qualified"
/g/w8bhMorseTutor


Putting a W8BH Morse Tutor on a 'Blue Pill' with Linux #stm32

 

Well now, I don't know what to say.
I can now program an STM32 with the Arduino IDE.
And it was relatively painless. Go figure.

I was keeping notes, so I will refer to them.
This is with Debian GNU/Linux 10 "Buster" and Arduino IDE 1.8.9

# apt-get install gcc-arm-none-eabi

That seems to have put stuff here:
$HOME/.arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/

This link goes in the Arduino IDE
File > Preferences > Additional Boards Manager URLs:
http://dan.drown.org/stm32duino/package_STM32duino_index.json

Arduino IDE
Tools > Board > Boards Manager

Connect the STM32F103C8T6 to an ST-LINK V2 dongle and plug it in the USB port.

Open and setup the Arduino IDE:
Tools > Board > Board Manager
Type: Contributed
I Installed this one:
STM32F1xx/GD32F1xx boards by stm32duino 2019.12.20

Board: "Generic STM32F103 series"
Variant: "STM32F103C8T6 (20k RAM, 128k Flash)"
Upload method: "STLink"
CPU Speed(MHz): "72MHz (Normal)"
Optimize: "Smallest (default)"
Port: "/dev/ttyS0"

[Upload]

Jolly good! <-- when you see this, the Sketch has been uploaded successfully!
?
I may have already had the UDEV 49 Rules installed when I installed the stlink utilities?

I have successfully installed and gotten the Blue Pill working in the Arduino IDE two previous times.
The first time was with Debian 8 "Jessie", the second time was with Debian 9 "Stretch", and it took me
days to get it to work, both times. I remember it being extremely frustrating.

But this third time was the charm on Debian 10 "Buster".
It was almost as easy as getting an ESP32 to work in the Arduino IDE. Almost.

--
Regards,
Ken, KM4NFQ "Not Fully Qualified"
/g/w8bhMorseTutor


Re: ESP32 rev 1 PCB #esp32

 

Hello John N6API,

This is my recent experience using the Arduino IDE to make a binary, then uploading that binary to a 'Blue Pill' with the stlink utilities from

I downloaded and installed the STM32CubeProgrammer software
I installed the STM32 .json URL in the Arduino Preferences
I used the Board Manager to install the STM32 boards
I tried to upload MorseTutor.ino

An error occurred while uploading the sketch
Sketch uses 52228 bytes (79%) of program storage space. Maximum is 65536 bytes.
Global variables use 6412 bytes (31%) of dynamic memory, leaving 14068 bytes for local variables.
An error occurred while uploading the sketch
STM32_Programmer.sh not found.
Please install it or add '<STM32CubeProgrammer path>/bin' to your PATH environment:
https://www.st.com.en.development-tools/stm32cubeprog.html
Aborting!

However, my PATH is updated.
$echo $PATH
/home/me/STM32CubeProgrammer/bin:/usr/local/bin:/usr/bin:/bin

Do not close the Arduino IDE !!!
A binary file was created and put in /tmp/arduino_build123456/MorseTutor.ino.bin
The arduino_build###### file numbers change.
I copied that file to my $HOME directory and renamed it mt.bin
If you close the Arduino IDE before you grab the binary file, it disappears.

I plugged a 'Blue Pill' into the USB port connected to an ST-LINK V2 dongle
I used the stlink utilities to flash the 'Blue Pill'
(the '$' is my command-line prompt)

$ st-info --probe
Found 1 stlink programmers
?serial: 553f6806503f49482649013f
openocd: "\x55\x3f\x68\x06\x50\x3f\x49\x48\x26\x49\x01\x3f"
? flash: 131072 (pagesize: 1024)
?? sram: 20480
?chipid: 0x0410
? descr: F1 Medium-density device

$ st-flash write mt.bin 0x8000000
st-flash 1.5.1-38-gc3577b5
2019-12-21T09:10:24 INFO common.c: Loading device parameters....
2019-12-21T09:10:24 INFO common.c: Device connected is: F1 Medium-density device, id 0x20036410
2019-12-21T09:10:24 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 1024 bytes
2019-12-21T09:10:24 INFO common.c: Attempting to write 52536 (0xcd38) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x0800cc00 erased
2019-12-21T09:10:27 INFO common.c: Finished erasing 52 pages of 1024 (0x400) bytes
2019-12-21T09:10:27 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2019-12-21T09:10:27 INFO flash_loader.c: Successfully loaded flash loader in sram
?52/52 pages written
2019-12-21T09:10:31 INFO common.c: Starting verification of write complete
2019-12-21T09:10:32 INFO common.c: Flash written and verified! jolly good!

Jolly Good! I plug the newly programmed Blue Pill into the PCB and away we go.

The screens seem to load slower. Otherwise, it seems to work

So it seems to be possible to do it without having the STM32 tool chain installed?
However, I am not sure why the screens seem to refresh at a much slower rate?

When I use the Morse Tutor binary that Bruce created, the screens refresh properly (much faster).
--
Regards,
Ken, KM4NFQ "Not Fully Qualified"
/g/w8bhMorseTutor


New PCB's 100mmx100mm

 

Hi. Just received Bruce's new pcb design from JLCPCB. They look great. Can't wait to build 1 up. I already have an STM32 and 2 ESP32 (old pcb) units built and working.
73
Ken WB2ART?


Re: ESP32 rev 1 PCB #esp32

 

Hi Ken:

You are right on target about the woes of STM32 on The Arduino IDE. I spent several sleepless nights trying to get the IDE to download the binary to the Blue Pill.

Finally I gave up on the IDE and just used the IDE to compile and link the code and then grab the .bin file and used the STLink tool chain to ram the binary to the Blue Pill using the STLink V2 interface. Surprisingly that method works pretty well.

We have way too many Micros with way too many pin counts with way too many pin configurations!

The ESP32S on the other hand works great with the Arduino IDE but the ESP32 also suffers from different pin outs and numbers of pins.

Maybe someday it will all get worked out!

73 - John - N6API


Sent from my iPhone 6!
John J. Bahun
Senior Software / Hardware Engineer - Retired (Apple DTS)
Amateur Radio Operator - N6API Extra Class as of 03/05/2019!
CFO Member #046


Re: ESP32 rev 1 PCB #esp32

 

Hello John, N6API,

I didn't know that the Arduino IDE could be used to program an MCU with a binary blob?
The st-flash utility is much easier to install than the STM32 tool chain.

You can even find pre-compiled binaries for the st-flash utility for some OSes at that site.
Then all you need is an ST-LINK V2 dongle to install the binary.

Once the binary blob is installed on the 'Blue Pill', you can change many things in the Config menu.
The WPM speed can be changed, as well as Farnsworth timing and Wordsworth spacing.
Also the tone can be adjusted. The default 1200Hz is too high for me, so I set it to 600Hz.
If you choose the Callsign menu item, you can key in your callsign which will appear on the splash screen at boot, and also be used in the QSO feature under the Receive menu.

Installing the STM32 tool chain can be a very intense undertaking. I have done it twice on my Linux workstation, and both times were very frustrating experiences. I use the binary blob since I recently reinstalled a new version of Debian on my PC, and I have not installed the STM32 tool chain, yet. As long as Bruce will provide a 'Blue Pill' binary blob for the W8BH Morse Tutor, I see no reason to go through the pain of installing the tool chain a third time. ;-D

--
Regards,
Ken, KM4NFQ "Not Fully Qualified"
/g/w8bhMorseTutor


Re: ESP32 rev 1 PCB #esp32

 

Hello Jerry, K0ES,

You're welcome. The ESP32-WROMM-32 is much easier to program than an STM32F103C8T6 (Blue Pill).
I use the Debian GNU/Linux operating system. If you are using a different OS, maybe you can share your experiences programming the ESP32 on your system. There is such a variety of OSes that people are using.

--
Regards,
Ken, KM4NFQ "Not Fully Qualified"
/g/w8bhMorseTutor


Re: ESP32 rev 1 PCB #esp32

 

Excellent Post - Now if someone could post exact instructions to download the binary to the STM32 (Blue Pill) without having to jump through hoops and just using the Arduino IDE - I would be forever grateful!

73 - John - N6API


Sent from my iPhone 6!
John J. Bahun
Senior Software / Hardware Engineer - Retired (Apple DTS)
Amateur Radio Operator - N6API Extra Class as of 03/05/2019!
CFO Member #046


Re: ESP32 rev 1 PCB #esp32

Jerry / K0ES
 

Ken,

Thanks so much for posting your instructions/guide to getting the ESP32 programmed. I'm a total novice and never would have known what to do without your guidance.?

Jerry / K0ES


Re: 20k Resister #esp32 #build

 

Great! Thanks!


Re: 20k Resister #esp32 #build

 

It should work great.

Bruce

On Mon, Dec 16, 2019 at 3:19 PM Nick Clark <nick4jesus@...> wrote:
Soo... I'm slowly collecting parts. It's coming along nicely. Except.... I just realized that the massive resister kit I purchased had 22K resisters, not 20K... any chance they could work?


20k Resister #esp32 #build

 

Soo... I'm slowly collecting parts. It's coming along nicely. Except.... I just realized that the massive resister kit I purchased had 22K resisters, not 20K... any chance they could work?


Re: ESP32 rev 1 PCB #esp32

 

ESP32 Programming Note:
When the Upload starts, and the Connecting with lines and dots appears, press the IO0 button until it connects.
--
Regards,
Ken, KM4NFQ "Not Fully Qualified"
/g/w8bhMorseTutor


Re: ESP32 rev 1 PCB #esp32

 

There is a new update available for the ESP32 Morse Tutor.
https://github.com/bhall66/morse-tutor/tree/master/MorseTutor_ESP32

Bruce set up the Two Way feature to be full-duplex. That meant that each unit had to make sure that there was nothing to send after each character was received.? That, in turn, made the unit wait between each character received, slowing it down.
?
Full-duplex is not realistic.? In practice,? I am going to wait until the sender is done before I transmit.? ?So he changed the code to be half-duplex, with the benefit of being able to receive at full speed.

--
Regards,
Ken, KM4NFQ "Not Fully Qualified"
/g/w8bhMorseTutor


Re: ESP32 rev 1 PCB #esp32

 

I put the latest and greatest W8BH Morse Tutor on the ESP32.

Arduino IDE 1.8.9
In File > Preferences add:
https://dl.espressif.com/dl/package_esp32_index.json
to Additional Boards Manager URLs and click OK

In Tools > Boards: > Board Manager
find esp32 by Espressif Sysyems and click Install

In Tools > Boards:
find ESP32 Dev Module
and choose it as the Board.

Plug the ESP32-WROOM-32 into a USB port on your PC

Select the proper USB port:
Tools > Port > Serial Ports
and put a check mark in the box.

Open the Source Code for the ESP32 W8BH Morse Tutor.
Edit it if you want to modify anything (callsign, tone, speed, whatever).
Verify
Upload

Done compiling

I got some errors on my first try. It seems I didn't have pyserial installed.

-----8<-----Cut Here----->8-----
Arduino: 1.8.9 (Linux), Board: "ESP32 Dev Module, Disabled, Default 4MB with spi
ffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600,
None"

Traceback (most recent call last):
Multiple libraries were found for "SD.h"
?Used: /home/alone/.arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/SD
?Not used: /home/alone/arduino-1.8.9/libraries/SD
Multiple libraries were found for "WiFi.h"
?Used: /home/alone/.arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/WiFi
?Not used: /home/alone/arduino-1.8.9/libraries/WiFi
? File "/home/alone/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py"
, line 37, in <module>
??? import serial
ImportError: No module named serial
exit status 1
Error compiling for board ESP32 Dev Module.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
-----8<-----Cut Here----->8-----

After installing the pyserial module, everything worked just fine.
I run Debian GNU/Linux 10 "Buster", so the install command was:
# apt-get install python-serial python3-serial

Sketch uses 713494 bytes (54%) of program storage space.
Maximum is 1319720 bytes,
Global variables use 40272 bytes (12%) of of dynamic memory,
leaving 287408 bytes for local variables.
Maximum is 327680 bytes.

The ESP32-WROOM-32 is much easier to get working in the Arduino IDE than the STM32F103C8T6 'Blue Pill', and only slightly less easy than a Mega2560.
--
Regards,
Ken, KM4NFQ "Not Fully Qualified"
/g/w8bhMorseTutor


ESP32 rev 1 PCB #esp32

 

I put together the first ESP32 rev 1 PCB today.
This is one of the boards I ordered from JLCPCB back on Nomember 19.
The PCBs arrived yesterday, after only 23 days.
Five PCBs for $8.49 incl. S&H. However that price was with a $5.00 coupon.

I made a short video of the Morse Tutor playing back a book from the SD card.

https://www.youtube.com/watch?v=WgShvOC2XQc

Those are the default settings. 13WPM, and 1200Hz Tone.
--
Regards,
Ken, KM4NFQ "Not Fully Qualified"
/g/w8bhMorseTutor


Re: W8BH pc boards #pcb

 

Hello Jim, WA7DUY,

I just received my W8BH Morse Tutor ESP32 rev 1 PCBs today.
I ordered five board from JLCPCB. They cost $7.30 plus S&H.
The S&H was $6.19, but I applied a $5.00 coupon, so that went down to $1.19.
So the total cost for five rev 1 ESP32 PCBs was $8.49, including S&H.
That is about $1.70 per board.

I uploaded the Gerbers to JLCPCB on the 19th of November 2019.
So it took 23 days for me to get the PCBs. That was using the cheapest S&H.

Here is a breakdown of the tracking information:

??? Nov 19 2019??? 04:13 am
??? PayPal payment of $8.49 USD to JLCPCB

??? Nov 22 2019??? 10:45 pm
??? Shipment arrived at facility and measured.
??? Longgang,Shenzhen,China

??? Nov 25 2019??? 05:57 pm
??? Depart from facility to service provider.
??? HONG KONG - HONG KONG

??? Nov 27 2019??? 08:05 pm
??? Arrived at Hong Kong hub.
??? HONGKONG

??? Nov 30 2019??? 08:12 pm
??? Hand over to airline.
??? HKG

??? Dec 1 2019??? 12:44 pm
??? shipment departed from airport of origin country
??? HKG

??? Dec 1 2019??? 05:23 pm
??? Shipment arrived at airport of destination country
??? JFK

??? Dec 9 2019??? 02:10 pm
??? Released from customs: customs cleared.
??? JFK

??? Dec 9 2019??? 03:10 pm
??? In transit, it's progressing through Post network
???
??? Dec 12 2019??? 15:45 pm
??? DELIVERED

As you can see, the package stayed in Customs for over a week.

The boards were in a plastic bagged box, wrapped in bubble wrap and they arrived in very good condition. They look good! I am ready to start building and experimenting.

--
Regards,
Ken, KM4NFQ "Not Fully Qualified"
/g/w8bhMorseTutor


Re: New ESP32 board

Jerry / K0ES
 

On Sun, Dec 8, 2019 at 08:22 PM, Bruce Hall wrote:
Bruce,

I enjoyed trhe process of putting together the original MorseTutor so much that I've ordered everything for the new board.

The above link to gerbers sends one to the old board which I realized when the JLCPCB website showed an image of what I uploaded.
The following link takes one to the gerbers for the new board.

Thanks for all you do.

Jerry / K0ES
Copy path
?


Re: New ESP32 board

 

Hi Bruce,

Have read and digested your documents.

Here is a link to the 2 x 18650 battery box with switched output that I use -




Note - some of these battery boxes connect the cells in parallel, the above one has them in series, 8.4V when fully charged.

73 Bob GM4CID


Re: New ESP32 board

 

Hi Bob,

Thanks for writing.? Yes, I have tried these combinations.? My tiny 2800 mAh cellphone power pack has a runtime of 9 hours, and two 18650 cells in parallel (2P) have a runtime of 16 hours.
A few more battery combinations are listed here:?

I haven't tried it, but a 7.4V 2S battery at the barrel jack input should also have decent performance.


Bruce
w8bh.net