{"id":13343838,"url":"https://github.com/QuantumLeaps/qpc-zephyr-app","last_synced_at":"2025-03-12T06:30:33.932Z","repository":{"id":119511835,"uuid":"523517262","full_name":"QuantumLeaps/qpc-zephyr-app","owner":"QuantumLeaps","description":"Example project and starting point for creating QP/C-Zephyr applications.","archived":false,"fork":false,"pushed_at":"2024-01-05T13:31:38.000Z","size":93,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-24T16:49:28.573Z","etag":null,"topics":["actor-model","embedded-systems","rtos","state-machine","zephyr-rtos"],"latest_commit_sha":null,"homepage":"https://www.state-machine.com/qpc/zephyr.html","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/QuantumLeaps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSES/GPL-3.0-or-later.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-10T22:44:52.000Z","updated_at":"2023-12-05T11:31:35.000Z","dependencies_parsed_at":"2023-09-26T16:38:33.704Z","dependency_job_id":"c07cc1ef-132f-436b-8cb1-33a3dac1fd10","html_url":"https://github.com/QuantumLeaps/qpc-zephyr-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantumLeaps%2Fqpc-zephyr-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantumLeaps%2Fqpc-zephyr-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantumLeaps%2Fqpc-zephyr-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantumLeaps%2Fqpc-zephyr-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QuantumLeaps","download_url":"https://codeload.github.com/QuantumLeaps/qpc-zephyr-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243171387,"owners_count":20247876,"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":["actor-model","embedded-systems","rtos","state-machine","zephyr-rtos"],"created_at":"2024-07-29T19:32:01.508Z","updated_at":"2025-03-12T06:30:33.643Z","avatar_url":"https://github.com/QuantumLeaps.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![QP Zephyr Module](img/qp-zephyr.jpg)\n\n# QP/C Application with Zephyr\nThis repository provides an example and a good starting point for deveoping\n[QP/C](https://github.com/QuantumLeaps/qpc) applications with Zephyr.\n\nThe provided example is the [Dining Philosopher Problem (DPP)](https://www.state-machine.com/qpc/tut_dpp.html)\napplication consisting of muliple Active Objects.\n\nAdditionally, the application demonstrates the use of the Zephyr's console UART\nto implement [QP/Spy software tracing](https://www.state-machine.com/qtools/qpspy.html).\n\n## Credits\nThis example application has been originally created by [Victor Chavez](https://github.com/vChavezB).\n\n\n### Cloning\nThis repository depends on the [qpc](https://github.com/QuantumLeaps/qpc)\nreposiotory containing the QP/C framework and port to Zephyr, packaged together as an external\n[Zephyr module](https://docs.zephyrproject.org/latest/develop/modules.html).\nFor that reason, to clone also the submodule, the usual `git clone` command needs to be\nfollowed by `--recurse-submodules`\n\n```bash\ngit clone https://github.com/QuantumLeaps/qpc-zephyr-app \u003cmy_project\u003e --recurse-submodules --depth 1\n```\nwhere, `\u003cmy_project\u003e` is the custom name you can give to your project.\n\nThis step produces the following subfolders in your current directory:\n\n```\n\u003ccurrent-dir\u003e\n |\n +- \u003cmy_project\u003e/      - your QP project\n    +- .git/           - git history (safe to delete to save disk space)\n    |\n    +- qpc/            - QP/C framework\n    |  +- zephyr/      - QP/C Zephyr module (don't touch)\n    |\n    +- CMakeLists.txt  - files to build this project (custimize)\n    +- prj.conf        - congiguration for this project (customize)\n```\n\n# Building the Project\nChange directory to `\u003cmy_project\u003e` and type:\n\n```bash\nwest build -b \u003cboard\u003e\n```\nspecific example for the `nucleo_h743zi` board:\n```bash\nwest build -b nucleo_h743zi\n```\n\n# QP/Spy Build Configuration\nThe QP/C Zephyr Module supports the\n[QSPY Software Tracing](https://www.state-machine.com/qtools/qpspy.html)\noption and will add the appropriate macros and files to build the \"QSPY\"\nconfiguration.\n\nIf you wish to enable \"QSPY\" you can provide the option \"QSPY\"\nin the command-line for the build. For example:\n\n```bash\nwest build -b nucleo_h743zi -- -DQSPY=ON\n```\n\n\u003e **NOTE:** The QP/Spy software tracing uses the Zephyr's console UART. This means that the Zephyr `printk()` facility cannot be used while QP/Spy is configured.\n\n\n# Flashing the Board\nConnect the board to your host and type:\n```bash\nwest flash\n```\n\n# Running the Example\nThe example runs right away after flashing. (Some boards might need to be reset).\n\n\n## Using the QP/SPY Software Tracing\nIf you have built the example with QP/Spy, you might want to watch the QP/Spy output.\n\n### The QSPY Host Utility\nTo receive the QP/Spy software tracing output you need to run a special [qspy host application](https://www.state-machine.com/qtools/qspy.html).\n\n\u003e NOTE: You might need to build the `qspy` host utility on your machine.\nThe QSPY utility is available in\n[QTools collection](https://github.com/QuantumLeaps/qtools/tree/master/qspy).\n\n\nTo launch the `qspy` host utility, open a separate terminal and run\n```\nqspy -c \u003cserial-port\u003e\n```\nspecific example:\n```\nqspy -c /dev/ttyACM0\n```\n\n\n### QSPY Output Example\nAfter resetting the board, you should see output similar to the following:\n```\n########## Trg-RST  QP-Ver=701,Build=220810_150847\n           Obj-Dict 0x20003154-\u003eQS_RX\n           Obj-Dict 0x20000680-\u003eAO_Table\n           Obj-Dict 0x20000180-\u003eAO_Philo[0]\n           Obj-Dict 0x20000280-\u003eAO_Philo[1]\n           Obj-Dict 0x20000380-\u003eAO_Philo[2]\n           Obj-Dict 0x20000480-\u003eAO_Philo[3]\n           Obj-Dict 0x20000580-\u003eAO_Philo[4]\n           Obj-Dict 0x0000A52C-\u003etimerID\n           Usr-Dict 00000100-\u003ePHILO_STAT\n           Usr-Dict 00000101-\u003ePAUSED_STAT\n           Usr-Dict 00000102-\u003eCOMMAND_STAT\n           Usr-Dict 00000103-\u003eCONTEXT_SW\n           Obj-Dict 0x20003054-\u003eEvtPool1\n           Obj-Dict 0x20000180-\u003ePhilo_inst[0]\n           Obj-Dict 0x2000026C-\u003ePhilo_inst[0].m_timeEvt\n           Obj-Dict 0x20000280-\u003ePhilo_inst[1]\n           Obj-Dict 0x2000036C-\u003ePhilo_inst[1].m_timeEvt\n           Obj-Dict 0x20000380-\u003ePhilo_inst[2]\n           Obj-Dict 0x2000046C-\u003ePhilo_inst[2].m_timeEvt\n           Obj-Dict 0x20000480-\u003ePhilo_inst[3]\n           Obj-Dict 0x2000056C-\u003ePhilo_inst[3].m_timeEvt\n           Obj-Dict 0x20000580-\u003ePhilo_inst[4]\n           Obj-Dict 0x2000066C-\u003ePhilo_inst[4].m_timeEvt\n           Fun-Dict 0x00008929-\u003ePhilo_initial\n           Fun-Dict 0x0000890F-\u003ePhilo_thinking\n           Fun-Dict 0x00008917-\u003ePhilo_hungry\n           Fun-Dict 0x0000891F-\u003ePhilo_eating\n           Sig-Dict 00000004,Obj=0x00000000-\u003eTIMEOUT_SIG\n0000000327 AO-Subsc Obj=Philo_inst[0],Sig=00000005,Obj=0x20000180\n0000000327 AO-Subsc Obj=Philo_inst[0],Sig=00000009,Obj=0x20000180\n===RTC===\u003e St-Init  Obj=Philo_inst[0],State=0x00009B1B-\u003ePhilo_thinking\n===RTC===\u003e St-Entry Obj=Philo_inst[0],State=Philo_thinking\n0000000328 Init===\u003e Obj=Philo_inst[0],State=Philo_thinking\n0000000334 AO-Subsc Obj=Philo_inst[1],Sig=00000005,Obj=0x20000280\n0000000334 AO-Subsc Obj=Philo_inst[1],Sig=00000009,Obj=0x20000280\n===RTC===\u003e St-Init  Obj=Philo_inst[1],State=0x00009B1B-\u003ePhilo_thinking\n===RTC===\u003e St-Entry Obj=Philo_inst[1],State=Philo_thinking\n0000000334 Init===\u003e Obj=Philo_inst[1],State=Philo_thinking\n0000000340 AO-Subsc Obj=Philo_inst[2],Sig=00000005,Obj=0x20000380\n0000000340 AO-Subsc Obj=Philo_inst[2],Sig=00000009,Obj=0x20000380\n===RTC===\u003e St-Init  Obj=Philo_inst[2],State=0x00009B1B-\u003ePhilo_thinking\n===RTC===\u003e St-Entry Obj=Philo_inst[2],State=Philo_thinking\n0000000340 Init===\u003e Obj=Philo_inst[2],State=Philo_thinking\n0000000346 AO-Subsc Obj=Philo_inst[3],Sig=00000005,Obj=0x20000480\n0000000346 AO-Subsc Obj=Philo_inst[3],Sig=00000009,Obj=0x20000480\n===RTC===\u003e St-Init  Obj=Philo_inst[3],State=0x00009B1B-\u003ePhilo_thinking\n===RTC===\u003e St-Entry Obj=Philo_inst[3],State=Philo_thinking\n0000000346 Init===\u003e Obj=Philo_inst[3],State=Philo_thinking\n0000000352 AO-Subsc Obj=Philo_inst[4],Sig=00000005,Obj=0x20000580\n0000000352 AO-Subsc Obj=Philo_inst[4],Sig=00000009,Obj=0x20000580\n===RTC===\u003e St-Init  Obj=Philo_inst[4],State=0x00009B1B-\u003ePhilo_thinking\n===RTC===\u003e St-Entry Obj=Philo_inst[4],State=Philo_thinking\n0000000352 Init===\u003e Obj=Philo_inst[4],State=Philo_thinking\n           Obj-Dict 0x20000680-\u003eTable::inst\n           Sig-Dict 00000006,Obj=0x00000000-\u003eDONE_SIG\n           Sig-Dict 00000005,Obj=0x00000000-\u003eEAT_SIG\n           Sig-Dict 00000007,Obj=0x00000000-\u003ePAUSE_SIG\n           Sig-Dict 00000008,Obj=0x00000000-\u003eSERVE_SIG\n           Sig-Dict 00000009,Obj=0x00000000-\u003eTEST_SIG\n           Sig-Dict 00000011,Obj=0x20000680-\u003eHUNGRY_SIG\n0000000370 AO-Subsc Obj=Table::inst,Sig=DONE_SIG\n0000000370 AO-Subsc Obj=Table::inst,Sig=PAUSE_SIG\n0000000370 AO-Subsc Obj=Table::inst,Sig=SERVE_SIG\n0000000371 AO-Subsc Obj=Table::inst,Sig=TEST_SIG\n0000000371 PHILO_STAT 0 thinking\n0000000371 PHILO_STAT 1 thinking\n0000000371 PHILO_STAT 2 thinking\n0000000371 PHILO_STAT 3 thinking\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FQuantumLeaps%2Fqpc-zephyr-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FQuantumLeaps%2Fqpc-zephyr-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FQuantumLeaps%2Fqpc-zephyr-app/lists"}