-
Notifications
You must be signed in to change notification settings - Fork 24
Add support for FreeRTOS TCP/IP stack #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9071e8e
f62ffe5
3c4a180
08004e0
55bd162
fa78eaf
686027c
8dffe6b
7c9c2c2
893be54
d62e8ca
f81d8ed
6463898
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |
| */ | ||
|
|
||
| __STACK_SIZE = 0x00002800; | ||
| __HEAP_SIZE = 0x000b0000; | ||
| __HEAP_SIZE = 0x00000400; | ||
|
|
||
| MEMORY | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,21 +48,37 @@ extern uint32_t SystemCoreClock; | |
| /* Memory allocation related definitions. */ | ||
| #define configSUPPORT_STATIC_ALLOCATION 1 | ||
| #define configSUPPORT_DYNAMIC_ALLOCATION 1 | ||
| #define configTOTAL_HEAP_SIZE 512000 /* should be enough */ | ||
| #define configAPPLICATION_ALLOCATED_HEAP 1 | ||
| #define configTOTAL_HEAP_SIZE 720896 | ||
| #define configAPPLICATION_ALLOCATED_HEAP 0 | ||
|
|
||
| #define configENABLE_MVE 0 | ||
| #define configENABLE_FPU 1 | ||
| #define configENABLE_MPU 0 | ||
| #define configENABLE_TRUSTZONE 0 | ||
| #define configRUN_FREERTOS_SECURE_ONLY 0 | ||
|
|
||
| /* somehow 100 tick per second gives similar timing (~85%) as 1000 did on the FPGA, so with this 1 ms to 1 tick can be */ | ||
| /* kept... */ | ||
| #define configTICK_RATE_HZ ( ( uint32_t ) 100 ) /* Scheduler polling rate of 1000 Hz */ | ||
|
|
||
| /* From the "Fast Models Reference Guide" (https://developer.arm.com/documentation/100964/1123/About-the-models), | ||
| * "Programmer's View (PV) models of processors and devices work at a level | ||
| * where functional behavior is equivalent to what a programmer would see using | ||
| * the hardware. | ||
| * | ||
| * They sacrifice timing accuracy to achieve fast simulation execution speeds: | ||
| * you can use the PV models for confirming software functionality, but you | ||
| * must not rely on the accuracy of cycle counts, low-level component | ||
| * interactions, or other hardware-specific behavior." | ||
| * | ||
| * As described above, FVPs sacrifice timing accuracy to achieve fast | ||
| * simulation execution speeds. Therefore, we need this work around of setting | ||
| * `configTICK_RATE_HZ` to `100` to simulate scheduler polling rate of | ||
| * `1000 Hz` or 1 tick per second. | ||
| * | ||
| * In addition, the macro `pdMS_TO_TICKS` is defined here to match the 1 tick | ||
| * per second instead of using the macro defined in | ||
| * `FreeRTOS-kernel/include/projdefs.h` | ||
| */ | ||
| #define configTICK_RATE_HZ ( ( uint32_t ) 100 ) | ||
| #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) xTimeInMs ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you defining these? These are already defined in projdefs.h.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added description about FVP behaviour and the justification for setting |
||
| #define TICKS_TO_pdMS( xTics ) ( ( uint32_t ) xTics ) | ||
| #define TICKS_TO_pdMS( xTicks ) ( ( uint32_t ) xTicks ) | ||
|
|
||
| #define configMINIMAL_STACK_SIZE 4096 | ||
| #define configUSE_16_BIT_TICKS 0 | ||
|
|
@@ -72,7 +88,6 @@ extern uint32_t SystemCoreClock; | |
| #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 | ||
| #define configUSE_TICKLESS_IDLE 0 | ||
| #define configCPU_CLOCK_HZ ( ( unsigned long ) SystemCoreClock ) | ||
| #define configMS_TO_RTOS_TICK( ms ) ( ms ) /* Tick rate is 1000 Hz, so 1 tick is 1 ms */ | ||
| #define configMAX_PRIORITIES 56 | ||
| #define configMAX_TASK_NAME_LEN 16 | ||
| #define configIDLE_SHOULD_YIELD 1 | ||
|
|
||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Prerequisites | ||
|
|
||
| ## Setting up the platforms | ||
|
|
||
| This reference integration supports both [Arm ecosystem FVPs](https://developer.arm.com/downloads/-/arm-ecosystem-fvps) | ||
| and Arm Virtual Hardware using [Amazon Machine Images](#setting-up-arm-virtual-hardware-using-amazon-machine-images). | ||
|
|
||
| The Corstone-300 ecosystem FVP is aligned with the Arm MPS3 development | ||
| platform. It is based on the Cortex-M55 processor and offers a choice of the | ||
| Ethos-U55 and Ethos-U65 processors. This FVP is provided free of charge for the | ||
| limited development and validation of open-source software on the Corstone-300 | ||
| platform while Arm Virtual Hardware is recommended for commercial software. | ||
| Follow the [link](https://developer.arm.com/downloads/-/arm-ecosystem-fvps) for | ||
| more information. | ||
|
|
||
| ### Setting up Arm ecosystem FVPs | ||
|
|
||
| * Download the Corstone-300 FVP from [here](https://developer.arm.com/downloads/-/arm-ecosystem-fvps) | ||
| * Run the following commands to install the Corstone-300 FVP and add FVP path | ||
| to `PATH` variable. | ||
| ```bash | ||
| mkdir FVP_Corstone_SSE-300_11.22_20 | ||
| tar -xzf <download location>/FVP_Corstone_SSE-300_11.22_20_Linux64.tgz -C FVP_Corstone_SSE-300_11.22_20 | ||
| cd FVP_Corstone_SSE-300_11.22_20 | ||
| ./FVP_Corstone_SSE-300.sh | ||
| echo PATH=\"<FVP installation path>/FVP_Corstone_SSE-300/models/Linux64_GCC-9.3:\$PATH\" >> ~/.bashrc | ||
| source ~/.bashrc | ||
| ``` | ||
|
|
||
| ### Setting up Arm Virtual Hardware using Amazon Machine Images | ||
|
|
||
| Follow the instructions described in [Launch Arm Virtual Hardware Instance](setting-up-arm-virtual-hardware.md) | ||
| to setup your development environment. | ||
|
|
||
| If you have successfully followed the instructions, then you should have a | ||
| console (either AWS-Web-Console or Local-Console) to an Arm Virtual Hardware | ||
| Instance. From now on, any command-line commands described in this document | ||
| must be run on the console connected to the Arm Virtual Hardware Instance. | ||
|
|
||
| **Note** | ||
| The run example script `Tools/scripts/run.sh` assumes ecosystem FVP by default. | ||
| If you are using Arm virtual hardware using Amazon machine images then an | ||
| additional argument `--fvp_type vht` must be passed to the run example script. | ||
|
|
||
| ## Setting up development environment | ||
|
|
||
| Follow the instructions described in [Setting Up your Development Environment](development-environment.md) | ||
| to setup your development environment. |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Copyright 2023 Arm Limited and/or its affiliates | ||
| # <[email protected]> | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| set(FREERTOS_PLUS_TCP_NETWORK_IF "MPS3_AN552" CACHE STRING "FreeRTOS Plus TCP Network Interface selection") | ||
|
|
||
| set(FREERTOS_PLUS_TCP_BUFFER_ALLOCATION "2" CACHE STRING "FreeRTOS buffer allocation model number. 1 .. 2.") | ||
|
|
||
| add_subdirectory(FreeRTOS-Plus-TCP/source) | ||
| add_subdirectory(FreeRTOS-Plus-TCP/tools) | ||
|
|
||
| add_library(connectivity-stack ALIAS freertos_plus_tcp) | ||
|
|
||
| target_sources( freertos_plus_tcp | ||
| PRIVATE | ||
| src/network_startup.c | ||
| src/transport_mbedtls.c | ||
| ) | ||
|
|
||
| target_include_directories( freertos_plus_tcp SYSTEM | ||
| PUBLIC | ||
| src | ||
| ) | ||
|
|
||
| target_link_libraries(freertos_plus_tcp | ||
| PRIVATE | ||
| app-logging | ||
| freertos_kernel | ||
| fri-bsp | ||
| awsIoT | ||
| mbedtls-helpers | ||
| event-helper | ||
| ) |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the linker scripts and
FreeRTOSConfig.hare used by the two applications, is it also necessary to modify Blinky to use Heap 4 instead of Heap 3?Can we move the heap selection to
https://github.com/FreeRTOS/iot-reference-arm-corstone3xx/blob/main/Middleware/FreeRTOS/CMakeLists.txtso it applies to all applications using the FRI?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. Let's handle that as part of another PR to improve blinky example.