diff --git a/.github/.cSpellWords.txt b/.github/.cSpellWords.txt new file mode 100644 index 00000000..2ecb72f0 --- /dev/null +++ b/.github/.cSpellWords.txt @@ -0,0 +1,98 @@ +ADDR +ATcmd +Blox +C +CATM +CBMC +CCID +CCLK +CEDRXS +CEREG +CFUN +CG +CGMI +CGMM +CGMR +CGP +CGSN +CIMI +CLK +CMOCK +CPIN +CPINREADY +CRSM +Cbmc +Cmock +Coverity +Cp +Cpsms +DNDEBUG +EDRX +EDRXS +EFHPLM +Edrx +Ftesting +HPLMN +HSDPA +HSDPAHSUPA +HSUPA +Hplmn +IMEI +IMSI +Imsi +MISRA +MQTT +MSI +Misra +Mockv +Mockx +NBIOT +PKTIO +PSMSettings +Pkio +Pktio +Plmn +Psreg +QCCID +QCFG +QIND +QIOPEN +QIRD +QIURC +QP +QPSMS +QSIMSTAT +Quectel +RDYY +RSRP +RSRQ +Rssi +UTRAN +WCDMA +atlib +cbmc +cgreg +cid +coverity +creg +ctest +eidrx +iccid +imei +lcov +misra +nwscanseq +onse +pdpdeact +pkio +pktios +plantuml +plmn +rsrp +rsrq +sinr +sms +ublox +utest +utrhf +utrhfgdghfg diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f0c71f4..e4ff8e40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,9 @@ name: CI Checks +env: + bashPass: \033[32;1mPASSED - + bashInfo: \033[33;1mINFO - + bashFail: \033[31;1mFAILED - + bashEnd: \033[0m on: push: branches: ["**"] @@ -10,70 +15,91 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone This Repo - uses: actions/checkout@v2 - - name: Build + uses: actions/checkout@v3 + - env: + stepName: Build Unit Tests run: | + # ${{ env.stepName }} + echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}" + sudo apt-get install -y lcov cmake -S test -B build/ \ -G "Unix Makefiles" \ -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_CLONE_SUBMODULES=ON \ -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG' + make -C build/ all - - name: Test - run: | - cd build/ - ctest -E system --output-on-failure - cd .. - - name: Run Coverage + + echo "::endgroup::" + echo -e "${{ env.bashPass }} ${{env.stepName}} ${{ env.bashEnd }}" + + - name: Run Unit Tests + run: ctest --test-dir build -E system --output-on-failure + + - env: + stepName: Line and Branch Coverage Build run: | + # ${{ env.stepName }} + echo -e "::group::${{ env.bashInfo }} Build Coverage Target ${{ env.bashEnd }}" + # Build the coverage target make -C build/ coverage - declare -a EXCLUDE=("\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*") - echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info + + echo -e "::group::${{ env.bashInfo }} Generate Coverage Report ${{ env.bashEnd }}" + # Generate coverage report, excluding extra directories + lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info '*test*' '*CMakeCCompilerId*' '*mocks*' + + echo "::endgroup::" lcov --rc lcov_branch_coverage=1 --list build/coverage.info + echo -e "${{ env.bashPass }} ${{env.stepName}} ${{ env.bashEnd }}" - name: Check Coverage uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main with: - path: ./build/coverage.info + coverage-file: ./build/coverage.info + complexity: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Check complexity - Common uses: FreeRTOS/CI-CD-Github-Actions/complexity@main with: path: ./ + doxygen: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Run doxygen build uses: FreeRTOS/CI-CD-Github-Actions/doxygen@main with: path: ./ + spell-check: runs-on: ubuntu-latest steps: - name: Clone This Repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Run spellings check uses: FreeRTOS/CI-CD-Github-Actions/spellings@main with: path: ./ + formatting: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Check formatting uses: FreeRTOS/CI-CD-Github-Actions/formatting@main with: path: ./ + git-secrets: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Checkout awslabs/git-secrets - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: awslabs/git-secrets ref: master @@ -84,22 +110,49 @@ jobs: run: | git-secrets --register-aws git-secrets --scan + memory_statistics: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: - submodules: 'recursive' + submodules: "recursive" - name: Install Python3 - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: - python-version: '3.11.0' + python-version: "3.11.0" - name: Measure sizes uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main with: - config: .github/memory_statistics_config.json - check_against: docs/doxygen/include/size_table.md + config: .github/memory_statistics_config.json + check_against: docs/doxygen/include/size_table.md + + link-verifier: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check Links + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main + + verify-manifest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 + + - name: Run manifest verifier + uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@main + with: + path: ./ + fail-on-incorrect-version: true + + proof_ci: + if: ${{ github.event.pull_request }} runs-on: cbmc_ubuntu-latest_64-core steps: - name: Set up CBMC runner diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml new file mode 100644 index 00000000..8257adda --- /dev/null +++ b/.github/workflows/formatting.yml @@ -0,0 +1,23 @@ +name: Format Pull Request Files + +on: + issue_comment: + types: [created] + +env: + bashPass: \033[32;1mPASSED - + bashInfo: \033[33;1mINFO - + bashFail: \033[31;1mFAILED - + bashEnd: \033[0m + +jobs: + Formatting: + name: Run Formatting Check + if: ${{ github.event.issue.pull_request }} && + ( ( github.event.comment.body == '/bot run uncrustify' ) || + ( github.event.comment.body == '/bot run formatting' ) ) + runs-on: ubuntu-20.04 + steps: + - name: Apply Formatting Fix + uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@main + id: check-formatting diff --git a/.github/workflows/memory_statistics.yml b/.github/workflows/memory_statistics.yml index b986a4ee..e4e0f626 100644 --- a/.github/workflows/memory_statistics.yml +++ b/.github/workflows/memory_statistics.yml @@ -8,15 +8,15 @@ jobs: name: Calculate object sizes runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: - submodules: 'recursive' + submodules: "recursive" - name: Measure sizes uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main with: - config: .github/memory_statistics_config.json + config: .github/memory_statistics_config.json - name: Upload table uses: actions/upload-artifact@v2 with: name: size_table - path: size_table.md \ No newline at end of file + path: size_table.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5a4f346..13808129 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,10 +4,10 @@ on: workflow_dispatch: inputs: commit_id: - description: 'Commit ID to tag and create a release for' + description: "Commit ID to tag and create a release for" required: true version_number: - description: 'Release Version Number (Eg, v1.0.0)' + description: "Release Version Number (Eg, v1.0.0)" required: true jobs: @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ github.event.inputs.commit_id }} - name: Configure git identity @@ -24,7 +24,9 @@ jobs: git config --global user.name ${{ github.actor }} git config --global user.email ${{ github.actor }}@users.noreply.github.com - name: create a new branch that references commit id - run: git checkout -b ${{ github.event.inputs.version_number }} ${{ github.event.inputs.commit_id }} + run: + git checkout -b ${{ github.event.inputs.version_number }} ${{ + github.event.inputs.commit_id }} - name: Generate SBOM uses: FreeRTOS/CI-CD-Github-Actions/sbom-generator@main with: @@ -53,7 +55,7 @@ jobs: - name: Install ZIP tools run: sudo apt-get install zip unzip - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: ${{ github.event.inputs.commit_id }} path: FreeRTOS-Cellular-Interface @@ -93,8 +95,12 @@ jobs: - name: Create artifact of ZIP uses: actions/upload-artifact@v2 with: - name: FreeRTOS-Cellular-Interface-${{ github.event.inputs.version_number }}.zip - path: zip-check/FreeRTOS-Cellular-Interface-${{ github.event.inputs.version_number }}.zip + name: + FreeRTOS-Cellular-Interface-${{ github.event.inputs.version_number + }}.zip + path: + zip-check/FreeRTOS-Cellular-Interface-${{ + github.event.inputs.version_number }}.zip deploy-doxygen: needs: tag-commit name: Deploy doxygen documentation @@ -120,13 +126,17 @@ jobs: with: tag_name: ${{ github.event.inputs.version_number }} release_name: ${{ github.event.inputs.version_number }} - body: Release ${{ github.event.inputs.version_number }} of the FreeRTOS-Cellular-Interface Library. + body: + Release ${{ github.event.inputs.version_number }} of the + FreeRTOS-Cellular-Interface Library. draft: false prerelease: false - name: Download ZIP artifact uses: actions/download-artifact@v2 with: - name: FreeRTOS-Cellular-Interface-${{ github.event.inputs.version_number }}.zip + name: + FreeRTOS-Cellular-Interface-${{ github.event.inputs.version_number + }}.zip - name: Upload Release Asset id: upload-release-asset uses: actions/upload-release-asset@v1 @@ -134,6 +144,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./FreeRTOS-Cellular-Interface-${{ github.event.inputs.version_number }}.zip - asset_name: FreeRTOS-Cellular-Interface-${{ github.event.inputs.version_number }}.zip + asset_path: + ./FreeRTOS-Cellular-Interface-${{ github.event.inputs.version_number + }}.zip + asset_name: + FreeRTOS-Cellular-Interface-${{ github.event.inputs.version_number + }}.zip asset_content_type: application/zip diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e3d9274..2f8be459 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,54 +1,105 @@ # Change Log for FreeRTOS Cellular Interface Library ## v1.3.0 (October 2022) + ### Updates - - [#102](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/102) MISRA C:2012 Compliance update. - - [#101](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/101) Add Cellular common AT command timeout. - - [#99](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/99) CBMC Starter kit update. - - [#98](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/98) HL7802 Finish processing packets after remote disconnect. - - [#96](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/96) Add config to disable hardware flow control. - - [#94](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/94) Cellular Socket State design update. - - [#92](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/92) Socket CONNECTING state change. - - [#90](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/90) Handle network registration URC in AT Command response callback. - - [#88](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/88) Set TCP Local Port. - - [#86](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/86) Restore URC String when using generic URC callback. - - [#85](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/85) SARA-R4 socket receive response handling. - - [#84](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/84) HL7802 Signal processing function update. - - [#82](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/82) Add default RAT selection list. - - [#80](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/80) Hl7802 Delay after reboot. - - [#79](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/79) SARA-R4 Get PDN Status. - - [#77](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/77) HL7802 AT command timeout update. - - [#76](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/76) HL7802 band config detection and changes to log messages. - - [#75](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/75) SARA-R4 Reboot on init and changes to log messages. + +- [#102](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/102) MISRA + C:2012 Compliance update. +- [#101](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/101) Add + Cellular common AT command timeout. +- [#99](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/99) CBMC + Starter kit update. +- [#98](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/98) HL7802 + Finish processing packets after remote disconnect. +- [#96](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/96) Add + config to disable hardware flow control. +- [#94](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/94) + Cellular Socket State design update. +- [#92](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/92) Socket + CONNECTING state change. +- [#90](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/90) Handle + network registration URC in AT Command response callback. +- [#88](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/88) Set TCP + Local Port. +- [#86](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/86) Restore + URC String when using generic URC callback. +- [#85](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/85) SARA-R4 + socket receive response handling. +- [#84](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/84) HL7802 + Signal processing function update. +- [#82](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/82) Add + default RAT selection list. +- [#80](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/80) Hl7802 + Delay after reboot. +- [#79](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/79) SARA-R4 + Get PDN Status. +- [#77](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/77) HL7802 + AT command timeout update. +- [#76](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/76) HL7802 + band config detection and changes to log messages. +- [#75](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/75) SARA-R4 + Reboot on init and changes to log messages. ## v1.2.0 (December 2021) + ### Updates - - [#62](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/62) Fix uintptr compile error. - - [#67](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/67) Fix too many arguments log. - - [#64](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/64) Remove strnlen usage. + +- [#62](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/62) Fix + uintptr compile error. +- [#67](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/67) Fix too + many arguments log. +- [#64](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/64) Remove + strnlen usage. ### Other - - [#63](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/63) Fix broken links. - - [#61](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/61) Fix typo in README.md. - - [#69](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/69) Loop invariant update. - - [#65](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/65) Submodule community ports repo to third party folder. - - [#70](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/70) fix CBMC potential issues. + +- [#63](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/63) Fix + broken links. +- [#61](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/61) Fix + typo in README.md. +- [#69](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/69) Loop + invariant update. +- [#65](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/65) + Submodule community ports repo to third party folder. +- [#70](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/70) fix + CBMC potential issues. ## v1.1.0 (November 2021) + ### Updates - - [#40](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/40) Fix the module logging mechanism format. - - [#53](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/53) Use the stdint.h header file for integer types. - - [#55](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/55) Add function for validating the prefix character of cellular module response. - - [#57](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/57) Fix unknown type issue. + +- [#40](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/40) Fix the + module logging mechanism format. +- [#53](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/53) Use the + stdint.h header file for integer types. +- [#55](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/55) Add + function for validating the prefix character of cellular module response. +- [#57](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/57) Fix + unknown type issue. ### Other - - [#52](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/52) Resolve ublox sara r4 build warnings. - - [#42](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/42) Fix spelling check failure in CI tools. - - [#43](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/43) [#46](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/46) [#54](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/54) Minor documentation updates. - - [#48](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/48) Header Guards for C++ linkage. + +- [#52](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/52) Resolve + ublox sara r4 build warnings. +- [#42](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/42) Fix + spelling check failure in CI tools. +- [#43](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/43) + [#46](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/46) + [#54](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/54) Minor + documentation updates. +- [#48](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/pull/48) Header + Guards for C++ linkage. ## v1.0.0 (September 2021) -This is the first release of the FreeRTOS Cellular Interface library in this repository. +This is the first release of the FreeRTOS Cellular Interface library in this +repository. -The FreeRTOS Cellular Interface library provides an implementation of the standard AT commands for the [3GPP TS v27.007](https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1515) and support for the 3 cellular modems [Quectel BG96](https://www.quectel.com/product/bg96.htm), [Sierra Wireless HL7802](https://www.sierrawireless.com/products-and-solutions/embedded-solutions/products/hl7802/) and [U-Blox Sara-R4](https://www.u-blox.com/en/product/sara-r4-series). +The FreeRTOS Cellular Interface library provides an implementation of the +standard AT commands for the +[3GPP TS v27.007](https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1515) +and support for the 3 cellular modems +[Quectel BG96](https://devices.amazonaws.com/detail/a3G0h0000077rK6EAI/LTE-BG96-Cat-M1-NB1-EGPRS-Module), +[Sierra Wireless HL7802](https://www.sierrawireless.com/iot-modules/lpwa-modules/hl7802/) +and [U-Blox Sara-R4](https://www.u-blox.com/en/product/sara-r4-series). diff --git a/MISRA.md b/MISRA.md index 5d0d7961..56096d09 100644 --- a/MISRA.md +++ b/MISRA.md @@ -1,113 +1,133 @@ # MISRA Compliance -The FreeRTOS-Cellular-Interface library files conform to the [MISRA C:2012](https://www.misra.org.uk/MISRAHome/MISRAC2012/tabid/196/Default.aspx) -guidelines, with the deviations listed below. Compliance is checked with Coverity static analysis. -The specific deviations, suppressed inline, are listed below. +The FreeRTOS-Cellular-Interface library files conform to the +[MISRA C:2012](https://www.misra.org.uk/) +guidelines, with the deviations listed below. Compliance is checked with +Coverity static analysis. The specific deviations, suppressed inline, are listed +below. -Additionally, [MISRA configuration file](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/blob/main/tools/coverity/misra.config) contains the project wide deviations. +Additionally, +[MISRA configuration file](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/blob/main/tools/coverity/misra.config) +contains the project wide deviations. ### Suppressed with Coverity Comments + To find the violation references in the source files run grep on the source code with ( Assuming rule 10.4 violation; with justification in point 1 ): + ``` grep 'MISRA Ref 10.4.1' . -rI ``` #### Directive 4.6 + _Ref 4.6.1_ - MISRA C-2012 Directive 4.6 warns against using types that do not contain size - and sign information. The use of isalpha, isdigit, and isspace set this directive - off since they use base types that don't contain this information. We do not have - control over these functions so we are suppressing these violations. + and sign information. The use of isalpha, isdigit, and isspace set this + directive off since they use base types that don't contain this information. + We do not have control over these functions so we are suppressing these + violations. #### Directive 4.7 + _Ref 4.7.1_ -- MISRA C 2012 Directive 4.7 requires that when a function returns error information, - that error information shall be tested. The following line violates MISRA rule 4.7 - because return value of strtol() is not checked for error. This violation is - justified because error checking by "errno" for any POSIX API is not thread - safe in FreeRTOS unless "configUSE_POSIX_ERRNO" is enabled. In order to avoid the - dependency on this feature, errno variable is not used. +- MISRA C 2012 Directive 4.7 requires that when a function returns error + information, that error information shall be tested. The following line + violates MISRA rule 4.7 because return value of strtol() is not checked for + error. This violation is justified because error checking by "errno" for any + POSIX API is not thread safe in FreeRTOS unless "configUSE_POSIX_ERRNO" is + enabled. In order to avoid the dependency on this feature, errno variable is + not used. #### Rule 10.4 + _Ref 10.4.1_ -- MISRA C-2012 Rule 10.4 warns about using different types in an operation. - This rule is being flagged because of use of the standard library functions - isalpha, isdigit, and isspace. We do not have control over these functions so we - are suppressing these violations. +- MISRA C-2012 Rule 10.4 warns about using different types in an operation. This + rule is being flagged because of use of the standard library functions + isalpha, isdigit, and isspace. We do not have control over these functions so + we are suppressing these violations. #### Rule 10.5 + _Ref 10.5.1_ -- MISRA C-2012 Rule 10.5 Converting to an enum type. The variables - are checked to ensure that they are valid, and within a valid range. - Hence, assigning the value of the variable with a enum cast. +- MISRA C-2012 Rule 10.5 Converting to an enum type. The variables are checked + to ensure that they are valid, and within a valid range. Hence, assigning the + value of the variable with a enum cast. #### Rule 10.8 + _Ref 10.8.1_ -- MISRA C-2012 Rule 10.8 warns about casting from unsigned to signed types. - This rule is being flagged because of use of the standard library functions - isalpha and isdigit. We do not have control over these so we are suppressing - these violations. +- MISRA C-2012 Rule 10.8 warns about casting from unsigned to signed types. This + rule is being flagged because of use of the standard library functions isalpha + and isdigit. We do not have control over these so we are suppressing these + violations. #### Rule 11.3 + _Ref 11.3.1_ -- MISRA C-2012 Rule 11.3 does not allow casting of a pointer to different object types. - We are passing in a length variable which is then checked to determine what to - cast this value to. As such we are not worried about the chance of - misaligned access when using the cast variable. +- MISRA C-2012 Rule 11.3 does not allow casting of a pointer to different object + types. We are passing in a length variable which is then checked to determine + what to cast this value to. As such we are not worried about the chance of + misaligned access when using the cast variable. #### Rule 21.6 + _Ref 21.6.1_ - MISRA C-2012 Rule 21.6 warns about the use of standard library input/output - functions as they might have implementation defined or undefined - behaviour. The max length of the strings are fixed and checked offline. + functions as they might have implementation defined or undefined behaviour. + The max length of the strings are fixed and checked offline. #### Rule 21.9 + _Ref 21.9.1_ -- MISRA C-2012 Rule 21.9 does not allow the use of bsearch. This is becasue of - unspecified behavior, which relates to the treatment of elements that compare as - equal, can be avoided by ensuring that the comparison function never returns 0. - When two elements are otherwise equal, the comparison function could - return a value that indicates their relative order in the initial array. - This the token table must be checked without duplicated string. The return value - is 0 only if the string is exactly the same. +- MISRA C-2012 Rule 21.9 does not allow the use of bsearch. This is because of + unspecified behavior, which relates to the treatment of elements that compare + as equal, can be avoided by ensuring that the comparison function never + returns 0. When two elements are otherwise equal, the comparison function + could return a value that indicates their relative order in the initial array. + This the token table must be checked without duplicated string. The return + value is 0 only if the string is exactly the same. #### Rule 22.8 + _Ref 22.8.1_ -- MISRA C 2012 Rule 22.8 Requires the errno variable must be "zero" before calling - strtol function. This violation is justified because error checking by "errno" - for any POSIX API is not thread safe in FreeRTOS unless "configUSE_POSIX_ERRNO" - is enabled. In order to avoid the dependency on this feature, errno variable is - not used. The function strtol returns LONG_MIN and LONG_MAX in case of underflow - and overflow respectively and sets the errno to ERANGE. It is not possible to - distinguish between valid LONG_MIN and LONG_MAX return values and underflow and - overflow scenarios without checking errno. Therefore, we cannot check return value - of strtol for errors. We ensure that strtol performed a valid conversion by - checking that *pEndPtr is '\0'. strtol stores the address of the first invalid - character in *pEndPtr and therefore, '\0' value of *pEndPtr means that the complete - pToken string passed for conversion was valid and a valid conversion wasperformed. +- MISRA C 2012 Rule 22.8 Requires the errno variable must be "zero" before + calling strtol function. This violation is justified because error checking by + "errno" for any POSIX API is not thread safe in FreeRTOS unless + "configUSE_POSIX_ERRNO" is enabled. In order to avoid the dependency on this + feature, errno variable is not used. The function strtol returns LONG_MIN and + LONG_MAX in case of underflow and overflow respectively and sets the errno to + ERANGE. It is not possible to distinguish between valid LONG_MIN and LONG_MAX + return values and underflow and overflow scenarios without checking errno. + Therefore, we cannot check return value of strtol for errors. We ensure that + strtol performed a valid conversion by checking that *pEndPtr is '\0'. strtol + stores the address of the first invalid character in *pEndPtr and therefore, + '\0' value of \*pEndPtr means that the complete pToken string passed for + conversion was valid and a valid conversion wasperformed. #### Rule 22.9 + _Ref 22.9.1_ -- MISRA C 2012 Rule 22.9 requires that errno must be tested after strtol function is - called.This violation is justified because error checking by "errno" - for any POSIX API is not thread safe in FreeRTOS unless "configUSE_POSIX_ERRNO" - is enabled. In order to avoid the dependency on this feature, errno variable is - not used. The function strtol returns LONG_MIN and LONG_MAX in case of underflow - and overflow respectively and sets the errno to ERANGE. It is not possible to - distinguish between valid LONG_MIN and LONG_MAX return values and underflow and - overflow scenarios without checking errno. Therefore, we cannot check return value - of strtol for errors. We ensure that strtol performed a valid conversion by - checking that *pEndPtr is '\0'. strtol stores the address of the first invalid - character in *pEndPtr and therefore, '\0' value of *pEndPtr means that the complete - pToken string passed for conversion was valid and a valid conversion wasperformed. \ No newline at end of file +- MISRA C 2012 Rule 22.9 requires that errno must be tested after strtol + function is called.This violation is justified because error checking by + "errno" for any POSIX API is not thread safe in FreeRTOS unless + "configUSE_POSIX_ERRNO" is enabled. In order to avoid the dependency on this + feature, errno variable is not used. The function strtol returns LONG_MIN and + LONG_MAX in case of underflow and overflow respectively and sets the errno to + ERANGE. It is not possible to distinguish between valid LONG_MIN and LONG_MAX + return values and underflow and overflow scenarios without checking errno. + Therefore, we cannot check return value of strtol for errors. We ensure that + strtol performed a valid conversion by checking that *pEndPtr is '\0'. strtol + stores the address of the first invalid character in *pEndPtr and therefore, + '\0' value of \*pEndPtr means that the complete pToken string passed for + conversion was valid and a valid conversion wasperformed. diff --git a/README.md b/README.md index c3e58193..386325a1 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,47 @@ # FreeRTOS Cellular Interface ## On this page: -* [Introduction](#Introduction) -* [Getting Started](#Getting-Started) - * [Download the source code](#Download-the-source-code) - * [Folder Structure](#Folder-Structure) -* [Integrate FreeRTOS Cellular Interface with MCU platforms](#Integrate-FreeRTOS-Cellular-Interface-with-MCU-platforms) -* [Adding support for new cellular modems](#Adding-support-for-new-cellular-modems) -* [Integrate FreeRTOS Cellular Interface with Cellular Modules](#integrate-freertos-cellular-interface-with-cellular-modules) -* [Building Unit Tests](#Building-Unit-Tests) -* [Generating documentation](#Generating-documentation) -* [Contributing](#Contributing) -## Introduction - -The Cellular Interface library implement a simple unified [Application Programing Interfaces (APIs)](https://www.freertos.org/Documentation/api-ref/cellular/index.html) that hide the complexity of AT commands. The cellular modems to be interchangeable with the popular options built upon TCP stack and exposes a socket-like interface to C programmers. - -Most cellular modems implement more or less the AT commands defined by the [3GPP TS v27.007](https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1515) standard. This project provides an implementation of such standard AT commands in a [reusable common component](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/tree/main/source/include/common). The three Cellular libraries in this project all take advantage of that common code. The library for each modem only implements the vendor-specific AT commands, then exposes the complete Cellular API. +- [Introduction](#Introduction) +- [Getting Started](#Getting-Started) + - [Download the Source Code](#Download-the-Source-Code) + - [Folder Structure](#Folder-Structure) +- [Implement Comm Interface with MCU Platforms](#Implement-Comm-Interface-with-MCU-Platforms) +- [Adding Support for New Cellular Modems](#Adding-Support-for-New-Cellular-Modems) +- [Integrate FreeRTOS Cellular Interface with Application](#Integrate-FreeRTOS-Cellular-Interface-with-Application) +- [Building Unit Tests](#Building-Unit-Tests) +- [Generating Documentation](#Generating-Documentation) +- [Contributing](#Contributing) -The common component that implements the 3GPP TS v27.007 standard has been written in compliance of the following code quality criteria: - -* GNU Complexity scores are not over 8. -* MISRA coding standard. Any deviations from the MISRA C:2012 guidelines are documented in source code comments marked by "`coverity`". +## Introduction -**FreeRTOS Cellular Interface v1.3.0 [source code](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/tree/v1.3.0/source) is part of the [FreeRTOS 202210.00 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202210.00-LTS) release.** +The Cellular Interface library implement a simple unified +[Application Programming Interfaces (APIs)](https://www.freertos.org/Documentation/api-ref/cellular/index.html) +that hide the complexity of AT commands. The cellular modems to be +interchangeable with the popular options built upon TCP stack and exposes a +socket-like interface to C programmers. + +Most cellular modems implement more or less the AT commands defined by the +[3GPP TS v27.007](https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1515) +standard. This project provides an implementation of such standard AT commands +in a +[reusable common component](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/tree/main/source/include/common). +The three Cellular libraries in this project all take advantage of that common +code. The library for each modem only implements the vendor-specific AT +commands, then exposes the complete Cellular API. + +The common component that implements the 3GPP TS v27.007 standard has been +written in compliance of the following code quality criteria: + +- GNU Complexity scores are not over 8. +- MISRA coding standard. Any deviations from the MISRA C:2012 guidelines are + documented in source code comments marked by "`coverity`". + +**FreeRTOS Cellular Interface v1.3.0 +[Source Code](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/tree/v1.3.0/source) +is part of the +[FreeRTOS 202210.00 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202210.00-LTS) +release.** ## Getting Started @@ -45,64 +63,101 @@ git clone git@github.com/FreeRTOS/FreeRTOS-Cellular-Interface.git At the root of this repository are these folders: -* source : reusable common code that implements the standard AT commands defined by 3GPP TS v27.007. -* docs : documentations. -* test : unit test and cbmc. -* tools : tools for Coverity static analysis and CMock. +- source : reusable common code that implements the standard AT commands defined + by 3GPP TS v27.007. +- docs : documentations. +- test : unit test and cbmc. +- tools : tools for Coverity static analysis and CMock. ## Implement Comm Interface with MCU platforms -The FreeRTOS Cellular Interface runs on MCUs. It uses an abstracted interface - the [Comm Interface](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/tree/main/source/interface/cellular_comm_interface.h), to communicate with cellular modems. A Comm Interface must be implemented as well on the MCU platform. The most common implementations of the Comm Interface are over UART hardware, but it can be implemented over other physical interfaces such as SPI as well. The documentation of the Comm Interface is found within the [Cellular API References](https://www.freertos.org/Documentation/api-ref/cellular/cellular_porting.html#cellular_porting_comm_if). These are example implementations of the Comm Interface: - -* [FreeRTOS windows simulator comm interface](https://github.com/FreeRTOS/FreeRTOS/blob/main/FreeRTOS-Plus/Demo/FreeRTOS_Cellular_Interface_Windows_Simulator/Common/comm_if_windows.c) -* [FreeRTOS Common IO UART comm interface](https://github.com/aws/amazon-freertos/blob/feature/cellular/vendors/st/boards/stm32l475_discovery/ports/comm_if/comm_if_uart.c) -* [STM32 L475 discovery board comm interface](https://github.com/aws/amazon-freertos/blob/feature/cellular/vendors/st/boards/stm32l475_discovery/ports/comm_if/comm_if_st.c) -* [Sierra Sensor Hub board comm interface](https://github.com/aws/amazon-freertos/blob/feature/cellular/vendors/sierra/boards/sensorhub/ports/comm_if/comm_if_sierra.c) - -The FreeRTOS Cellular Interface uses kernel APIs for task synchronization and memory management. - -## Adding support for new cellular modems - -FreeRTOS Cellular Interface now supports AT commands, TCP offloaded Cellular abstraction Layer. In order to add support for a new cellular modem, the developer can use the [common component](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/tree/main/source/include/common) that has already implemented the 3GPP standard AT commands. +The FreeRTOS Cellular Interface runs on MCUs. It uses an abstracted interface - +the +[Comm Interface](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/tree/main/source/interface/cellular_comm_interface.h), +to communicate with cellular modems. A Comm Interface must be implemented as +well on the MCU platform. The most common implementations of the Comm Interface +are over UART hardware, but it can be implemented over other physical interfaces +such as SPI as well. The documentation of the Comm Interface is found within the +[Cellular API References](https://www.freertos.org/Documentation/api-ref/cellular/cellular_porting.html#cellular_porting_comm_if). +These are example implementations of the Comm Interface: + +- [FreeRTOS Windows Simulator Comm Interface](https://github.com/FreeRTOS/FreeRTOS/blob/main/FreeRTOS-Plus/Demo/FreeRTOS_Cellular_Interface_Windows_Simulator/Common/comm_if_windows.c) +- [FreeRTOS Common IO UART Comm Interface](https://github.com/aws/amazon-freertos/blob/feature/cellular/vendors/st/boards/stm32l475_discovery/ports/comm_if/comm_if_uart.c) +- [STM32 L475 Discovery Board Comm Interface](https://github.com/aws/amazon-freertos/blob/feature/cellular/vendors/st/boards/stm32l475_discovery/ports/comm_if/comm_if_st.c) +- [Sierra Sensor Hub Board Comm Interface](https://github.com/aws/amazon-freertos/blob/feature/cellular/vendors/sierra/boards/sensorhub/ports/comm_if/comm_if_sierra.c) + +The FreeRTOS Cellular Interface uses kernel APIs for task synchronization and +memory management. + +## Adding Support for New Cellular Modems + +FreeRTOS Cellular Interface now supports AT commands, TCP offloaded Cellular +abstraction Layer. In order to add support for a new cellular modem, the +developer can use the +[common component](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/tree/main/source/include/common) +that has already implemented the 3GPP standard AT commands. + +In order to port the +[common component](https://www.freertos.org/Documentation/api-ref/cellular/cellular_porting_module_guide.html): + +1. Implement the cellular modem porting interface defined in + [cellular_common_portable.h](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/tree/main/source/include/common/cellular_common_portable.h) + ([Document](https://www.freertos.org/Documentation/api-ref/cellular/cellular__common__portable_8h.html)). +2. Implement the subset of Cellular Library APIs that use vendor-specific + (non-3GPP) AT commands. The APIs to be implemented are the ones not marked + with an "o" in + [this table](https://www.freertos.org/Documentation/api-ref/cellular/cellular_common__a_p_is.html). +3. Implement Cellular Library callback functions that handle vendor-specific + (non-3GPP) Unsolicited Result Code (URC). The URC handlers to be implemented + are the ones not marked with an "o" in + [this table](https://www.freertos.org/Documentation/api-ref/cellular/cellular_common__u_r_c_handlers.html). + +The +[Cellular Common APIs document](https://www.freertos.org/Documentation/api-ref/cellular/cellular_porting_module_guide.html) +provides detail information required in each steps. It is recommended that you +start by cloning the implementation of one of the existing modems, then make +modifications where your modem's vendor-specific (non-3GPP) AT commands are +different. + +Current Example Implementations: + +- [Quectel BG96](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface-Reference-Quectel-BG96) +- [Sierra Wireless HL7802](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface-Reference-Sierra-Wireless-HL7802) +- [U-Blox Sara-R4](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface-Reference-ublox-SARA-R4) + +## Integrate FreeRTOS Cellular Interface with Application + +Once comm interface and cellular module implementation are ready, we can start +to integrate FreeRTOS Cellular Interface. The following diagram depicts the +relationship of these software components: -In order to port the [common component](https://www.freertos.org/Documentation/api-ref/cellular/cellular_porting_module_guide.html): - -1. Implement the cellular modem porting interface defined in [cellular_common_portable.h](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/tree/main/source/include/common/cellular_common_portable.h) ([Document](https://www.freertos.org/Documentation/api-ref/cellular/cellular__common__portable_8h.html)). -2. Implement the subset of Cellular Library APIs that use vendor-specific (non-3GPP) AT commands. The APIs to be implemented are the ones not marked with an "o" in [this table](https://www.freertos.org/Documentation/api-ref/cellular/cellular_common__a_p_is.html). -3. Implement Cellular Library callback functions that handle vendor-specific (non-3GPP) Unsolicited Result Code (URC). The URC handlers to be implemented are the ones not marked with an "o" in [this table](https://www.freertos.org/Documentation/api-ref/cellular/cellular_common__u_r_c_handlers.html). - -The [Cellular common APIs document](https://www.freertos.org/Documentation/api-ref/cellular/cellular_porting_module_guide.html) provides detail information required in each steps. -It is recommended that you start by cloning the implementation of one of the existing modems, then make modifications where your modem's vendor-specific (non-3GPP) AT commands are different. - - Current Example Implementations: - -* [Quectel BG96](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface-Reference-Quectel-BG96) -* [Sierra Wireless HL7802](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface-Reference-Sierra-Wireless-HL7802) -* [U-Blox Sara-R4](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface-Reference-ublox-SARA-R4) - -## Integrate FreeRTOS Cellular Interface with application - -Once comm interface and cellular module implementation are ready, we can start to integrate -FreeRTOS Cellular Interface. The following diagram depicts the relationship of these software components:
Follow these steps to integrate FreeRTOS Cellular Interface into your project:
+
1. Clone this repository into your project.
-2. Clone one of the refenerce cellular module implementations ( BG96 / HL7802 / SARA-R4 )
-or create your own cellular module implementaion in your project.
+2. Clone one of the reference cellular module implementations ( BG96 / HL7802 /
+ SARA-R4 ) or create your own cellular module implementation in your project.
3. Implement comm interface.
4. Build these software components with your application and execute.
-We also provide [Demos for FreeRTOS-Cellular-Interface on Windows simulator](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Cellular_Interface_Windows_Simulator)
+We also provide
+[Demos for FreeRTOS-Cellular-Interface on Windows Simulator](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Cellular_Interface_Windows_Simulator)
as references for these three cellular modems example implementations.
## Building Unit Tests
### Checkout CMock Submodule
-By default, the submodules in this repository are configured with `update=none` in [.gitmodules](.gitmodules) to avoid increasing clone time and disk space usage of other repositories (like [amazon-freertos](https://github.com/aws/amazon-freertos) that submodules this repository).
+By default, the submodules in this repository are configured with `update=none`
+in [.gitmodules](.gitmodules) to avoid increasing clone time and disk space
+usage of other repositories (like
+[FreeRTOS](https://github.com/FreeRTOS/FreeRTOS) that submodules this
+repository).
+
+To build unit tests, the submodule dependency of CMock is required. Use the
+following command to clone the submodule:
-To build unit tests, the submodule dependency of CMock is required. Use the following command to clone the submodule:
```
git submodule update --checkout --init --recursive test/unit-test/CMock
```
@@ -110,14 +165,17 @@ git submodule update --checkout --init --recursive test/unit-test/CMock
### Platform Prerequisites
- For building the unit tests, **CMake 3.13.0** or later and a **C90 compiler**.
-- For running unit tests, **Ruby 2.0.0** or later is additionally required for the CMock test framework (that we use).
-- For running the coverage target, **gcov** and **lcov** are additionally required.
+- For running unit tests, **Ruby 2.0.0** or later is additionally required for
+ the CMock test framework (that we use).
+- For running the coverage target, **gcov** and **lcov** are additionally
+ required.
### Steps to build unit tests
-1. Go to the root directory of this repository. (Make sure that the **CMock** submodule is cloned as described [above](#checkout-cmock-submodule).)
+1. Go to the root directory of this repository. (Make sure that the **CMock**
+ submodule is cloned as described [above](#checkout-cmock-submodule).)
-1. Run the *cmake* command: `cmake -S test -B build`
+1. Run the _cmake_ command: `cmake -S test -B build`
1. Run this command to build the library and unit tests: `make -C build all`
@@ -127,20 +185,27 @@ git submodule update --checkout --init --recursive test/unit-test/CMock
## CBMC
-To learn more about CBMC and proofs specifically, review the training material [here](https://model-checking.github.io/cbmc-training).
+To learn more about CBMC and proofs specifically, review the training material
+[here](https://model-checking.github.io/cbmc-training).
The `test/cbmc/proofs` directory contains CBMC proofs.
-In order to run these proofs you will need to install CBMC and other tools by following the instructions [here](https://model-checking.github.io/cbmc-training/installation.html).
+In order to run these proofs you will need to install CBMC and other tools by
+following the instructions
+[here](https://model-checking.github.io/cbmc-training/installation.html).
## Reference examples
-Please refer to the demos of the Cellular Interface library [here](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Cellular_Interface_Windows_Simulator) using FreeRTOS on the Windows simulator platform. These can be used as reference examples for the library API.
+Please refer to the demos of the Cellular Interface library
+[here](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Cellular_Interface_Windows_Simulator)
+using FreeRTOS on the Windows simulator platform. These can be used as reference
+examples for the library API.
## Generating documentation
The Doxygen references were created using Doxygen version 1.9.2. To generate the
-Doxygen pages, please run the following command from the root of this repository:
+Doxygen pages, please run the following command from the root of this
+repository:
```shell
doxygen docs/doxygen/config.doxyfile
@@ -148,4 +213,5 @@ doxygen docs/doxygen/config.doxyfile
## Contributing
-See [CONTRIBUTING.md](./.github/CONTRIBUTING.md) for information on contributing.
+See [CONTRIBUTING.md](./.github/CONTRIBUTING.md) for information on
+contributing.
diff --git a/cspell.config.yaml b/cspell.config.yaml
new file mode 100644
index 00000000..911ce1d8
--- /dev/null
+++ b/cspell.config.yaml
@@ -0,0 +1,31 @@
+---
+$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
+version: '0.2'
+# Allows things like stringLength
+allowCompoundWords: true
+
+# Read files not to spell check from the git ignore
+useGitignore: true
+
+# Language settings for C
+languageSettings:
+ - caseSensitive: false
+ enabled: true
+ languageId: c
+ locale: "*"
+
+# Add a dictionary, and the path to the word list
+dictionaryDefinitions:
+ - name: freertos-words
+ path: '.github/.cSpellWords.txt'
+ addWords: true
+
+dictionaries:
+ - freertos-words
+
+# Paths and files to ignore
+ignorePaths:
+ - 'dependency'
+ - 'docs'
+ - 'ThirdParty'
+ - 'History.txt'
diff --git a/docs/plantuml/images/cellular_components.svg b/docs/plantuml/images/cellular_components.svg
index 42f77152..9763c9ef 100644
--- a/docs/plantuml/images/cellular_components.svg
+++ b/docs/plantuml/images/cellular_components.svg
@@ -1,4 +1,4 @@
-
+