-
DEPRECATED (will be replaced by STM32G0 Nucleo board): Nucleo-F303RE
- Connections:
- KNX RX voltage divider 33k:2k -> PB0 (COMP4_INP)
- PB1 (COMP4_OUT) -> PA6 (TIM3_CH1)
- PA7 (TIM3_CH2) -> TX MOSFET (shorting 68R to GND, 10k pull-down on gate)
- KNX- <-> GND
- Connections:
-
- Note: make sure to connect NRST along with SWO, SWD and GND to ST-LINK while using OpenOCD
Testing IDE: Visual Studio Code + Arduino plugin + Cortex-Debug plugin
Testing Arduino Core: Additional URL https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json version 1.6.1
"Blink via KNX" sketch currently compiles to approx. 28072 bytes of Flash (without bootloader, size-optimized, without hard-coded addresses, no EEPROM emulation thus not configurable at all yet). Sketch consumes approx. 4mA while powered from KNX bus without any power optimizations. Bootloader is currently approx. 9kB. Thus perfectly OK for 128kB devices.
Use Atollic TrueSTUDIO for STM32
- Use KNXduino library
- Copy
hardware
folder to your sketches folder (eg.~/Arduino
) - Select
KNXdunino
board, andKNXduino Nucleo F303RE with 32kB bootloader
in your IDE (eg. vscode or Arduino IDE) - Select
U(S)ART support: Enable (no generic 'Serial')
- Optional: Select
Optimize
menu according to your preferences
- Fix hardcoded
arduinoPath
path in.vscode/c_cpp_properties.json
file Fix hardcodedbuild OpenOCD and install in PATH (see below)cortex-debug.openocdPath
path in.vscode/settings.json
file- Fix hardcoded
cortex-debug.armToolchainPath
path in.vscode/settings.json
file - Fix hardcoded path to
st_nucleo_g0.cfg
in.vscode/launch.json
file Arduino: Upload
command does not work because ofoutput
option in.vscode/arduino.json
file. UseArduino: Verify
followed byDebug: Continue (F5)
instead.
Note on building OpenOCD for STM32G0:
git clone --recurse-submodules https://repo.or.cz/openocd.git
- patch http://openocd.zylin.com/gitweb?p=openocd.git;a=patch;h=dcec354bfc756c4a4e1034c9461b5d3f4e55a63e
./bootstrap
./configure --disable-werror
make
- make sure you've uninstalled package-managed openocd from system (
sudo apt-get remove openocd
) sudo make install
Use Atollic TrueSTUDIO for STM32, open and build bootloader
project.
- ? Migrate to PlatformIO.org when it will fully support official ST's STM32duino Core (which we use here). PlatformIO.org has much better build and dependency management (configurable preprocessor defines, local references to particular Arduino Core, libraries,...). Watch platformio/platform-ststm32#76
- This project is based on Selfbus project.
- This work is supported by hkfree.org community network.