{"id":19633369,"url":"https://github.com/electronvector/f303-continuous-delivery","last_synced_at":"2025-06-15T07:02:39.241Z","repository":{"id":183736200,"uuid":"669983790","full_name":"ElectronVector/f303-continuous-delivery","owner":"ElectronVector","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-25T00:44:51.000Z","size":12,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-29T09:03:14.451Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ElectronVector.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-24T03:20:13.000Z","updated_at":"2024-08-18T11:06:48.000Z","dependencies_parsed_at":"2023-07-25T16:20:45.193Z","dependency_job_id":null,"html_url":"https://github.com/ElectronVector/f303-continuous-delivery","commit_stats":null,"previous_names":["electronvector/f303-continuous-delivery"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ElectronVector/f303-continuous-delivery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElectronVector%2Ff303-continuous-delivery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElectronVector%2Ff303-continuous-delivery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElectronVector%2Ff303-continuous-delivery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElectronVector%2Ff303-continuous-delivery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ElectronVector","download_url":"https://codeload.github.com/ElectronVector/f303-continuous-delivery/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElectronVector%2Ff303-continuous-delivery/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259935546,"owners_count":22934380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T12:17:08.769Z","updated_at":"2025-06-15T07:02:39.226Z","avatar_url":"https://github.com/ElectronVector.png","language":"C++","readme":"# f303-continuous-delivery\n\nThis is a test example demonstrating how to use Github Actions to build and flash firmware (on real hardware devices).\n\nFor more details on how to flash devices with a Raspberry Pi, see https://www.electronvector.com.\n\nThe skeleton of the project was reused from: https://github.com/cortexm/baremetal.\nThis provided all the startup code.\n\n## Code structure\n\n- `CmakeLists.txt` is Cmake building script\n- `src` folder contain application code\n- `src/startup` folder contain all startup code\n- `ld` folder contain linker scripts\n- `cmake/arm-none-eabi.cmake` is platform file which define compilers and configuration for this project\n\n## Dependencies\n\n- gcc-arm for embedded [download here](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads)\n- [cmake](https://cmake.org/download/)\n\n## Setup\n\nThe Arm GCC toolchain (arm-none-eabi-) must be available in the path.\nAlternatively, define a new toolchain file (the one here is provided in cmake/arm-none-eabi.cmake) and pass it to CMake with `-D CMAKE_TOOLCHAIN_FILE=../cmake/arm-none-eabi.cmake`. \n\n## Building\n\n_Note this assumes you are using Make as the underlying build tool, however I hear Ninja is much better.\n\n```\nmkdir cmake-build-debug\ncd cmake-build-debug\ncmake -D CMAKE_TOOLCHAIN_FILE=../cmake/arm-none-eabi.cmake -D CMAKE_BUILD_TYPE=Debug ..\nmake\n```\n\nchange `CMAKE_BUILD_TYPE=Release` to build a release version.\n\nYou can use also `make bin`, `srec`, `hex`, `flash`, ...\n\n## Changing the architecture\n\nIn the CmakeLists.txt file change CPU_OPTIONS:\n- architecture options:\n    - Cortex-M0: `set(CPU_OPTIONS -mthumb -mcpu=cortex-m0)`\n    - Cortex-M0+ `set(CPU_OPTIONS -mthumb -mcpu=cortex-m0plus)`\n    - Cortex-M3 `set(CPU_OPTIONS -mthumb -mcpu=cortex-m3)`\n    - Cortex-M4 `set(CPU_OPTIONS -mthumb -mcpu=cortex-m4)`\n    - Cortex-M7 `set(CPU_OPTIONS -mthumb -mcpu=cortex-m7)`\n    - Cortex-M23: `set(CPU_OPTIONS -mthumb -mcpu=cortex-m23)`\n    - Cortex-M33: `set(CPU_OPTIONS -mthumb -mcpu=cortex-m33)`\n\n- floating point, add options to CPU_OPTIONS:\n    - soft float `-mfloat-abi=softfp`\n    - hard float `-mfloat-abi=hard`\n- for floating point also add fpv architecture\n    - Cortex-M4 single precision `-mfpu=fpv4-sp-d16`\n    - Cortex-M7 and M33 single-precision `-mfpu=fpv5-sp-d16`\n    - Cortex-M7 and M33 signle and double-precision `-mfpu=fpv5-d16`\n\n*Detailed info about options is in readme: gcc-arm directory: share/doc/gcc-arm-none-eabi/readme.txt\nor in [ARM-Options](https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html) document*\n\n## Using with a Black Magic Probe\n\nThe Black Magic Probe (BMP) is a JTAG/SWD debugger that runs its own GDB server _on the target_.\nThis allows you to use GDB directly over a TTY device without having to configure OpenOCD and run a GDB server on your host machine.\n\n### Hardware setup\n\nThe BMP SWD signals need to be connect from the BMP to the target board.\n\nOn the STM32F303 Discovery board there is a header labeled ST-LINK that has the SWD signals present.\nHOWEVER, this connector is designed for using the ST-Link on the board to program another STM32 on another board.\nTo use this connector to flash the target STM32F303 on the board, you must remove the jumpers and connect these signals:\n- SWCLK: pin 2\n- SWDIO: pin 4\n\nAdditionally 3.3V and ground from the target must also be connected to the BMP.\n\n### Running GDB\n\nGDB can be run from the GCC Arm toolchain with the build output like this:\n\n```shell\narm-none-eabi-gdb cmake-build-debug/f303\n```\n\nWhen running from inside the project file, the .gdbinit file will be loaded with starting GDB.\nThis configures some things to make it easier to use.\n\n## Using the ST-Link onboard the F303 Discovery board\n\nThere is an ST-Link embedded on the F303. To use it, just connect a USB cable to the USB port labeled USB ST-LINK.\n\nStart openocd with this command:\n```shell\nopenocd -f interface/stlink-dap.cfg -f target/stm32f3x.cfg\n```\n\nThen connect to it with GDB with:\n```shell\narm-none-eabi-gdb cmake-build-debug/f303\n```\n\nFrom inside GDB you'll need to attach to the target (by default openocd uses 3333 as the GDB port):\n```shell\ntarget extended-remote :3333\n```\n\nAnd you can load the file with:\n```shell\nload\n```\n\nThere is a GDB command file supplied that will flash the firmware and then exit.\nYou can run it by supplying it at the command line:\n```shell\narm-none-eabi-gdb -x gdb-st-link-flash-and-exit cmake-build-debug/f303\n```\n\nNote that this does NOT require openocd server to be started manually.\nThis GDB command file starts and exits openocd on its own.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectronvector%2Ff303-continuous-delivery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felectronvector%2Ff303-continuous-delivery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectronvector%2Ff303-continuous-delivery/lists"}