
Catalog excerpts

GR551x FreeRTOS Example Application Version: 2.0 Release Date: 2022-02-20 Shenzhen Goodix Technology Co., Ltd.
Open the catalog to page 1
Copyright © 2022 Shenzhen Goodix Technology Co., Ltd. All rights reserved. Any excerption, backup, modification, translation, transmission or commercial use of this document or any portion of this document, in any form or by any means, without the prior written consent of Shenzhen Goodix Technology Co., Ltd. is prohibited. Trademarks and Permissions and other Goodix trademarks are trademarks of Shenzhen Goodix Technology Co., Ltd. All other trademarks and trade names mentioned in this document are the property of their respective holders. Disclaimer Information contained in this document is...
Open the catalog to page 2
GODDiX Preface This document introduces how to use and modify a FreeRTOS example in the GR551x Software Development Kit (SDK), to help users quickly get started with secondary development. This document is intended for: • Hobbyist developer • Technical writer This document is the eighth release of GR551x FreeRTOS Example Application, corresponding to GR551x System-on-Chip (SoC) series. Revision History Copyright © 2022 Shenzhen Goodix Technology Co., Ltd. I
Open the catalog to page 3
GODDiX Contents Copyright © 2022 Shenzhen Goodix Technology Co., Ltd. II
Open the catalog to page 4
GODDiX Introduction FreeRTOS is an excellent embedded real-time operating system for microcontrollers. Being light-weighted, distributed freely under MIT open-source License, and built with an emphasis on portability, tailorability, and flexible scheduling policy, it requires low RAM/ROM consumption and supports management of task, time, semaphore, message queue, and memory. This document introduces the FreeRTOS porting example in the GR551x Software Development Kit (SDK), including usage of the example and descriptions of major source code. Before getting started, you can refer to the...
Open the catalog to page 5
Introduction to FreeRTOS Source Directory 2 Introduction to FreeRTOS Source Directory FreeRTOS source code is in SDK_Folder\external\freertos, which contains the include folder, the portable folder, and the .c source files. Note: SDK_Folder is the root directory of GR551x SDK. Figure 2-1 The freertos folder in GR551x SDK The include folder: It contains all FreeRTOS APIs, related structures, and macro definitions. The portable folder: It contains FreeRTOS code to be ported to GR551x System-on-Chips (SoCs) with modifications. The .c source files: Implement core service code of FreeRTOS. For...
Open the catalog to page 6
GODDiX Initial Operation This chapter introduces how to rapidly verify the FreeRTOS example in the GR551x SDK. SDK_Folder is the root directory of GR551x SDK. Perform the following tasks before verifying a FreeRTOS example. • Hardware preparation Table 3-1 Hardware preparation You can download ble_app_template_freertos.bin to the SK Board through GProgrammer. For details, see GProgrammer User Manual. • The ble_app_template_freertos.bin is in SDK_Folder\projects\ble\ble_peripheral\ble_app_te mplate_freertos\build\. Copyright © 2022 Shenzhen Goodix Technology Co., Ltd. 3
Open the catalog to page 7
Initial Operation 3.3 Test and Verification After the SK Board and the required software get ready, start the test and verification of the FreeRTOS example. The test includes the following two aspects: • FreeRTOS features Bluetooth function Verify FreeRTOS features. Start GRUart; open the configured serial port, and check the trace results. If GRUart prints log information like goodix print test task = ${N} every other second in the Receive Data pane, the FreeRTOS system runs successfully. Figure 3-1 Operating results Verify the Bluetooth function. Run GRToolbox and scan Bluetooth devices...
Open the catalog to page 8
Initial Operation Figure 3-2 Discovering Goodix_Tem_OS Note: Screenshots of GRToolbox in this document are for reference only, to help users better understand the software operation. In the case of interface differences due to version changes, the interface of GRToolbox in practice shall prevail. Copyright © 2022 Shenzhen Goodix Technology Co., Ltd.
Open the catalog to page 9
GODDiX Application Details Users can customize the FreeRTOS application by modifying configurations of the ble_app_template_freertos example. For example: • Modify the FreeRTOS configurations. • Modify the example program configurations. This chapter introduces configurations and major code of the ble_app_template_freertos example. Users can customize the FreeRTOS memory management policy and the FreeRTOS kernel based on product requirements. 4.1.1 Memory Management Policy Configuration The project adopts heap_4.c as the memory management policy. Users can replace the heap_4.c with other...
Open the catalog to page 10
GODDiX Application Details Copyright © 2022 Shenzhen Goodix Technology Co., Ltd. 7
Open the catalog to page 11
GODDiX Application Details • FreeRTOSConfig.h is in SDK_Folder\app\projects\ble\ble_peripheral\ble_app_template freertos\Src\user. • For more information about macro configurations, visit https://www.freertos.org/a00110.html. This section describes how to use code to create tasks and to implement Bluetooth LE scheduling. In this example project, print_test_task is created. This task is responsible for printing information. Path: ble_app_template_freertos\Src\user\main.c Function: vStartTasksQ; static void vStartTasks(void *arg) xTaskCreate(print_test_task, "print_task", APP_TASK_STACK_SIZE,...
Open the catalog to page 12
Application Details 4.2.2 Bluetooth LE Scheduling This section introduces how BLE Protocol Stack and Bluetooth LE applications schedule tasks in FreeRTOS. After entering the main() function, complete the following steps before performing FreeRTOS task scheduling: 1. Initialize hardware peripherals. Implement required BLE_SDK_Callback interfaces for Bluetooth LE applications, and use these interfaces to initialize corresponding member variables in app_callback_t. Apply for the memory block (heaps_table) required to run the BLE Protocol Stack. Initialize BLE Protocol Stack. After...
Open the catalog to page 13
Application Details Recommendations for implementing BLE_SDK_Callback function: 1. The BLE_SDK_Callback function is called in the interrupt handling function (BLE_SDK_IRQ_Handler). Thus it is recommended not to perform long-running operation in the callback function; otherwise, implementation of user tasks may be delayed. If any data or state information in the callback function requires timely processing by Bluetooth LE applications, it is recommended to use the semaphore mechanism to complete service logic processing in user tasks. This means you should wait for the semaphore (Pend) in...
Open the catalog to page 14All Shenzhen Goodix Technology Co. Ltd catalogs and technical brochures
-
GR533x Developer Guide
52 Pages
-
GR5526 Datasheet
708 Pages
-
GR551x IAR User Manual
12 Pages
-
GR551x Datasheet
409 Pages