AN4141 STMICROELECTRONICS | Alldatasheet

Document overview

  • Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
  • PDF pages: 42

Technical content

Datasheet sections

  • 1.1 ARM® Cortex-M3™ microcontroller software interface
  • 1.1.1 CMSIS description
  • 1.1.2 CMSIS structure
  • 1.1.3 HAL versus CMSIS
  • 1.2 STM32W108xx standard peripheral library with Doxygen format
  • 1.3 STM32W108xx standard peripheral library architecture
  • 1.4 STM32W108xx standard peripheral library architecture file inclusion
  • 2 STM32W108xx packages
  • 2.1 SimpleMAC package
  • 2.2 ZigBee RF4CE package
  • 3 HAL to StdPeriph_Lib list of changes
  • 3.1 STM32W108xx standard peripheral library files
  • 3.1.1 Library core files
  • 3.1.2 Library drivers
  • 3.1.3 Library user and toolchain specific files
  • 3.2 Coding rules and conventions
  • 3.2.1 Data types and IO type qualifiers
  • 3.2.2 Exception naming
  • 3.3 HAL peripheral driver update
  • 3.3.1 ADC
  • 3.3.2 NVIC
  • 3.3.3 CLK
  • 3.3.4 RST
  • 3.3.5 PWR
  • 3.3.6 WDG
  • 3.3.7 Serial controller
  • 3.3.8 GPIO
  • 3.3.9 GPTimer
  • 3.3.10 SLPTimer
  • 3.3.11 FLASH

highlights the differences between them. AN4142: STM32W108xx datasheet bit and register naming migration. This application note applies to the products listed in Table 1. Table 1. Applicable products

Why migrate from HAL to StdPeriph_Lib? AN4141 1 Why migrate from HAL to StdPeriph_Lib? The STM32W108xx FWLib V1.0.1 is a complete firmware package for the STM32W108xx devices and is an update of the HAL firmware. It is a collection of routines, data structures and macros that covers the features of all peripherals. It includes:

  • Drivers and a set of examples for all the standard device peripherals
  • Drivers and a set of examples for all the components available on the RF boards (MB851, MB950, MB951 and MB954) Features of the new package include:
  • The package makes the library compliant with the Cortex™ microcontroller software interface standard (CMSIS).
  • The package architecture and the library files organization has been enhanced.
  • The source files are provided in the Doxygen format.
  • The code format for the applications has been enhanced. To migrate to the STM32W108xx standard peripheral library V 1.0.1, you have to update the:
  • Files relative to your toolchain
  • Project settings
  • Library file organization
  • Bit and register naming You do not need to change or update the application code. The details of all updates made on the library (StdPeriph_Lib) are described below.

1.1 ARM® Cortex-M3™ microcon troller software interface

standard (CMSIS) compliance The CMSIS answers the challenges faced when software components are deployed to physical microcontroller devices based on Cortex-M0 / Cortex-M1 or Cortex-M3 processors. The CMSIS will also be expanded to future Cortex-M processor cores (the standard refers to Cortex-Mx). The CMSIS is defined in close cooperation with various silicon and software vendors and provides a common approach to interface to peripherals, real-time operating systems and middleware components. For more details, please refer to www.onarm.com.

1.1.1 CMSIS description

  • Core peripheral access layer: contains name definitions, address definitions and helper functions to access core registers and peripherals. It also defines a device- independent interface for RTOS kernels that includes debug channel definitions.
  • Device peripheral access layer: provides definitions for all device peripherals. For a Cortex-Mx microcontroller system, CMSIS defines:
  • A common way of accessing peripheral registers and a common way of defining exception vectors
  • Register names of the core peripherals and names of the core exception vectors
  • A device-independent interface for RTOS kernels, including a debug channel
  • Interfaces for middleware components (TCP/IP stack, flash file system)

1.1.2 CMSIS structure

Figure 1 illustrates different layers for a CMSIS-based application. Figure 1. CMSIS layer structure

Why migrate from HAL to StdPeriph_Lib? AN4141 CMSIS - Files for the peripheral access layer Compiler vendor-independent files:

  • Cortex-M3 core and peripheral file (core_cm3.h + core_cm3.c) – Access to Cortex-M3 core and peripherals: NVIC, SysTick, etc. – Functions to access Cortex-M3 CPU registers and core peripherals
  • Device-specific header file (stm32w108xx.h) – Interrupt number assignment (consistent with startup file) – Peripheral register definitions (layout and base addresses) – Functions that control other ch ip-specific functions (optional)
  • Device-specific system file (system_stm32w108xx.c) – SystemInit function that initializes the physical microcontroller device – System Frequency value for system-wide timing – Other device-related features (optional) Compiler-vendor + device-specific startup file:
  • Compiler startup code (assembly or C) (startup_device.s) – Interrupt handler table with device-specific names (consistent with header) – Weak interrupt handler default functi ons (can be overwritten by user code) Note: The Weak keyword instructs the compiler to export symbols weakly. This keyword can be applied to function and variable declarations, and to function definitions. Functions defined with Weak export their symbols weakly. A weakly defined function behaves like a normally defined function unless a non-weakly defined function of the same name is linked to the same image. If both a non-weakly defined function and a weakly defined function exist in the same image, then all calls to the function resolve to call the non- weak function. If multiple weak definitions are available, the linker chooses one for use by all calls.

1.1.3 HAL versus CMSIS

CMSIS provides a different implementation of some STM32W108xx FWLib components. Here are the main differences:

  • Use of standard C types, <stdint.h> file
  • For each Cortex-M3 exception and STM32 IRQ, there is: – an exception/interrupt handler with the _H andler postfix (for exceptions) or the _IRQHandler postfix (for interrupts) – a default exception/interrupt handler (w eak definition) that contains an endless loop – a #define of the interrupt number with the _IRQn postfix
  • Startup file renamed to startup_stm32w108xx.s/.c
  • Only reduced NVIC and SysTick functions are available, some useful functions will be added in a new driver in the STM32W108xx standard peripheral library, named misc.h/.c
  • Some macro names are different from those used in the HAL firmware (Table 2).

Table 2. HAL macros vs. CMSIS macros

Why migrate from HAL to StdPeriph_Lib? AN4141

1.2 STM32W108xx standard peri pheral library with Doxygen

The STM32W108xx standard peripheral library comes in a new source file format. Now, all StdPeriph_Lib files use the Doxygen format to facilitate documentation generation and for a more interactive and effective documentation usage. The STM32W108xx firmware library user manual is now presented in two formats: a CHM file and a PDF file presenting all STM32W108xx standard peripheral library components. Doxygen example /** * @brief Reads the specified input port pin. * @param GPIOx: where x can be (A, B or C) to select the GPIO peripheral. * @param GPIO_Pin: specifies the port bit to read. * This parameter can be GPIO_Pin_x where x can be (0..7). * @retval The input port pin value. Where:

  • @brief: one-line brief function overview
  • @param: detailed parameter explanation
  • @retval: detailed information about return values For more details, refer to file stm32w108xx_stdperiph_lib_um.chm.

1.3 STM32W108xx standard peri pheral library architecture

The STM32W108xx standard peripheral library architecture is enhanced with CMSIS layer support. The StdPeriph_Lib usage is now based on two approaches that take into account the application needs:

  • When the application uses the peripheral drivers: in this case, product programming is based on the drivers' API (application programming interface). You only have to configure the stm32w108xx_conf.h file and use the corresponding stm32w108xx_ppp.h/.c files.
  • When the application does not use the peripheral drivers: in this case, product programming is based on the peripheral register structure and bit definition file. The StdPeriph_Lib supports all STM32W108xx family products: STM32W108C8, STM32W108CB, STM32W108CC, STM32W108CZ and STM32W108HB devices. The StdPeriph_Lib is configurable for the whole family products through preprocessor defines, one define per product. Defines are available for the following products:
  • STM32W108C8: STM32 64K FLASH devices
  • STM32W108CB: STM32 128K FLASH devices
  • STM32W108CC: STM32 256K FLASH devices
  • STM32W108CZ: STM32 192K FLASH devices
  • STM32W108HB: STM32 128K FLASH devices
  • Interrupt IRQ channel definition inside the stm32w108xx.h file
  • Vector table, one startup file per product
  • Peripheral memory mapping and physical register address definition
  • Product configuration: external quartz (HSE) value, etc.
  • System configuration functions
  • Features with different/incompatible implementations across the family These defines do not apply to peripheral drivers. These drivers always support the features of the family superset.

1.4 STM32W108xx standard peripher al library architecture file

Figure 2 illustrates the STM32W108xx file inclusion. Figure 2. STM32W108xx standard peripheral library architecture

2 STM32W108xx packages

standard library package and the CMSIS package.

2.1 SimpleMAC package

Figure 3 illustrates the new SimpleMAC package architecture. Figure 3. SimpleMAC package structure

Table 3. STM32W108xx SimpleMAC Package V 2.0.1

Figure 4. Former vs. new STM32W108xx SimpleMAC package

2.2 ZigBee RF4CE package

Figure 5 illustrates the new ZigBee RF4CE package architecture. Figure 5. ZigBee RF4CE package structure

Table 4. STM32W108xx ZigBee RF4CE package V 2.0.1

Figure 6. Former vs. new STM32W108xx ZigBee RF4CE package

HAL to StdPeriph_Lib list of changes AN4141

3 HAL to StdPeriph_Lib list of changes

3.1 STM32W108xx standard peripheral library files

3.1.1 Library core files

File reg.h does not exist any longer; it is replaced with files stm32w108xx.h and core_cm3.h.

  • File stm32w108xx.h contains: – STM32W peripheral memory mapping and physical register address definition – Peripheral structures – STM32W interrupt IRQ list – Specific options for the Cortex-M3 core – A specific define storing the STM32W108xx standard peripheral library version: __STM32W108XX_STDPERIPH_VERSION – Configuration options: The application must select the STM32 product it is operating with (only one define per product). /** Uncomment the line below according to the target STM32 device used in your * application #if !defined (STM32W108C8) && !defined (STM32W108CB) && !defined (STM32W108CC) && !defined (STM32W108CZ) && !defined (STM32W108HB) /* #define STM32W108C8 */ /*!< STM32W108C8: 64k FLASH */ /* #define STM32W108CB */ /*!< STM32W108CB: 128k FLASH */ /* #define STM32W108CC */ /*!< STM32W108CC: 256k FLASH */ /* #define STM32W108CZ */ /*!< STM32W108CZ: 192k FLASH */ /* #define STM32W108HB */ /*!< STM32W108HB: 128k FLASH */ #endif The application must select whether the peripheral drivers are to be used or not. #if !defined (USE_STDPERIPH_DRIVER) /** * @brief Comment the line below if you will not use the peripherals drivers. * In this case, these drivers will not be included and the application code will * be based on direct access to peripherals registers

AN4141 HAL to StdPeriph_Lib list of changes /* #define USE_STDPERIPH_DRIVER */ #endif /* USE_STDPERIPH_DRIVER */

  • File core_cm3.h (CMSIS Cortex-M3 Core Peripheral Access Layer) contains: – Cortex-M3 Core memory mapping and physical register address definition – Cortex-M3 instructions – Cortex-M3 C and assembly functions that ease access to the Cortex-M3 Core File stm32w108xx_type.h is replaced with file <stdint.h>. Library-specific types have been added into file stm32w108xx.h (FlagStatus, ITStatus, FunctionalState, ErrorStatus). Old types have been removed. File spmr.s79 is replaced with file core_cmFunc.h (CMSIS Cortex-M Core Function Access). (refer to Table 2: HAL macros vs. CMSIS macros)

3.1.2 Library drivers

To migrate to the standard library, we need to decide whether the run time board configuration concept should be removed in order to reduce the code size for the user application. Such decision impacts:

  • HAL boards resources configuration files. – Files led.c/.h and button.c/.h are removed and updated by board driver files MBxxx.c/.h. Function halInitLed() is updated by STM_EVAL_LEDInit(). Function halToogleLed() is updated by STM_EVAL_LEDToggle(). Function halSetLed() is updated by STM_EVAL_LEDOn(). Function halClearLed() is updated by STM_EVAL_LEDOff(). –D r i v e r board.c/.h is updated by removing all the board resources definitions. Only these two useful APIs have been kept: halBoardPowerUp(): performs board-specific action to power up the system halBoardPowerDown(): performs board-specific action to power down the system The following two functions have been edited to use the board resource drivers provided within driver StdPeriph (MBxxx.c/.h) and in the common board drivers: Function halGetButtonStatus() is updated by STM_EVAL_PBGetState(). Function halInitButton() is updated by STM_EVAL_PBInit(). – The MEMS drivers ( mems.c/.h and mems_regs.h) are removed from the HAL and updated by the common MEMS driver (mbxxx_i2c_lis302dl.c/.h) within the StdPeriph driver. – The temperature sensor driver (temper ature_sensor.c/.h) is removed from the HAL and updated by the common temperature sensor driver (mbxxx_adc_tsensor.c/.h) within the StdPeriph driver. – A new common driver is developed to manage the basic I2C eeprom functionality (mbxxx_i2c_ee.c/.h).
  • User Application Project – The user should build a specific project by board and by product.

HAL to StdPeriph_Lib list of changes AN4141 Note: In the SimpleMAC firmware package Rev 2.0.1 and in the RF4CE firmware package Rev 2.0.1, only the last board revision with STM32W108CC product is supported by the project template and the user should customize this project according to his board. When removing file reg.h, all the hal drivers are updated to use the new resources in the resources defined in files stm32w108xx.h and core_cm3.h. For more details, refer to Section 3.3: HAL peripheral driver update.

3.1.3 Library user and toolchain specific files

The IAR starter file cstartup_M.s available in the HAL has been updated by the IAR startup template file startup_stm32w108xx.s. ST provides this file in the CMSIS library. In the IAR startup file startup_stm32w108xx.s, a new [Weak] directive defined by the CMSIS is available. The user must add manually peripheral ISR into files stm32w108xx_it.h and stm32w108xx_it.c. The IAR linker file iar-cfg.icf is to be changed/renamed “stm32w108xx_flash.icf”. This file is provided in each EWARM project folder to be customized according to the user application. Files stm32w108xx_it.c/.h define the Cortex-M3 exceptions and the STM32W IRQ handler routines. They are defined by the user application: in these files, some STM32W IRQ/Cortex-M3 exceptions defined by the Hardware Abstraction Layer (STM32W108xx_HAL_Driver) and by the SimpleMAC library should be not modified:

  • The STM32W IRQ handler routines: – MNG_IRQHandler(): hal Management ISR – SLPTIM_IRQHandler(): hal Sleep timer ISR – SC1_IRQHandler(): hal serial control 1 ISR – MAC_TIM_IRQHandler(): SimpleMAC timer ISR – MAC_TR_IRQHandler(): SimpleMAC transmitter ISR – MAC_RE_IRQHandler(): SimpleMAC receiver ISR – ADC_IRQHandler(): hal ADC ISR
  • Cortex-M3 exception: – PendSV_Handler (): hal PendSV exception – SysTick_Handler (): hal SysTick exception To use the assert param feature defined in the STM32W108xx StdPeriph drivers, the library user should:
  • Enable the assert feature by uncommenting define USE_FULL_ASSERT in file stm32w108xx_conf.h as follows: /* Uncomment the line below to expanse the "assert_param" macro in the Standard Peripheral Library drivers code */ /* #define USE_FULL_ASSERT 1 */

AN4141 HAL to StdPeriph_Lib list of changes

  • Define function assert_failed in file main.c as follows: #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None void assert_failed(uint8_t* file, uint32_t line) /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\\r\\n", file, line) */ /* Infinite loop */ while (1) #endif

3.2 Coding rules and conventions

3.2.1 Data types and IO type qualifiers

HAL types and <stdint.h> types. Table 5. CMSIS IO type qualifiers Table 6. STM32W108xx HAL vs. CMSIS types

Table 6. STM32W108xx HAL vs. CMSIS types (continued)

3.2.2 Exception naming

Table 7 shows the exception handler names which were changed to match CMSIS names. Table 7. STM32W108xx HAL exception names vs. CMSIS

3.3 HAL peripheral driver update

between the HAL and the StdPeriph_Lib.

3.3.1 ADC

Table 8. STM32W108xx ADC driver overview

3.3.2 NVIC

3.3.3 CLK

table provides an overview of the CLK changes. Table 9. STM32W108xx NVIC driver overview Table 10. STM32W108xx CLK driver overview

3.3.4 RST

this check is done by access registers.

3.3.5 PWR

some additional/basic APIs are provided by the STM32W108xx standard library drivers.

3.3.6 WDG

provide protection against software crashes and ARM® Cortex-M3 CPU lockup. ones, so the WDG API is removed from the HAL. Refer to section XXXXX. Table 11. STM32W108xx PWR driver overview

3.3.7 Serial controller

StdPeriph_driver covers all serial controller features. Table 12. STM32W108xx WDG driver overview Table 13. STM32W108xx UART driver overview

Table 14. STM32W108xx SPI driver overview Table 15. STM32W108xx I2C driver overview

3.3.8 GPIO

Input, Output, Analog or Alternate. others for external interrupts EXTI. code providing the same functionality. Table 16. STM32W108xx DMA driver overview

The STM32W108 has four externals interrupts lines: EXTIA, EXTIB, EXTIC and EXTID. Function EXTI_GetITStatus gives the status of interrupt of a specified line. and HAL are not fully compliant. Table 17. STM32W108xx GPIO driver overview Table 18. STM32W108xx EXTI driver overview

3.3.9 GPTimer

Table 19. STM32W108xx GPTimer driver overview

Table 19. STM32W108xx GPTimer driver overview (continued)

3.3.10 SLPTimer

use of the Sleep timer features. Table 20. STM32W108xx SLPTimer driver overview

3.3.11 FLASH

The STM32W108 integrates a FLASH up to 256 K. Table 21. STM32W108xx FLASH driver overview FLASH_ERROR_WRP or FLASH_COMPLETE.

How to use the STM32W108xx standard peripheral library AN4141

4 How to use the STM32W 108xx standard peripheral

This section describes the steps to be followed to use the STM32W108xx standard peripheral library.

  • Create a project and set up all your toolchain's startup files (or use the template project provided within the library)
  • Select the startup file depending on the used product, only one startup file should be selected at a time: – startup_stm32w108xx.s/.c
  • The library entry point is “stm32w108xx.h”. It should be included in the application main and configured: – Select the target product fam ily, comment/uncomment the right define: /** Uncomment the line below according to the target STM32 device used in your * application #if !defined (STM32W108C8) && !defined (STM32W108CB) && !defined (STM32W108CC) && !defined (STM32W108CZ) && !defined (STM32W108HB) /* #define STM32W108C8 */ /*!< STM32W108C8: 64k FLASH */ /* #define STM32W108CB */ /*!< STM32W108CB: 128k FLASH */ /* #define STM32W108CC */ /*!< STM32W108CC: 256k FLASH */ /* #define STM32W108CZ */ /*!< STM32W108CZ: 192k FLASH */ /* #define STM32W108HB */ /*!< STM32W108HB: 128k FLASH */ #endif /** Tip: To avoid modifying this file each time you need to switch between these * devices, you can define the device in your toolchain compiler preprocessor. #if !defined (STM32W108C8) && !defined (STM32W108CB) && !defined (STM32W108CC) && !defined (STM32W108CZ) && !defined (STM32W108HB) #error "Please select first the target STM32W108XX device used in your application (in stm32w108xx.h file)" #endif

Then the user can choose to use the peripheral drivers or not.

  • Case 1 (C1, see Figure 7): application code based on STM32W peripheral driver API – Uncomment #define USE_ST DPERIPH_DRIVER in file stm32w108xx.h. – In the file stm32w108xx_conf.h, select the peripherals to be used (for header file inclusion) – Use the peripheral driver API to build the application.
  • Case 2 (C2, see Figure 7): application code based on direct access to the STM32W peripheral registers (stm32w108xx.h) – Comment #define USE_ST DPERIPH_DRIVER in file stm32w108xx.h. – Use the peripheral register st ructure and bit definition file, stm32w108xx.h, to build the application.

Figure 7. Structure of RF Application based on STM32W library & CMSIS

  1. C1: Application code based on ST M32W peripheral driver API.
  2. C2: Application code based on direct access to STM32W peripheral registers (file stm32w108xx.h).

Migration application using the automatic script AN4141

5 Migration application using the automatic script

To save migration time, an automatic Perl script is provided with this application note that makes it easier to port an old RF application project (based on file regs.h ) to the CMSIS- based library StdPeriph_Lib V 1.0.1. This automatic script is provided inside the MigrationScript.zip file. This folder contains:

  • MigrationScript.exe: automatic script binary file
  • config.ini: migration script configuration file. It contains all needed and automatic changes that are to be applied on the code.
  • readme.txt: readme file describing how to use the automatic script

5.1 How to use the automatic script

  1. Download and Install the ActivePe rl software from this link: http://www.activestate.com/activeperl/ 2. Copy files MigrationScript.exe and config.ini into the parent directory of the files to be modified. Note: Please make sure that the tar get files are in read/write mode. 3. Launch MigrationScript.exe. 4. A backup folder is created in your work folder . It contains the old data in your directory. A trace file trace.log that summarizes all updated files is also created.

5.2 Migration steps usin g the automatic script

  1. Update the toolchain startup files:
  • Linker configuration: these files are already provided within the StdPeriph_Lib V 1.0.1 package in the following directory: STM32W108xx_StdPeriph_Lib_V1.0.1\\Projects\\STM32W108xx_StdPeriph_Templates
  • Vector table location files: these files are already provided within the StdPeriph_Lib V 1.0.1 package in the following directory: STM32W108xx_StdPeriph_Lib_V1.0.1\\Libraries\\CMSIS\\Device\\ST\\STM32W108xx\\So urce\\Templates\\ Note: Only one startup file should be selected. 2. Add the System configuration file to the project: Create a new group named CMSIS and link to this group the system configuration file available in Libraries\\CMSIS\\Device\\ST\\STM32W108xx\\Source\\Templates. Note: This file provides the required functions to initialize the system during the startup phase. 3. Replace group hal with STM32W108xx_HAL_Driver and link to this group all the *.c files available in either of the following directory:

AN4141 Migration application using the automatic script STM32W108xx_SimpleMAC_V2.0.1\\Utilities\\STM32W108xx_HAL_Driver\\micro\\cortexm3 STM32W108xx_RF4CE_V2.0.1\\Utilities\\STM32W108xx_HAL_Driver\\micro\\cortexm3 4. Create a new group named STM32W108xx_StdPeriph_Driver and link to this group all the STM32W108xx peripheral drivers available in the following directory: STM32W108xx_StdPeriph_Lib_V1.0.1\\Libraries\\STM32W108xx_StdPeriph_Driver\\src 5. Create a new group named STM32_EVAL and link to this group the user board resources drivers available in the following directory: Utilities\\STM32_EVAL Note: The common boards resources drivers are provided in this path: Utilities\\STM32_EVAL\\Common 6. Add the following files to your project workspace setting: stm32w108xx_it.c and stm32w108xx_it.h: the templates for these files are edited by adding the required interrupts to manage the STM32W108xx_HAL_Driver. So, please refer to the edited files available in the STM32W108xx_SimpleMAC_V2.0.1 package (directory STM32W108xx_SimpleMAC_V2.0.1\\Projects\\SimpleMAC) or in the STM32W108xx_RF4CE_V2.0.1 package (directory STM32W108xx_RF4CE_V2.0.1 \\Projects\\RF4CE). stm32w108xx_conf.h: use the template for this file provided in the standard library package: Projects\\STM32W108xx_StdPeriph_Templates 7. If you use the STM32W108 shared files, please refer to the new version for these files available in directory STM32W108xx_SimpleMAC_V2.0.1\\Utilities\\Shared or in the STM32W108xx_RF4CE_V2.0.1 package (directory STM32W108xx_RF4CE_V2.0.1 \\Utilities\\Shared) 8. Create a new group named User_Application and link to this group the user source files. 9. Update the project include paths:

  • Update the simplemac\\include path by Libraries\\SimpleMAC\\Include path.
  • Update the hal path by Utilities\\STM32W108xx_HAL_Driver path.
  • Update the HAL\\MICRO\\CORTEXM3\\STM32W108 path by STM32W108xx_HAL_Driver\\micro\\cortexm3\\stm32w108.
  • Update the shared path by Utilities\\Shared path.
  • Add the Libraries\\STM32W108xx_StdPeriph_Driver\\inc path.
  • Add the CMSIS\\Include path.
  • Add the Libraries\\CMSIS\\Device\\ST\\STM32W108xx\\Include path.
  • Add the Utilities\\STM32_EVAL path.
  • Add the Utilities\\STM32_EVAL\\MBxxx path (MBxxx can be MB851, MB950, MB951 or MB954 according to the user board).
  • Add the Utilities\\STM32_EVAL\\Common path.
  • Add the Utilities\\STM32W108xx_HAL_Driver\\micro path.
  • Add the Utilities\\STM32W108xx_HAL_Driver\\micro\\cortexm3path.
  • Add the Utilities\\STM32W108xx_HAL_Driver\\micro\\generic\\compiler path.
  • Add the Utilities\\STM32W108xx_HAL_Driver\\micro\\cortexm3\\bootloader path. 10. Define PLATFORM_HEADER in the preprocessor defined symbols as follows:

Migration application using the automatic script AN4141 PLATFORM_HEADER=Utilities\\STM32W108xx_HAL_Driver/micro/cortexm3/compiler/iar.h 11. Remove the BOARD_HEADER from the pr eprocessor defined symbols (the #include BOARD_HEADER line will be updated by the #include "board.h" line when running the automatic script on the user application sources files). 12. Add these defines in the preprocessor defined symbols:

  • USE_STDPERIPH_DRIVER: this define is used to enable the StdPeriph drivers.
  • USE_MBxxx_REVx: to define the project target board
  • STM32W108XX: to define the StdPeriph target product Note: For boards MB951 and MB950, only one revision exists, so USE_MBxxx_REVx can be USE_MB950 when using the board MB950 and USE_MB951 when using the board MB951. Update application sources files 1. Launch the automatic Perl script on the user application source files that makes all possible firmware changes (CMSIS support, including types, handler names, core macro names…). For more details on these changes, please refer to file trace.log. 2. If the user application uses a specific inte rrupt, you need to edit manually the interrupt IRQ handler files: In stm32w108xx_it.c, call the ISR handler defined by the hal in the IRQ handler defined by CMSIS (refer to Table 7: STM32W108xx HAL exception names vs. CMSIS). Example: /** * @brief This function handles PendSVC exception. * @param None * @retval None void PendSV_Handler(void) halPendSvIsr(); In stm32w108xx_it.h, add the ISR handler prototype. 3. Library configuration section inside file stm32w108xx.h: In file stm32w108xx.h, select the case that corresponds to the product that you are using: STM32W108CC, STM32W108CB… Select whether you want to use the STM32W108xx standard peripheral drivers through define USE_STDPERIPH_DRIVER. Configure values for: HSE (high speed external quartz), HSE startup timeout, HSI (internal high speed oscillator), LSE (low speed external quartz) and LSI (low speed internal oscillator) 4. If you wish to use the assert function, refer to step 5 in Section 3.1.3: Library user and toolchain specific files

6 Revision history

Table 22. Document revision history 23-Aug-2012 1 Initial release.