stm32_test1/readme.md

51 lines
1.0 KiB
Markdown
Raw Normal View History

2020-10-06 13:37:07 +00:00
## Build environment
2020-10-06 15:29:50 +02:00
On Ubuntu/Debian install
2020-10-03 12:49:03 +02:00
2020-10-06 13:37:07 +00:00
* ``gcc-arm-none-eabi``
* ``openocd``
2020-10-03 12:49:03 +02:00
2020-10-06 15:29:50 +02:00
2020-10-06 13:37:37 +00:00
Alternatively use a prepared Docker image
2020-10-06 15:29:50 +02:00
docker run -it --rm -v ${PWD}:/mnt wollud1969/build-env-arm-none-eabi:1.0.0 bash
2020-10-06 13:37:07 +00:00
## Preparing generated code to include user code
After code generation in CubeMX the ``Makefile`` and the file ``main.c`` in ``Core/Src`` needs
to be edited to include user code. From the ``cube`` directory in the project root run:
2020-10-06 15:29:50 +02:00
../tools/insertMyCode.sh
2020-10-06 13:37:07 +00:00
User code has to life in ``User/Src`` and ``User/Inc``. All ``*.c`` file from ``User/Src`` will be
attached to the ``C_SOURCES`` variable in the ``Makefile``.
## Building
From the ``cube`` directory in the project root simply run
make
## Uploading to the target
Start ``openocd`` from the project root using the existing configuration file (for derived projects
adjust the configuration concerning the use MCU)
openocd -f openocd.cfg
Connect to the started ``openocd`` server using
nc localhost 4444
To upload a built binary enter
...
2020-10-06 15:29:50 +02:00