-
Notifications
You must be signed in to change notification settings - Fork 92
Getting Started with HydraBus and STM32CubeIDE
The aim of this page is to explain How to Build / Flash and Debug HydraBus firmware with STM32CubeIDE on Windows & Linux.
- HydraBus v1
- STLINK-V3SET (Programmer/Debugger)
- 10x high quality Dupont Wire 2.54mm female to female with min length 8cm (do not exceed 10cm if possible especially to reach maximum speed with SWD 24MHz...)
- Only 9x "Dupont Wire 2.54mm female to female" are required but it is always better to have more/spare ...
- Download and install STM32CubeIDE v1.4 or more for Linux or Windows
- Note1: STM32CubeIDE is free but it requires a registration on ST website to download it
- Note2: All steps in this page have been validated with STM32CubeIDE v1.4.2 and using firmware https://github.com/hydrabus/hydrafw/commit/0099a031d02c396ab06968420faf9eb08ecd2348
-
Official compiler for hydrafw v0.8beta release is GCC ARM 4.9 2015q3(GNU_ARM_4_9_2015q3)
-
WARNING: GCC ARM 4.8.x & GCC ARM 5.0/5-2016-q1 shall be avoided as they crash during link of chibios ...
- This issue shall be fixed with https://launchpad.net/gcc-arm-embedded/+milestone/8-2018-q4-major or more to be confirmed
-
Since 8600bd92a5ed083174e0867355f65a743dcfb9df, it is possible to use GCC 8.1 and newer to compile hydrafw
- Install GCC toolchain GNU_ARM_4_9_2015q3 from https://launchpad.net/gcc-arm-embedded/+milestone/4.9-2015-q3-update
- At end of Installation Install wizard Complete choose only Add path to environment variable
- Install git from http://msysgit.github.io
- Install Python 3.x see https://www.python.org/downloads/windows
- Default Install Example:
C:\Python3\
- Add in environment variable
PATH
the path to Default Install:C:\Python3\
- Open a Command Prompt window (
cmd.exe
) and type following commands:
git clone https://github.com/hydrabus/hydrafw.git hydrafw --recursive cd hydrafw/ cd ./scripts python get-pip.py python -m pip install GitPython --upgrade python -m pip install intelhex --upgrade
Note: For get-pip.py if you need a proxy for internet access set following variables before to launch python get-pip.py: set http_proxy=http://proxy.myproxy.com set https_proxy=https://proxy.myproxy.com
cd ~ sudo apt-get install git dfu-util python putty wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 tar xjf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 echo 'PATH=$PATH:~/gcc-arm-none-eabi-4_9-2015q3/bin' >> ~/.bashrc source ~/.bashrc git clone https://github.com/hydrabus/hydrafw.git hydrafw --recursive cd ~/hydrafw cd ./scripts sudo python get-pip.py sudo python -m pip install GitPython --upgrade sudo python -m pip install intelhex --allow-external intelhex --allow-unverified intelhex cd ..
- For Debian / Ubuntu on 64bits/amd64 system see https://wiki.debian.org/Multiarch/HOWTO in order to enable multi architecture for i386 support.
- When multiarch is enabled you shall also install libc6-i686:i386 (Debian) or libc6:i386 (Ubuntu)
Note: For get-pip.py if you need a proxy for internet access set following variables before to launch python get-pip.py: export http_proxy=http://proxy.myproxy.com export https_proxy=https://proxy.myproxy.com sudo -E python get-pip.py
- Install GCC toolchain GNU_ARM_4_9_2015q3 from https://launchpad.net/gcc-arm-embedded/+milestone/4.9-2015-q3-update
- Select menu
File -> Import...
-
Select
General -> Existing Projects into Workspace
-
Click on
Next
-
Unselect Option
Search for nested projects
-
Now only
hydrafw
project is displayed -
Click on
Finish
-
-
Select
hydrafw
project (click on project with right mouse button)- A contextual menu appears, select
Properties
- Click on
C/C++ Build
=>Environment
and select configurationDebug
- Add Variable
HYDRAFW_DEBUG
with value1
- A contextual menu appears, select
- Select
hydrafw
project (click on project with right mouse button)-
A contextual menu appears, select
Clean Project
-
Clean shall display in Console
Build Finished. 0 errors, 0 warnings.
-
- Select
hydrafw
project (click on project with right mouse button)- A contextual menu appears, select
Build Project
- Build shall display in Console
Build Finished. 0 errors
- A contextual menu appears, select
- Select
hydrafw
project (click on project with right mouse button)- A contextual menu appears, select
Debug As -> Debug Configurations...
- Debug Configuration view appears, double click on
STM32 Cortex-M C/C++ Application
- The entry
hydrafw Debug
is automatically created
- The entry
- A contextual menu appears, select
- Select
Debugger
Tab and configure it like in picture- When all is configured click on
Debug
button
- When all is configured click on
- Debug session is started and program is stopped in start of main() code (you can click on
Resume (F8)
to resume execution of code)
- Select menu
Window -> Show View -> Other... -> SVW
to add all different Serial Wire Viewer features- Add
SWV TraceLog
,SWV ITM Data Console
andSWV Data Trace Timeline Graph
- Then select
SWV TraceLog
and click onConfigure trace
icon to configure SWV - Interesting things to configure are mainly to enable
Timestamps
andITM Sitmulus Ports 0
(for SWO/SWV ITM Data Console especially for debug trace and crash/exception details) - Then click on
OK
button - Last step is to start the Trace(using Serial Wire Viewer settings) by clicking on
Start Trace
button and finally click onResume (F8)
button to see the trace and data in live
- Add
We can see in real-time the different trace and console data during execution of code
- CHANGELOG
- Console commands
- Binary mode guide
-
NFC/HydraNFC v1 guide
- Read UID of an ISO/IEC_14443 Tag
- Read UID and data of a MIFARE Ultralight Tag
- Read UID of an ISO/IEC 15693 Tag
- Emul ISO14443a Tag
- Emul MIFARE Ultralight Tag
- Emul Mifare Classic Tag
- Unique NFC sniffer design
- Launch NFC sniffer from console
- Sniffer ISO14443A wireshark pcap
- Autonomous/stand-alone sniffer mode
- Sniffer ISO14443A real-time infinite trace mode
- HydraFW-HydraNFC-v1.x-TRF7970A-Tutorial