English
Language : 

AN664 Datasheet, PDF (14/18 Pages) Silicon Laboratories – PRECISION32™ CMSIS AND HAL USER’S GUIDE
AN664
2.4. HAL Startup Code
The si32Hal startup implementation differs from the CMSIS recommendation in order to support multiple tool
chains. Each individual application has explicit control over all of its memory model, including the stack, heap,
RAM, retention RAM, and EMIF. The symbols used to define the base and size of these memory areas is available
for use by the application without duplication.
The HAL uses tool chain-specific linker control files in the si32-x.y\si32Hal\device directory to specify these
ranges. These files are:
GCC/Precision32: linker_DeviceFamily_p32.ld
ARM: linker_DeviceFamily_arm.sct
IAR: linker_DeviceFamily_iar.icf
The code examples also provide basic linker control files that are sufficient for many applications. For cases where
these linker files are not sufficient, the application developer should use application-specific linker files.
3. Performance
The HAL implements both macros and functions for most routines. This allows firmware layers that call the HAL to
choose between the faster performance of macros or the smaller footprint of functions. For the routines that do not
have an implemented macro, a macro still exists, but it just calls the function.
The functions and macros have the same parameters and names, but functions have an underscore prefix. For
example, the function for setting the USART transmit parity is:
_SI32_USART_A_select_tx_parity(SI32_USART_0, parity);
The macro for the same routine is:
SI32_USART_A_select_tx_parity(SI32_USART_0, parity);
4. Revisions
Each version of the HAL sits in a separate folder. The path of these is C:\SiLabs\32bit\si32\si32-x.y, where x is
the primary HAL version and y is the secondary HAL version. Each time a new version of the HAL is installed, it will
leave all previous versions to eliminate the chance of a new install breaking a working firmware project.
In addition, any deprecated functions will remain a part of the HAL. These functions will either remain unchanged
or call the new version to prevent the need to modify firmware when migrating to a newer version of the HAL.
5. Code Examples
Each version of the HAL includes stand-alone code examples for the device modules that use the macro routines
by default. These examples can be found in C:\SiLabs\32bit\si32-x.y\Examples after installing the Precision32
IDE.
6. The HAL and AppBuilder
The Silicon Labs AppBuilder program uses HAL macros when configuring peripherals. The AppBuilder project
options can select between different versions of the HAL.
14
Rev. 0.2