STM32WBA BLE Libraries: Select a Compatible Feature Pair and Budget Application-Owned RAM

Selecting a smaller STM32WBA BLE library is a feature decision before it is a memory optimization. The host/controller configuration, application compilation options and link-layer variant must agree. The memory budget must then include buffers allocated by the application, not only the libraries' reported static footprint.

The concrete table used here is ST's BLE Stack Integration guide snapshot with STM32CubeWBA 1.10.0 footprint measurements under Keil. It covers multiple WBA variants; this discussion targets WBA55. No binary was built, linked or measured here.

Choose a supported feature column

The integration guide lists Full, Basic Plus, Basic Features, Peripheral Only and Link Layer Only configurations. Their capabilities differ. For example, the Peripheral Only column does not support scanning or the central connection role.

A product that advertises today but must scan for accessories during servicing therefore needs more than its normal advertising requirement in the selection record. If scanning is a required shipped behavior, a smaller Peripheral Only configuration is not an equivalent replacement merely because the normal demonstration still advertises.

Write down the required roles and features before comparing footprint values. Include commissioning, diagnostics and recovery behaviors that are actually part of the product. Do not reserve every imaginable feature, but do not hide a required role outside the main application's memory estimate.

Treat the three build choices as one configuration

In the 1.10.0 integration table, several reduced host configurations use the full host-stack library with a corresponding application compilation option. Examples include BLE_STACK_BASIC_PLUS, BLE_STACK_BASIC_FEATURES and BLE_STACK_PERIPHERAL_ONLY, paired with their listed link-layer variants. Link Layer Only uses its own host/controller-side selection and option.

The general WBA build guide explains the required library association, but illustrates names including a separate basic-stack archive. Do not combine that naming example with a different package's compile-option table and assume the hybrid is a supported configuration.

Use the selected package's actual archives, headers, project settings and associated manual as a coherent set. The application macro is not an independent switch that makes an arbitrary link-layer archive gain the omitted capability.

The integration guide also distinguishes device-series-specific link-layer libraries. A WBA25 library choice should not be substituted into a WBA55 build solely because both have a similarly named BLE feature set.

Required roles determine a coherent library and compile-option set; application-owned host and GATT regions add memory beyond static library footprints.
Original selection and memory map. The numeric example is taken from the cited guide configuration and is not the total RAM of an arbitrary WBA55 product.

Read the footprint table's conditions

The published flash and RAM figures were computed with CubeWBA 1.10.0 in the Keil environment. They are useful comparative evidence under those conditions, not a guarantee that every compiler and final application produces the same result.

The table explicitly adds dynamic RAM to the host library's static RAM footprint. Its footnote says the application must provide additional BLE stack memory. Omitting that allocation can make an apparently comfortable fit fail when the actual initialization parameters are applied.

For the shipping build, obtain the linker map and identify all included library sections, application stacks, heaps, DMA buffers and retained allocations. The guide's numbers should inform the initial choice; the final linked image establishes the actual placement for that build.

Budget the two application-owned host regions

The guide separates host-stack/ACL-buffer RAM from GATT-database RAM. The application supplies their start addresses and sizes through the initialization structure. The documented start-address requirements include 32-bit alignment.

BLE_TOTAL_BUFFER_SIZE depends on the configured links, memory blocks and additional bearers. BLE_TOTAL_BUFFER_SIZE_GATT uses attribute records, services and attribute-value storage. The guide further explains that the memory requirement is influenced by settings including ATT MTU. Keep the macro inputs consistent with the parameters passed to initialization.

ST gives a concrete example: its stated eight-connection host/ACL configuration with ATT MTU 300 and prepare-write list size 30 uses 9,784 bytes, while its example database of eight services, 68 attributes and 1,344 bytes of attribute values uses 4,448 bytes. Together those example regions total 14,232 bytes. These are documented example allocations, not a universal eight-connection cost or the entire product's RAM use.

Changing MTU or the database can therefore invalidate an old allocation even if the selected archive names stay unchanged. Recompute through the package's macros rather than extrapolating every configuration from one per-connection figure.

Make the fit decision reproducible

The useful configuration record identifies the required feature column, exact library pair, compile options, buffer-macro inputs, initialization parameters and final map. A reviewer should be able to trace a required behavior to a supported feature and its memory cost.

If the result does not fit, reduce a real requirement or choose a different supported configuration. Removing a buffer allowance from the spreadsheet does not reduce the stack's runtime need. This is why library selection and application-owned RAM belong in one engineering decision: either can independently disqualify the proposed product configuration.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *