Tone2 Pro - Firmware v1.2 + MCU Update

Linux: Upgrade MCU Firmware for Tone2 Pro

# prepare c
which cc || sudo apt-get install build-essential 

# prepare libusb
sudo apt-get install libusb-1.0-0-dev

# prepare udev rules
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="3748", MODE="0666"' | sudo tee /etc/udev/rules.d/stm.rules

# reconnect your tone2 pro
mkdir tone_upgrade
cd tone_upgrade
git clone https://github.com/vdudouyt/stm8flash.git
make -C stm8flash

wget https://dl.khadas.com/Hardware/Tone2/MCU/Tone2_Pro_MCU_Firmware_210417.zip
unzip *.zip

./stm8flash/stm8flash -cstlinkv2 -pstm8s003?3 -s flash \
    -w Tone2_Pro_MCU_Firmware_210417/Tone2_Pro_MCU_BOOT_APP_210417.hex

You should get this output …

Determine FLASH area
Due to its file extension (or lack thereof), "Tone2_Pro_MCU_Firmware_210417/Tone2_Pro_MCU_BOOT_APP_210417.hex" is considered as INTEL HEX format!
8192 bytes at 0x8000... OK
Bytes written: 8192

Upgrade is DONE!

4 Likes

Hi Mac people, you’re welcome to try this out and let us know if you run into any issues!

Mac OS: Upgrade MCU Firmware for Tone2 Pro

#make the tone_upgrade directory and cd into it
mkdir tone_upgrade
cd tone_upgrade

#install homebrew for mac os
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

#install supporting packages
brew install libusb make automake mk-configure install-sh libtool pkg-config wget
echo 'export PATH="/usr/local/opt/m4/bin:$PATH"' >> ~/.zshrc

#clone into the libusb package and install it
git clone https://github.com/libusb/libusb.git
cd libusb
./autogen.sh
./configure
make
make install
cd ..

pkg-config --libs libusb-1.0

#clone into the stm8flash tool and build it
git clone https://github.com/vdudouyt/stm8flash.git
make -C stm8flash

#download new mcu firmware for tone2 pro
wget https://dl.khadas.com/Hardware/Tone2/MCU/Tone2_Pro_MCU_Firmware_210417.zip
unzip *.zip

#flash new firmware into the tone2 pro mcu
./stm8flash/stm8flash -cstlinkv2 -pstm8s003\?3 -s flash \
    -w Tone2_Pro_MCU_Firmware_210417/Tone2_Pro_MCU_BOOT_APP_210417.hex

Example of a successful output:

tone_upgrade % ./stm8flash/stm8flash -cstlinkv2 -pstm8s003\?3 -s flash \
    -w Tone2_Pro_MCU_Firmware_210417/Tone2_Pro_MCU_BOOT_APP_210417.hex
Determine FLASH area
Due to its file extension (or lack thereof), "Tone2_Pro_MCU_Firmware_210417/Tone2_Pro_MCU_BOOT_APP_210417.hex" is considered as INTEL HEX format!
8192 bytes at 0x8000... OK
Bytes written: 8192

Upgrade is DONE!

2 Likes

Okay. I’m impressed. Well done, @hyphop and @tsangyoujun !

3 Likes

You can now just use these fully-automated upgrade scripts for Mac OS or Linux! Just open a Terminal app and copy either of these commands, sudo is not required. Let us know if you run into any issues.

Update MCU:

/bin/bash -c "$(curl -fsSL https://dl.khadas.com/Firmware/Tone2/upgrade_mcu.sh)"

Update XMOS:

/bin/bash -c "$(curl -fsSL https://dl.khadas.com/Firmware/Tone2/upgrade_dfu.sh)"
4 Likes

makes me want to go back to Linux , this is great work Khadas team !

2 Likes

Getting error message:

Check that the cables are in the correct order and orientation for both your Tone2 Pro and the ST-link v2 tool:

You can peak inside the three holes on your Tone2 Pro’s underside, and use some feels to figure out if the metal pins are making contact with the gold pads. When flashing, apply gentle but firm pressure and don’t move the Tone2 Pro or the cable.

  1. GND
  2. SWIM
  3. NRST (RST)

Thanks. I eventually realized that the problem was caused by my not having the Tone2 getting power from the USB port. I didn’t appreciate that the board had to be powered in order for the upgrade to happen.

In fact I thought that having it powered might cause damage.

So after plugging in a USB cable and applying pressure to the pins, I was able to flash the board correctly.

3 Likes

Sorry! First MCU or XMOS?

Either one first is fine! :slight_smile:

2 Likes

I have this error :slight_smile:
Determine FLASH area

Due to its file extension (or lack thereof), “Tone2_Pro_MCU_Firmware_210417/Tone2_Pro_MCU_BOOT_APP_210417.hex” is considered as INTEL HEX format!

8192 bytes at 0x8000… Tries exceeded

And with XMOS :slight_smile:
…/tone_dfu_tool --download Tone2_Pro_Firmware_V1.20_210408/Tone2_Pro_XMOS_V1.20_210408.bin

/bin/bash: line 87: USB-Audio-2.0-Software-v6.1/sc_usb_audio/module_dfu/host/xmos_dfu_linux/tone_dfu_tool: No such file or directory

[i] UPGRADE ERROR (1) - check previous error messages - and try to resolve it

or submit some message to us about this issue plz!

Hello, If using Linux, maybe this video will help…

clean rm -rf ~/tone_upgrade
and try all steps again

1 Like

worked for MCU as for XMOS I have this problem :

Tone2_Pro_Firmware_V1.20_210408.zip 100%[===============================================================================>] 125.41K 408KB/s in 0.3s

2021-05-08 07:24:25 (408 KB/s) - ‘Tone2_Pro_Firmware_V1.20_210408.zip’ saved [128420/128420]

Archive: Tone2_Pro_Firmware_V1.20_210408.zip
creating: Tone2_Pro_Firmware_V1.20_210408/
inflating: Tone2_Pro_Firmware_V1.20_210408/Tone2_Pro_XMOS_V1.20_210408.bin
[i] please connect your Tone Board and PRESS ANY KEY

…/tone_dfu_tool --download Tone2_Pro_Firmware_V1.20_210408/Tone2_Pro_XMOS_V1.20_210408.bin
/bin/bash: line 87: USB-Audio-2.0-Software-v6.1/sc_usb_audio/module_dfu/host/xmos_dfu_linux/tone_dfu_tool: No such file or directory
[i] UPGRADE ERROR (1) - check previous error messages - and try to resolve it
or submit some message to us about this issue plz!

ok show me full output logs

like this …

/bin/bash -c "$(curl -fsSL https://dl.khadas.com/Firmware/Tone2/upgrade_dfu.sh)"
[i] Tone Board DFU upgrade (online script) - PRESS ANY KEY or Escape by Ctrl+C

[sudo] password for master: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libusb-1.0-0-dev is already the newest version (2:1.0.23-2build1).
build-essential is already the newest version (12.8ubuntu1.1).
git is already the newest version (1:2.25.1-1ubuntu3.1).
The following packages were automatically installed and are no longer required:
  libwebrtc-audio-processing1 rtkit
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 140 not upgraded.
SUBSYSTEM=="usb", ATTR{idVendor}=="3353", ATTR{idProduct}=="a002", MODE="0666"
[i] prepare dfu tool
Cloning into 'USB-Audio-2.0-Software-v6.1'...
remote: Enumerating objects: 865, done.
remote: Counting objects: 100% (70/70), done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 865 (delta 41), reused 38 (delta 12), pack-reused 795
Receiving objects: 100% (865/865), 2.45 MiB | 509.00 KiB/s, done.
Resolving deltas: 100% (207/207), done.
make: Entering directory '/home/master/tone_upgrade/USB-Audio-2.0-Software-v6.1/sc_usb_audio/module_dfu/host/xmos_dfu_linux'
g++ -g -o tone_dfu_tool xmosdfu.cpp `pkg-config --libs --cflags libusb-1.0`
make: Leaving directory '/home/master/tone_upgrade/USB-Audio-2.0-Software-v6.1/sc_usb_audio/module_dfu/host/xmos_dfu_linux'
[i] download last FW Tone2_Pro_Firmware_V1.20_210408.zip
--2021-05-08 16:03:38--  https://dl.khadas.com/Firmware/Tone2//Tone2_Pro_Firmware_V1.20_210408.zip
Resolving dl.khadas.com (dl.khadas.com)... 54.197.197.165
Connecting to dl.khadas.com (dl.khadas.com)|54.197.197.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 128420 (125K) [application/zip]
Saving to: ‘Tone2_Pro_Firmware_V1.20_210408.zip’

Tone2_Pro_Firmware_V1.20_210408. 100%[==========================================================>] 125.41K   177KB/s    in 0.7s    

2021-05-08 16:03:40 (177 KB/s) - ‘Tone2_Pro_Firmware_V1.20_210408.zip’ saved [128420/128420]

Archive:  Tone2_Pro_Firmware_V1.20_210408.zip
   creating: Tone2_Pro_Firmware_V1.20_210408/
  inflating: Tone2_Pro_Firmware_V1.20_210408/Tone2_Pro_XMOS_V1.20_210408.bin  
[i] please connect your Tone Board and PRESS ANY KEY

EDIT : Missing pkg-config

1 Like

can you guys publish new measurements with the update applied? im very curious to see if sinad improves in the slightest. Also the multitone im guessing should improve slightly in the high frequencies. On the asr review theres a little tiny spike that im guessing was caused from this issue?

Tnx for testing ! FIXED

1 Like
1 Like

I have this problem: