Chapter 2 Introduction
INGCHIPS software development kit has following major components (see Figure 2.1):
Core Tools
Provide project wizard, flash loader and other functionalities. These tools make BLE development easy and seamless.
Language & IDE Integration
Support
Keil μVision
1,IAR Embedded Workbench
2,Rowley Crossworks for ARM
3, andSEGGER Embedded Studio for ARM
4. All IDE/Toolchain settings are configured by core tools properly and automatically.GNU Arm Embedded Toolchain
5 is also supported.Nim
6 is also supported as an alternative ofC
.Optionally, new projects can be configured properly to use
Visual Studio Code
7 as code editor. ForNim
andGNU Arm Embedded Toolchain
, building and downloading tasks are created and can be invoked inVisual Studio Code
.Platform Bundles
Provide different bundles for different application scenarios (such as
typical
, andextension
). Each bundle contains full stack & (optional)FreeRTOS
binary, andC
header files. Source codes for accessing peripherals are also provided.Examples
Provide a rich set of BLE device examples and corresponding Android and iOS referencing applications.
Documentation
User guide (this document), API reference, and application notes are also provided.
2.2 Architecture
There are two variants of bundles, one with built-in FreeRTOS (RTOS Bundles), and one without built-in RTOS (“NoOS” Bundles).
2.2.1 RTOS Bundles
ING918xx/ING9186xx software architecture is shown in Figure 2.2. Bootloader is stored in ROM and can’t be modified, while platform and app executable are stored in flash. Platform executable is provided for each bundle. BLE stack, FreeRTOS and some SoC functionality are compiled into this single platform executable. When system starts up, platform executable initializes, then loads the primary app executable.
A secondary app can only be asked to execute programmaticly. It is possible to download several secondary apps, and to switch between them programmaticly. After reset, platform will load the primary app executable as usual. Entry address of the primary app is managed by SDK tools, while entry addresses of secondary apps can be configured manually.
2.2.1.1 Apps built with C
App executable’s main function is named app_main
, where app gets initialized:
int app_main(void)
{
...
return 0;
}
app_main
should always return 0
.
Platform, BLE stack and FreeRTOS APIs are all declared in corresponding C
header files.
To use these APIs, just include the necessary header files.
2.2.1.2 Apps built with Nim
App executable’s main function is named appMain
, where app gets initialized:
proc appMain*(): int {.exportc noconv.} =
...
return 0;
appMain
should always return 0
.
Thanks to the separation of platform and app, size of the app executable is significantly reduced. There are several benefits of this, not limited to:
Smaller & cleaner app code base
Faster downloading & FOTA
Focus on function development
Flash tools are available for all supported IDEs and installed when installing SDK. App debugging is also quite easy: download platform binary with flash downloader (Section 4.2), then download & debug apps in IDE as usual.
2.2.2 “NoOS” Bundles
When developers want to use other RTOS, or use features that are missing in those RTOS bundles, developers can choose the “NoOS” bundles.
A generic RTOS interface is defined, and developers should provide an implementation of this
interface to platform binaries through the returning value of app_main
:
uintptr_t app_main(void)
{
...
return (uintptr_t)os_impl_get_driver();
}
2.3 Abbreviations & Terminology
Abbreviation | Notes |
---|---|
ATT | Attribute Protocol |
BLE | Bluetooth Low Energy |
FOTA | Firmware Over-The-Air |
IRQ | Interrupt Request |
GAP | Generic Access Profile |
GATT | Generic Attribute Profile |
RAM | Random Access Memory |
ROM | Read Only Memory |
SDK | Software Development Kit |
Terminology | Notes |
---|---|
Flash Memory | An electronic non-volatile computer storage medium |
FreeRTOS | A real-time operating system kernel |