Skip to content
This repository was archived by the owner on Dec 6, 2018. It is now read-only.

Commit bfdb4b5

Browse files
committed
Merge pull request #386 from forGGe/g378_migrate_cs43l22
cs43l22 example migrated to new tcore scripts
2 parents 028b6bd + 0a4240d commit bfdb4b5

File tree

10 files changed

+31
-47241
lines changed

10 files changed

+31
-47241
lines changed

doc/sphinx/source/examples/stm32f4-discovery-cs43l22.rst

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,53 +25,65 @@ Wiring
2525
| GND | module's GND |
2626
+-------------------+-----------------+
2727

28+
Preparing
29+
~~~~~~~~~
30+
31+
#. Install and initialize theCore (if not done previously)::
32+
33+
pip3 install tcore
34+
# Or if python3-pip is default: pip install tcore
35+
tcore bootstrap
36+
37+
38+
#. Download the example::
39+
40+
tcore init --remote https://github.com/theCore-embedded/example_cs43l22_audio
41+
cd example_cs43l22_audio
42+
2843
Building
2944
~~~~~~~~
3045

31-
#. Complete :ref:`theCore_examples_initial_setup` section.
32-
#. Execute build commands.
33-
The CMake Toolchain file is required to build this application.
34-
theCore already has one suitable for this target.
46+
Run ``compile`` command using theCore CLI::
3547

36-
::
37-
38-
cd examples/cs43l22_audio
39-
mkdir build
40-
cd build
41-
cmake -DCMAKE_TOOLCHAIN_FILE=../../../toolchains/arm-cm4-gnu.cmake ..
42-
make
48+
tcore compile --target stm32f4_disc
4349

4450
Running
4551
~~~~~~~
4652

47-
Firmware will be flashed via ``openocd`` and ``gdb``.
53+
Firmware will be flashed via ``openocd`` debugger and ``flash`` command.
4854

4955
#. Connect stm32f4 Discovery board to USB cable and connect USB <-> UART converter to the PC.
5056

5157
#. Launch ``minicom`` with device associated with USB <-> UART converter.
5258
(``/dev/ttyUSB0`` here used as an example)::
5359

54-
# From new terminal
55-
minicom -D /dev/ttyUSB0
60+
# From new terminal
61+
tcore runenv "minicom -D /dev/ttyUSB0"
62+
63+
Or the same, but with superuser permissions::
64+
65+
# From new terminal
66+
tcore runenv --sudo "minicom -D /dev/ttyUSB0"
5667

5768
#. Determine stm32f4discovery board revision.
5869

5970
If you don't remember your board revision, check FAQ section
6071
:ref:`theCore_STM32F4_Discovery_rev`.
6172

62-
#. Launch ``openocd`` and flash image using script from openocd installation.
73+
#. Launch ``flash`` command in separate terminal, as shown below.
6374

6475
For old STM32F407G-DISC boards, with STLINK/V2:
6576

6677
::
6778

68-
sudo $(which openocd) -f board/stm32f4discovery.cfg -c 'init; reset halt; flash write_image erase audio.bin 0x08000000; reset run; exit'
79+
tcore flash --sudo
80+
6981

7082
For new STM32F407G-DISC1 boards, with STLINK/V2.1:
7183

7284
::
7385

74-
sudo $(which openocd) -f board/stm32f429disc1.cfg -c 'init; reset halt; flash write_image erase audio.bin 0x08000000; reset run; exit'
86+
tcore flash --sudo --debuger-config stlink-v2.1
7587

7688
See :ref:`theCore_SudoOpenOCD_Nix` section to get insight why ``which openocd``
7789
is important.
@@ -83,6 +95,8 @@ Firmware will be flashed via ``openocd`` and ``gdb``.
8395

8496
#. Attach headphones to the audio jack on Discovery board.
8597

98+
#. Wear your headphones and enjoy.
99+
86100
Expected output
87101
~~~~~~~~~~~~~~~
88102

examples/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,6 @@ ExternalProject_Add(stm32f4_exti
4444
INSTALL_COMMAND echo "Install isn't required, skipping...")
4545

4646

47-
################################################################################
48-
# Audio stm32 and cs43l22 demo.
49-
################################################################################
50-
51-
ExternalProject_Add(stm32f4_cs43l22_audio
52-
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/cs43l22_audio
53-
CMAKE_ARGS
54-
-DTHECORE_BUILD_THIRDPARTY_DIR=${THECORE_BUILD_THIRDPARTY_DIR}
55-
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
56-
-DCMAKE_TOOLCHAIN_FILE=${ARM_CM4_GNU_TOOLCHAIN}
57-
BUILD_ALWAYS 1 # Allows to rebuild external project if its files changes
58-
INSTALL_COMMAND echo "Install isn't required, skipping...")
59-
6047
################################################################################
6148
# STM32 and HTU21D demo.
6249
################################################################################

examples/cs43l22_audio/CMakeLists.txt

Lines changed: 0 additions & 29 deletions
This file was deleted.

examples/cs43l22_audio/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)