Home

v5.1 ARM Software Platform Introduction

image

Contents

1. BMP085 Pressure Sensor Driver External driver to interface with the BMP085 Digital Pressure Sensor CS4322 Audio Codec Driver Interface to 12C control port of CS4322 stereo audio CODEC LIS302DL MEMS Motion Sensor LM75 Temperature Sensor Interface to LIS8302DL MEMS motion sensor Interface to STLM75 Digital Temperature Sensor amp Thermal Watchdog M24Cxx Serial 12C Bus EEPROM Driver Interface to 12C based M24Cxx serial flash memory device driver MAX1037 ADC Driver Interface to the MAX1037 AD converter device driver MAX5841 DAC Driver Interface to the MAX5841 DA converter device driver MAX6966 LED Driver Device driver for MAX6966 10 Port Constant Current LED Driver peripheral MCP3021 A D Converter Device driver for MCP3021 A D Converter SSD0300 I2C OLED Driver Driver for SSD0300 OLED display over I2C STMPE811 Touchscreen Controller GPIO Expander Interface to STMPE811 touchscreen controller GPIO expander TVP5150 Video Decoder Driver Driver to access configuration registers of aTVP5150 video input decoder device over an 12C bus 53 Introduction to the TASKING Software Platform for ARM External drivers SPI Driver ADC084S021 ADC Driver Description Four channel CMOS 8 bit analog to digital converter with a high speed serial interface ADC104S021 ADC Driver Four channel CMOS 10 bit analog to digital converter with a
2. by the folder and or file we want to locate platform plugin This URL is used to locate a resource available in a Eclipse plug in oundle The path segment after plugin should be the identifier of the bundle which can be followed by the path of the resource in the bundle This URL is used internally for the default Software Platform repository file This URL is used to specify a local file or directory 45 Introduction to the TASKING Software Platform for ARM 1 46 In the Generic_Filesystem project open the Software Platform document Generic_Filesystem swpxmi FS Generic il amp TASKING Software Platform DEFAULTCPU Generated code is out of date Software Services Device Stacks Software Platform Builder POSIX Foe Mounting POSIX Standard Device I O POSIX Storage System POSIX_FILESYSTEM_1 POSIX Standard File I O PSE52 BLOCKIO_1 POSIX Debug Terminal DBG_TERMINAL 1 Select the Software Platform Builder software service The Software Platform Builder Properties view appears Change the value of Local Repositories to platform resource My_Repository Note that this field is case sensitive You can enter the URL directly or you can click the a button to open the Local Repository Locations Click Add to open the Select Location dialog Click Workspace to open the Folder Selection dialog Select My_Repository and click OK in all dialogs
3. e Right click on a stack item or a software service and select API Reference POSIX Multi threading 3 Delete Delete Grow Stack Up Grow Stack Down API Reference Help appears on the individual stack item 3 7 Software Platform Builder Preferences You can use the Preferences dialog in Eclipse to specify how the Software Platform Builder should operate To set preferences 1 From the Window menu select Preferences The Preferences dialog appears 2 Select TASKING Software Platform Builder The Software Platform Builder page appears 3 Set your preferences and click OK You can set the following preferences Generate code on save By default the Software Platform Builders asks if you want to generate code when you save a document Prompt You can choose to do this automatically Always or Never 17 Introduction to the TASKING Software Platform for ARM Software Platform Editor Show adaptors and internal items By default adaptors see Section 2 1 4 Adaptors are not visible in the device stacks This option can be useful when you need support from Altium or when you develop your own plug ins Normally you do not need this option Properties View e Show resource info By default information about the resource is not visible in the Properties view You can use the Show Resource Info button in the Properties view to toggle the resource information on or off or you can use this preferenc
4. 2L Problems E Console Properties z z m m Software Platform Builder EO Property Value Range Prototype 4 Device and Toolset Configuration Device DEFAULTCPU Architecture ARMv7M 4 Repository Locations Local Repositories platform resource My_Repository Use Default Repository true 4 Software Platform Options Enable Asserts false Alternate Output Path An error appears that the Repository cache is out of date Tutorial Creating a Local Repository 4 From the Software Platform menu select Reload Repository or click 0 As you can see the RAM Disk stack item has been replaced by My RAM Disk Generic_FileSystem swpxmi 2 m 4 TASKING Software Platform DEFAULTCPU Generated code is out of date A Software Services Device Stacks Software Platform Builder POSIX P Mounting POSIX Standard Device I O POSIX Staran POSIX_FILESYSTEM_1 POSIX Standard File I O PSE52 BLOCKIO_1 POSIX Debug Terminal My RAM Disk AA DBG_TERMINAL_1 5 RAMDISK_1 If you would generate code again the existing plug in in the generated SoftwarePlat form folder is replaced by the plug in from My_Repository As you can see the My_customized_plugins folder has been added to the Generic_FileSystem project 4 W Generic_FileSystem Active Debug D Ea Binaries gt al Includes gt Debug 4 SoftwarePlatform gt adaptors gt Configuration gt amp cstart 4 G My_cus
5. E Freescale NXP Silicon Labs E Spansion E STMicroelectronics E Texas Instruments Actions E Add startup file s to the project 7 Add linker script file to the project 19 Introduction to the TASKING Software Platform for ARM Select the target processor core or architecture for which you want to build the application For example architecture ARMv7 M Afterwards you can always change the processor in the Project Properties for dialog Leave the rest of the dialog as is and click Next The Target Settings page appears In order to debug your project you need to create a debug configuration Select a target You can select a target board or a simulator For this tutorial we select the ARM Simulator Enable Add launch configuration to the project This allows you to debug your project e Leave the other tabs as is For more information see section Creating a Customized Debug Configuration in Chapter Using the Debugger of the TASKING VX toolset for ARM User Guide Click Finish to finish the wizard and to create the project The project has now been created and is the active project 4 2 Add a Software Platform Document Now that we have a project we can add a Software Platform document 1 From the File menu select New TASKING Software Platform Document The New Software Platform Document dialog appears Leave the project name and file name as is and click Finish A new Software Platform
6. Output TIM4 TIMS TIM8 None TIM9 UART4 UARTS v PA10 USARTL USART2 USART3 USB Other Pins m 4 m 4 Module name USARTL None None K e v PA9 m G m From the File menu select Save Ctrl S or click la to save the configuration From the Pin Mapper menu select Generate Code or click R The Pin Mapper sources are generated and are added to your project in the folder PinMapper Return to the TASKING C C perspective 5 7 Write and Build the Application Now that the Software Platform sources have been generated we can use it to write an application In this tutorial we use the USART port on the evaluation board to send a message to the PC This application uses the library wrapper function stm32_usart_open to configure the USART as specified by the stack item options which makes it easier to access the USART 1 38 From the File menu select New Source File The New Source File dialog appears Enter the source file name main c and click Finish The new file main c is created and ready for editing in the editor view Add the following C source to the file main c Tutorial Using a Library Wrapper include lt stdio h gt include devices h include st_stm32_usart h USART_TypeDef usart NULL int main void initialize the USART device using the library wrapper usart stm32_usart_init ST_STM32F10X_USART_1 j printf Hello world n return
7. Services and Device Stacks cceeeeeeee eee eee eee eee ee nese esata een eea een eea een eeaes 21 4 4 Configure the Software Platform Plug ins eeeceeeeee eee eee eee etree een eea eee eea een eeaeeaes 24 4 5 Generate the Source Code cceeeceeeee ence teen eee eee terete eee ee eee eea ee een ee eea nenene nnan 25 4 6 Write and Build the Application ccc ceeee ee ee eee nent eee teeter eaten ta teeta ea eee ea eeeea teeta eees 26 4 7 Debug the AppliGatinm iii morisien Secec ides sega est esate EE A E T ERN 29 5 Tutorial Using a Library Wrapper 0 cece cece renee erent erent ener EEEE EEEa SEE 31 5 1 Create a Project 2 2 00 cececececeee eee cece ec cece ee een eceece ec eae eceeseeeeeaeeceeseeseeseeeeeaeeeeeaeeeees 31 5 2 Add a Software Platform Document 6 ceeeeeeee eee een e eee ceeeeece ee eneeseeseeeeeaeeeeeneees 32 5 3 Add the Services and Device Stacks cccceeeeeeeee eee ee eee een eee een eea een eea een eeaeeaeeneegs 33 5 4 Configure the Software Platform Plug ins eceeeeeeeee eee ee eee eee eee eeeeea een een een eeneees 35 5 5 Generate the Source Code ceeeeceee cece reentrant ee ee nent neat 36 5 6 Configure the Pins ssisccstacncs tence a saath de a E aE pander aa ea Aaaa 37 5 7 Write and Build the Application cceeeeeeee eee ee eee nent eeeeee eee ee sees eeeseeeesneneneeeees 38 5 8 Connect the
8. driver Software implementation of the Advanced Encryption Standard AES External Interrupt Platform independent generic external interrupt support Generic ADC Driver Generic interface for Analog to Digital Converters 52 Content of the Default ARM Repositories Driver Description Generic CAN Driver Generic interface for Controller Area Networks Generic DAC Driver Generic interface for Digital to Analog Converters Generic PWM Driver Generic interface for Pulse Width Modulation Generic RTC Driver Generic interface for Real Time Clocks RAM Disk Interface for the creation of memory based file systems External drivers External drivers are drivers for off chip peripherals These off chip peripherals are connected to the chip as an SPI slave device an I2C slave device or via some other interface such as GPIO or DMA In the former two cases an on chip SPI master peripheral or an on chip 12C master peripheral is required For example the ADC084S021 ADC driver SPI slave requires the STM32 SPI driver The following tables contain an overview of the external drivers present in the generic repository Some drivers appear in more than one table which means that they can have more than one interface External drivers 12C Driver Description APDS9300 Light Photo Sensor Driver External driver to turn power on or off of a light photo sensor
9. high speed serial interface APDS9300 Light Photo Sensor Driver External driver to turn power on or off of a light photo sensor AT86RF231 Radio Device Driver Interface to the device driver for AT86RF231 802 15 4 packet radio CS4270 Audio Codec Driver Interface to SPI control port of CS4270 stereo audio CODEC DAC084S085 DAC Driver Interface to the DACO84S085 DA converter device driver DAC104S085 DAC Driver Interface to the DAC104S085 DA converter device driver DS1391 Real Time Clock Driver Device driver for DS1391 Real Time Clock peripheral ENC28J60 Driver Interface to ENC28J60 ethernet controller device driver ICS307 Clock Generator Driver ILI9320 LCD Module Driver SPI External driver for CS307 02 serially programmable clock source Device driver for an ILI9320 based LCD that is connected through SPI ILI9341 LCD Module Driver Device driver for the ILI9341 Display Controller M25Px0 Serial Flash Memory Driver Interface to SPI based M25Px0 serial flash memory device driver MAX1104 Audio Codec Driver The MAX1104 CODEC provides both an 8 bit analog to digital converter ADC and an 8 bit digital to analog converter DAC MAX1229 12x12 ADC Driver Device driver for MAX1229 Real Time Clock peripheral PCF2123 Real Time Clock Driver Device driver for PCF2123 Real Time Clock peripheral SD Card Reader Driver Driver to access S
10. to open it The editor consists of two sections the Software Services and the Device Stacks TE USART_printf swpxmi 3 dy TASKING Software Platform STM32F103ZG Generated code is out of date P S y Software Services Device Stacks 32 Software Platform Builder 4 Tutorial Using a Library Wrapper 5 3 Add the Services and Device Stacks Now it is time to add a USART peripheral and connect a library wrapper to it Add a software service or device stack 1 From the Software Platform menu select Add or click F The Add Software Services and Device Stacks dialog appears The left side shows the stack services software services and drivers The right side shows all peripherals for the selected device C Add Add Software Services and Device Stacks Select additional software services and stack items Repository TASKING Device Support for STM32 platform plugin com tasking swp repository stm32 SoftwarePlatform v Services and Drivers 0 3 Peripherals 1 74 E STM32 CMSIS Core E STM32F10X 2S a E STM32F107 Ethernet Access Library STM32F10X IWDG E STM32F10X Peripheral Access Library E STM32F10X PWR STM32FLOX RCC STM32F10X RTC E STM32F10X SDIO STM32F10X SPI E STM32F10X TIM 4 E STM32F10X USART STMB2F10X_USARTI E STM32F10X_USART2 E STM32F10X_USART3 E STM32F10X_UART4 E STM32F10X_UARTS m Total selection count 1 STM3
11. 0 use STM32F0XX peripheral access library functions int fputc int ch FILE f check transmit data register empty flag while USART_GetFlagStatus usart USART_FLAG_TXE SET send one character USART_SendData usart uint8_t ch return ch From the File menu select Save Ctrl S or click Lal The file will be saved From the Project menu select Build USART_printtf or click W af The project is built and a Debug folder is created with the absolute object file USART_printf abs 5 8 Connect the Board Before you can debug the program you need to connect the STM3210E EVAL board The STM3210E EVAL is an evaluation board for STMicroelectronics ARM Cortex M3 core based STM32F103Z microcontrollers Read the STM3210E EVAL evaluation board User Manual UM0488 for detailed information about the board Installing driver software Before you connect J Link or ST LINK to the board first make sure you have installed the latest driver software You can download the latest software for J Link from www segger com download_jlink html You can download the latest software for ST LINK from 39 Introduction to the TASKING Software Platform for ARM http Awww st com web en catalog tools PF258167 Windows 7 XP http Awww st com web en catalog tools PF259459 Windows 8 Jumper settings Set jumper JP13 to PSU for power through the 5V DC power jack Connecting the board 1 C
12. 2F10X USART STMicroelectronics STM32F10X Universal Synchronous Asynchronous Receiver Transmitter 2 From the Repository select TASKING Device Support for STM32 Only services and drivers and peripherals from the selected repository are shown 3 From the Peripherals select STM32F10X_USART1 and click OK The new device stack and software service appear in the TASKING Software Platform editor The STM32 CMSIS Core STM32 Pin Mapper and STM32F10X Peripheral Access Library software services appear automatically because it is required by the peripheral 33 Introduction to the TASKING Software Platform for ARM amp TASKING Software Platform STM32F103ZG Generated code is out of date P Software Services Device Stacks STM32F10X Peripheral Access Library STM32F10X USART STM32F10X_USART1 4 Right click on the STM32F10X USART stack item and select Grow Stack Up from the pop up menu The Grow Stack dialog appears The dialog shows all possible combinations of sub stacks that you can place on top of the selected module SECK UP Ta Eas x rii lt Grow Stack STM32F10X_USART1 Add new stack items Link to Existing New Stacks HyperText Transfer Protocol gt HTTP my Location Services TCP IP Networking ae E LOCATION 1 SS wP ee Simcom AT GPS Service Point to Point Protocol Location Services ze Services B AA GPS_SIMCOM_1 S
13. B PPP1 a LOCATION_1 x Modem Services Modem Services GPS NMEA Services o r y MODEM_1 a MODEM_1 a GPS_NMEA 1 BY POSIX Serial Device I O POSIX Serial Device I O POSIX Serial Device I O t t SERIAL 1 t SERIAL_1 SERIAL_1 STM32 USART Driver STM32 USART Driver STM32 USART Driver STM32F10X USART Library Wrapper DRV_STM32_USART_1 DRV_STM32_USART_1 ST_STM32F10X_USART_1 DRV_STM32_USART_1 4 cancel _ 34 Tutorial Using a Library Wrapper 5 We want to access the STMicroelectronics functions that are present in the Software Platform repository by means of a library wrapper To do this in the New Stacks tab click on STM32F10X USART Library Wrapper to select it and click OK Your Software Platform now looks like this TE USART_printf swpxmi 3 amp TASKING Software Platform STM32F103ZG Generated code is out of date S J Software Services Device Stacks Software Platform Builder STM32 CMSIS Core STM32 Pin Mapper STM32F10X USART Library Wrapper STM32F10X Peripheral Access Library ST_STM32F10X_USART_1 STM32F10X USART STM32F10X_USART1 5 4 Configure the Software Platform Plug ins You can configure peripherals drivers stack services and software services Stack items can have individual options and or global options Individual options are only valid for a specific stack item global options are valid for all stack items o
14. Board aasian geroa ioa raoa EEIE O E E EEEE EE 39 5 9 Debug the Application rriei aaa ai ai aa Es ie 40 6 Tutorial Creating a Local Repository 00 ccceeeeeee ee eee eee e tees ceeeeeseeeeeseeeeeseeseeaeeseeseeeeeaeeaees 43 6 1 Create a Local Repository Project 00 cccceeeeeeeeceeeeeeeeeeeceeeeeseeeeeneeeeeseeeeeaeeeeeneees 43 6 2 Add a Software Platform Plug in 2 0 0 0 cceeeceeee eect eee eee tenet a eea eee eea eee eeaeeaeeaeeaeeneeaeed 43 6 3 Modify the Software Platform Plug in cccceceeee eee eee eee teats nese een eea een eeaeeaeeaeeneeaed 44 6 4 Use the Local Repository oiccen n aea nde gdusee cued aa pi 45 7 Content of the Default ARM Repositories cccceeeeeeeeeeee eee etre eee ee eee eee ee neta een eea een eeaeeaes 49 7 1 TASKING POSIX RepoSitOry 0 0 0 cc nee nent neat 49 7 2 STM32 Repository 2 2 00 cece eee ce cece eee eee e eee e eee nade ttrt cttn e desea deta ee dee ane aee ane renent 50 AB EFM32 REPOSO aeaa an ape dinins E E E E A EEEE 51 7 4 Generic REpOSItOry sisesed erraitia tie treina iai ienien ipo ane a eh rir a i enai E iane 51 B GIOSSANY soi e ae e E mas ara E E E O E E A NSS 57 Introduction to the TASKING Software Platform for ARM Chapter 1 Introduction With TASKING Software Platform you can quickly create full featured applications A Software Platform is made up of software blocks pieces of functionality that you can use in your application l
15. D card readers through an SPI controller SPFD5408 LCD Module Driver SPI Device driver for SPFD5408 based LCDs through SPI connections SSD1329 SPI OLED Driver Driver for SSD1329 OLED display over SPI External drivers other Driver Description APDS9700 Proximity Sensor Driver External driver to interface with a proximity sensor AT86RF231 Radio Device Driver Interface to the device driver for AT86RF231 802 15 4 packet radio DWC USB OTG Driver DesignWare Core portability library low level OS wrapper functions 54 Content of the Default ARM Repositories Driver Description HIH5030 Humidity Sensor Driver External driver to interface with a humidity sensor ILI9320 LCD Module Driver parallel Device driver for an ILI9320 based LCD that is connected to the parallel interface IL1I9341 LCD Module Driver Device driver for the ILI9341 Display Controller M25Px0 Flash Memory Block I O Interface to M25Px0 parallel flash memory device driver SPFD5408 LCD Module Driver parallel SSD1329 SPI OLED Driver Device driver for SPFD5408 based LCDs through parallel connections Driver for SSD1329 OLED display over SPI ST7637_PAR LCD Driver Driver for ST7637 LCD display with parallel interface 55 Introduction to the TASKING Software Platform for ARM 56 Chapter 8 Glossary The following terminology is used to
16. E devas 4 2 V2 Drivers Sersan En A S a TEE O A EOE 4 2 1 3 Stack Services 2 0 eee nee eed eed eee edna nee a ee aeeaes 5 2 NA Adaptors asic ssc stein d nean deiner E AEA OE ee EE E reining ee 5 2 2 SoftWare SOMVICES eisie rene irora eta uE EEEE EE level a ee ieee ets 6 3 Getting Started with the Software Platform Builder cccceeeeeeeeeeeeeeeeceeeeeseeeeeneeeeeneeeeeaes 7 3 1 Creating a Software Platform DOCUMENT 0ceeeeeeeeeee eee ee eee n eee een eee eeneeaeeaeeaeeaeeaed 7 3 2 Working with Device Stacks ceeeeeee cece eect teeter teeter ee eee teeter eee eei eset eeeeeeeee es 8 3 3 Configuring the Software Platform Plug ins ccceceeeeeee eee eee eee eee ee eee een eea eee eea een ees 12 3 4 Generating and Using the Source Code cceeeeeee eee eee eee eee eee een eeeeeaeeaeeneeaeeaeeaeed 13 3 5 Using the Sample Projects cccceeeee teeter eee eee eee e terete ee ee arenes een eeaeeaeeaes 15 3 62 API Referente x4 va sescine Scesatint cs ini EE aus EA online a EAE AE 17 3 7 Software Platform Builder Preferences ceceeeeeeeeee eee eee eee ee eee eee eee tenes teeta nents 17 4 Tutorial Creating a File System on a RAM Disk ecceeeeeeeeeee eee eee een eeeeeaeeeeeaeeaeeaeeaeeneeas 19 4 1 Create a Project eee 19 4 2 Add a Software Platform Document ecceeeeee eect ee ee cette eee eeeeceeeeeneeseeaeeeeeneeeeeaes 20 4 3 Add the
17. E811_1 STM32 Ethernet MAC STM32 Master I2C Driver Driver DRV_STM32_EMAC_1 DRV_STM32_2CM1 DRV_ILI9320_PAR 1 STM32F2XX EMAC STM32F2XX I2C STM32F2XX_ETH STM32F2XX_2C1 Introduction to the TASKING Software Platform for ARM Each colored stack item represents a software module In this example the HTTP stack consists of five modules for each abstraction level one The GUI Services requires Graphics Services and Pointer Services In general your application interfaces only to the highest level modules Device stacks may be composed of the following types of plug ins peripherals drivers stack services and adaptors 2 1 1 Peripherals Peripherals the green stack items are the lowest level modules They provide information for the higher layers of the stack to access the peripherals Information such as the base address interrupt assignment and any soft peripheral configuration is all stored in the peripheral STM32F2XX EMAC STM32F2XX_ETH Peripheral modules are meant to be instantiated Each instance then corresponds to one device of the given kind Instances of peripherals do not normally require other instances In most situations your application does not access the peripherals directly because the application accesses them through the driver s interface on top of it For most peripherals you need to use the TASKING Pin Mapper to configure the connections between peripherals and port pins For information about the TASKING Pin
18. Mapper see Using the TASKING Pin Mapper for ARM 2 1 2 Drivers Drivers the yellow stack items provide the next level of abstraction They provide low level access to specific hardware either via a peripheral or via another driver STM32 Ethernet MAC STM32F2XX EMAC Driver Library Wrapper DRV_STM32_EMAC_1 ST_STM32F2XX_ETHMAC_1 The difference between a driver and a peripheral is well defined The peripheral only defines basic information about the hardware but provides no further functionality This basic information can be used by a driver which you can place on top of the peripheral Driver modules are meant to be instantiated Each instance then corresponds to one device of the given kind A driver instance requires one instance of the corresponding peripheral Drivers are hardware specific and so are the interfaces they offer Hence if your application contains code that accesses a driver s API your application will be hardware dependent Drivers still operate at a low abstraction level and using a device at the driver level requires knowledge of that particular driver s interface Organization of the Software Platform Repositories Some drivers are available as library wrappers They only offer an initialization routine which you can call from an application in order to configure pins clocks and registers After this initialization you can use the peripheral driver libraries from silicon vendors 2 1 3 Stack Services Stack se
19. NT8 4 5 Generate the Source Code Now that you have added and configured the Software Platform plug ins you are ready to generate the Software Platform sources for your project From the Software Platform menu select Generate Code or click Ca The Software Platform sources are retrieved from the repositories and are added to your project in the folder Soft warePlat form Tool options such as defines and include paths are added to the Generated 25 Introduction to the TASKING Software Platform for ARM options field in your project properties Options can also be set on the SoftwarePlat form folder and or sub folders se Generic_FileSystem Active Debug in Includes 4 SoftwarePlatform amp adaptors E Configuration amp cstart E platform E services Generic_FileSystem launch ja Generic_FileSystem sI E Generic_FileSystem swpxmi Also every time you save the changes you have made to your Software Platform document a dialog appears asking if you want to generate the code You can change this behavior in the Preferences dialog as explained in Section 3 7 Software Platform Builder Preferences a Generate Code Generic_FileSystem swpxmi l x Q Software Platform document has been updated Generate code E Remember my decision 4 6 Write and Build the Application Now that the Software Platform sources have been generated we can use it to write an application In this tutorial we mount a f
20. TASKING Introduction to the TASKING Software Platform for ARM MA101 869 v1 2 October 10 2014 Copyright 2014 Altium BV All rights reserved You are permitted to print this document provided that 1 the use of such is for personal use only and will not be copied or posted on any network computer or broadcast in any media and 2 no modifications of the document is made Unauthorized duplication in whole or part of this document by any means mechanical or electronic including translation into another language except for brief excerpts in published reviews is prohibited without the express written permission of Altium BV Unauthorized duplication of this work may also be prohibited by local statute Violators may be subject to both criminal and civil penalties including fines and or imprisonment Altium TASKING and their respective logos are trademarks or registered trademarks of Altium Limited or its subsidiaries All other registered or unregistered trademarks referenced herein are the property of their respective owners and no trademark rights to the same are claimed Table of Contents Ve Production sares aean kaa a a nls caadegecndadiaceaehiddueatess a a E bvecueades eeeceees 1 2 Organization of the Software Platform Repositories cccceeeeeeeee eee ee eee eee eee eea een eea een eeaeeaes 3 2 1 Device StACKS inii nnna ieohads betehelie bi E O E E EEEE E A E E 3 2 kis PenpheralS 4 2 annere aeann a E a OT Ea O EEE
21. TEM_1 Add new stack items Link to Existing New Stacks POSIX Standard File I O PSE52 BLOCKIO_1 RAM Disk RAMDISK_1 2 We want to add a RAM Disk To do this in the New Stacks tab click on RAM Disk to select it and click OK 23 Introduction to the TASKING Software Platform for ARM Your Software Platform now looks like this pxmi 3 4 TASKING Software Platform DEFAULTCPU Generated code is out of date Software Services Device Stacks Software Platform Builder POSIX Standard Device I O POSIX Storage System POSIX FILESYSTEM1 POSIX Standard File I O PSE52 BLOCKIO_1 POSIX Debug Terminal RAM Disk DBG_TERMINAL 1 RAMDISK 1 4 4 Configure the Software Platform Plug ins You can configure peripherals drivers stack services and software services Stack items can have individual options and or global options Individual options are only valid for a specific stack item global options are valid for all stack items of the same type When you click on an item in the Software Platform Builder configuration options appear in the Properties view In this tutorial we want to redirect Standard Output and Standard Error to the POSIX Debug Terminal 1 Click on the POSIX Standard Device I O software service A view similar to the following appears E Problems EJ Console Properties 53 a POSIX Standard Device I O Prop
22. d made available as a result of including this file 14 Getting Started with the Software Platform Builder The following is an example of swplat form h generated as a wrapper around the active project s Software Platform Software Platform Generated File ifndef _SWP_SWPLATFORM_H define _SWP_SWPLATFORM_H Stack Item ID s include devices h Software Services include lt interrupts h gt include lt matrixsslApi h gt include lt pthread h gt include lt sched h gt include lt semaphore h gt Top Level Stack Items include lt http h gt Lower Level Stack Items include lt ethernet_e h gt include lt lwip h gt include lt lwipopts h gt include lt drv_stm32_cfgtypes h gt include lt drv_stm32_emac h gt endif _SWP_SWPLATFORM_H 4 You can now use the functions of the Software Platform in your sources For example int main void http t http http http_open HTTP_1 if http fprintf stderr HTTP open failed n exit 1 3 5 Using the Sample Projects A Software Platform repository may contain a number of sample projects These examples can be a good starting point for your own project You can import Software Platform repository examples via the Import wizard in Eclipse 15 Introduction to the TASKING Software Platform for ARM Import an existing Software Platform project 1 From the File menu select Impo
23. d Package page appears 3 New TASKING Pin Mapper Document o Device and Package Select device and package for the new pin mapper document Processor Settings Only show items for STM32F103ZG Show all a E STMicroelectronics a E STM32F103 STM32F103Z F G Hx 4 STM32F103Z F G Tx LQFP144 O lt Back Next gt l Cancel Select the processor and package that is used on the board and click Finish In our example we use the STM3210E Eval board which has a STM32F103Z F G Tx and package LQFP 144 A pin configuration file with extension pincfg is added to the existing project Because the TASKING C C perspective is still active Eclipse asks to open the TASKING Pin Mapper perspective Optionally enable the option Remember my decision and click Yes The TASKING Pin Mapper perspective is opened In the Pin Selection pane select Peripherals USART1 37 Introduction to the TASKING Software Platform for ARM 10 In the Pin Configuration pane set the Mode to UART No Handshake No Remap This selection automatically connects RX to PA10 and TX to PAY A green check mark v appears if the connection is successful USART_printf pincfg 3 TASKING Pin Mapper STM32F103Z F G Tx LQFP144 C4 Pin Selection Pin Configuration typefiltertext H A Usetag typenewtag v TIM11 a TIM12 TIM13 USART1 Configuration TIM14 Mode UART No Handshake No Remap TIM2 TIM3 Input
24. describe the TASKING Software Platform concepts in alphabetical order Software Platform The source code generated by the Software Platform Builder The source code becomes part of your project A graphical representation of the Software Platform is present in the Software Platform Builder Software Platform Builder The graphical editor where you can edit a Software Platform document and where you can generate the source code for your Software Platform The editor shows a graphical representation of your Software Platform Software Platform document A file with extension swpxmi which is part of your project It contains the configuration of your Software Platform and is managed by the Software Platform Builder Software Platform plug in or module Software Platform definition files source code and other resources Plug ins are bundled in a Software Platform repository Software Platform repository The collection of Software Platform plug ins It provides the contents for a generated Software Platform TASKING Software Platform The main software framework delivered by Altium consisting of Software Platform repositories and the Software Platform Builder 57 Introduction to the TASKING Software Platform for ARM 58
25. document is added to the active project Generic_FileSystem swpxmi TASKING Software Platform Builder editor Double click on the Software Platform document Generic_FileSystem swpxmi to open it The editor consists of two sections the Software Services and the Device Stacks 20 Tutorial Creating a File System on a RAM Disk FTE Generic_FileSystem swpxmi 53 m 4 TASKING Software Platform DEFAULTCPU Generated code is out of date P amp y Software Services Device Stacks Software Platform Builder 4 3 Add the Services and Device Stacks Now it is time to create our RAM disk and create a file system What we need is a RAM disk a storage system and terminal services for debugging Add a software service or device stack 1 From the Software Platform menu select Add or click F The Add Software Services and Device Stacks dialog appears The left side shows the stack services software services and drivers The right side shows all peripherals for the selected device In this tutorial you do not see any peripheral because we selected a generic architecture 21 Introduction to the TASKING Software Platform for ARM 22 Add Software Services and Device Stacks Select additional software services and stack items Repository TASKING POSIX implementation platform plugin com tasking swp repository posix SoftwarePlatform v Services and Drivers 2 6 Peripherals 0 0 F POSIX Message Qu
26. e Services and Device Stacks Select additional software services and stack items Repository All Available Repositories x Services and Drivers 1 27 Peripherals 0 82 HyperText Transfer Protocol a gt STM32F2XX ADC a 1L19320 LCD Module Driver parallel gt STM32F2XX CAN F E JPEG Decoder gt STM32F2XX CRC JPEG Encoder STM32F2XX CRYP Location Services gt E STM32F2XX DAC Z Modem Services gt STM32F2XX DBG POSIX Debug Terminal STM32F2XX DCMI D E POSIX Storage System gt E STM32F2XX DMA E t POSIX Text Display gt STM32F2XX EMAC RAM Disk gt STM32F2XX EXTI gt E SPFD5408 LCD Module Driver parallel gt STM32F2XX FLASH a V TCPAP Networking gt STM32F2XX FSMC LWIP_1 gt STM32F2XX GPIO t USB Host Service gt STM32F2XX HASH gt E UUID Generator E STM32F2XX 2C Total selection count 1 TCP IP Networking TCP IP Internet protocol suite Cox Jl coea Optional Select a Repository Select the services drivers and peripherals you want and click OK The new device stacks and software services appear in the TASKING Software Platform editor Some software services appear automatically because they are required by other services or stack items If you do not see any peripheral you probably selec
27. e option to turn resource information on by default e Show hidden options By default several plug in options are not visible in the Properties view This option can be useful when you need support from Altium or when you develop your own plug ins Normally you do not need this option 18 Chapter 4 Tutorial Creating a File System on a RAM Disk In this tutorial we show how to create an example Software Platform project You will learn how to use the software to create a file system on a RAM disk This example uses the simulator so no additional hardware is required 4 1 Create a Project The first step is to create a C project This is explained in detail in the Getting Started manual of the toolset but for this tutorial we repeat this step 1 From the File menu select New TASKING ARM C C Project The New C C Project wizard appears 2 Enter a name for your project for example Generic_FileSystem In the Location field you will see the location where the new project will be stored 3 Inthe Project type box you can select whether to create an application or a library Expand TASKING ARM Application and select Empty Project This creates a project without a C source file e Click Next to continue The ARM Project Settings page appears New C C Project fs eon ARM Project Settings gt Select a processor to continue Processor selection Elsesatycoe Epara au_ E Select by Core fin
28. e software that accesses or controls a peripheral you need a thorough knowledge of how the peripheral works which registers you need which device specific commands to use which communication protocols to use and which interrupts to handle The modules of the Software Platform repository take care of all these laborious lower level routines and instead provide you with an easy to use Application Programming Interface API for each peripheral that your application needs to control e Configurability Embedded systems require very precise compile time configuration mechanisms to manage their intrinsic complexity A typical module may show different possible configurations that have direct impact on the final behavior of the software The main idea behind compile time configurations in embedded systems is to remove unnecessary functionality in order to enhance memory costs and real time performance e Expandability Altium but also other parties can adapt the modules and create their own modules For information how to use the Software Platform Builder see Chapter 3 Getting Started with the Software Platform Builder Chapter 2 Organization of the Software Platform Repositories Software Platform repositories can contain numerous software modules that take care of lower level software routines as well as modules that offer extra functionality by providing you with a convenient API The Software Platform consists of device stacks and sof
29. erty Type 4 Software Service Options Standard Input BOOLEAN Standard Output BOOLEAN Standard Error BOOLEAN DEV_MAX UINT8 24 Tutorial Creating a File System on a RAM Disk 2 Change the value of Standard Output and Standard Error to true New properties for device name and buffer type appear When you hover the mouse over a property balloon help appears E Problems El Console Properties x POSIX Standard Device I O Property 4 Software Service Options Standard Input Standard Output stdout device name re z O Type Range Prototype BOOLEAN BOOLEAN stdout buffering type INCTANCE Name of device for stdout Standard Error stderr device name stderr buffering type DEV_MAX BOOLEAN INSTANCE ENUM UINT8 3 Change the value of stdout device name and stderr devic name to DBG_TERMINAL_1 This is the ID of the POSIX Debug Terminal stack item The properties for POSIX Standard Device I O should now look like this Ei Problems E Console i Properties 3 POSIX Standard Device I O Property Value 4 Software Service Options Standard Input false Standard Output true stdout device name DBG_TERMINAL 1 stdout buffering type None Standard Error true stderr device name DBG_TERMINAL_1 stderr buffering type None DEV_MAX 8 re ZEO Type Range Prototype BOOLEAN BOOLEAN INSTANCE ENUM BOOLEAN INSTANCE ENUM UI
30. eues No peripherals available in selected repository POSIX Multi threading E POSIX Signals V POSIX Debug Terminal DBG_TERMINAL_1 V POSIX Storage System 7 POSIX_FILESYSTEM_1 E POSIX Text Display Total selection count 2 POSIX Storage System File systems From the Repository select TASKING POSIX implementation Only services and drivers from the selected repository are shown From the Services and Drivers select POSIX Debug Terminal and POSIX Storage System and click OK The new device stacks and software services appear in the TASKING Software Platform editor Some software services appear automatically because they are required by other services or stack items Tutorial Creating a File System on a RAM Disk ypxmii TASKING Software Platform DEFAULTCPU 1 error 1 warning Software Services Device Stacks Software Platform Builder 4 POSIX Debug Terminal POSIX Storage System a POSIX Standard Device I O oA DBG_TERMINAL_1 2 POSIX_FILESYSTEM_1 i Missing Requirement 1 H blockio As you can see we are missing a requirement Block device I O is needed for communication between the RAM Disk and the Storage System We will add this now 1 Click on the Missing Requirement stack item The Grow Stack dialog appears The dialog shows all possible combinations of sub stacks that you can place below the selected module Grow Stack POSIX_FILESYS
31. f the same type When you click on an item in the Software Platform Builder configuration options appear in the Properties view In this tutorial we want to change the USART communication mode of the library wrapper 1 Click on the STM32F10X USART Library Wrapper stack item A view similar to the following appears Ei Problems EJ Console E Properties 83 gt re STM32F10X USART Library Wrapper Property Value Type 4 Stack Item Options ID ST_STM32F10X_USART_1 USART_BaudRate 115200 UINT32 USART_WordLength USART_WordLength_8b ENUM USART_StopBits USART_StopBits_1 ENUM USART_Parity USART_Parity_No ENUM USART_Mode USART_Mode_Rx ENUM USART_HardwareFlowControl USART_HardwareFlowControl_None ENUM 35 Introduction to the TASKING Software Platform for ARM 2 Change the value of USART_Mode to USART_Mode_Rx USART_Mode_Tx The properties for STM32F10X USART Library Wrapper should now look like this L Problems El Console i imal STM32F10X USART Library Wrapper Property Value Type 4 Stack Item Options ID ST_STM32F10X_USART_1 USART_BaudRate 115200 UINT32 USART_WordLength USART_WordLength_8b ENUM USART_StopBits USART_StopBits_1 ENUM USART_Parity USART_Parity_No ENUM USART_Mode USART_Mode_Rx USART_Mode_Tx ENUM USART_HardwareFlowControl USART_HardwareFlowControl_None ENUM 5 5 Generate the Source Code Now that you have added and configured the Software Platform
32. figure shows some device stacks 11 Introduction to the TASKING Software Platform for ARM GUI Services AGUL1 HyperText Transfer Pointer Services Graphics Services Protocol HTTP1 a POINTER 1 GRAPHICS 1 TCP IP Networking Touchscreen Services ILI9320 LCD Module Driver parallel LWIP_1 TOUCHSCREEN_1 Ethernet Protocol STMPE811 Touchscreen Services Controller GPIO ETHERNET _1 DRV_STMPE811_1 STM32 Ethernet MAC STM32 Master I2C Driver Driver DRV_STM32_EMAC_1 DRV_STM32_2CM_1 DRV_ILI9320_PAR_1 STM32F2XX EMAC STM32F2XX I2C STM32F2XX_ETH STM32F2XX_12C1 Note that some drivers ILI9320 LCD Module Driver in this example do not require a peripheral because the device is accessed through the memory controller 3 3 Configuring the Software Platform Plug ins You can configure peripherals drivers stack services and software services Stack items can have individual options and or global options Individual options are only valid for a specific stack item global options are valid for all stack items of the same type When you click on an item in the Software Platform Builder configuration options appear in the Properties view For example when you click HyperText Transfer Protocol a view similar to the following appears E Properties 3 ae 72q HyperText Transfer Protocol Property Value Type Range Prototype 4 Stack Item Options ID HTTP_1 4 Global Options HTTPS false BOOLEAN A plug in option may automatically set
33. g the Source Code When you have added configured and or updated the Software Platform plug ins you are ready to add the Software Platform sources to your project Generate source code From the Software Platform menu select Generate Code or click Ce The Software Platform sources are retrieved from the repositories and are added to your project in the folder SoftwarePlat form Tool options such as defines and include paths are added to the Generated options field in your project properties Options can also be set on the SoftwarePlat form folder and or sub folders 13 Introduction to the TASKING Software Platform for ARM 4 myproject Active Debug Includes 4 PinMapper A stm32_chip_config c R stm32_chip_config h 4 SoftwarePlatform amp adaptors gt amp Configuration amp cstart amp platform services myproject c myproject launch hs myproject lsl myproject pincfg oa myproject swpxmi Using the Software Platform sources A plug in defines a set of functionality that is types defines structures and functions This functionality is accessible from your application You can find the generated files in the SoftwarePlat form folder of your project To use the generated files you must add a include statement into your top level source file typically main c include swplatform h All other required header files needed to access the devices in the stack are include
34. ialog appears The dialog shows all possible combinations of sub stacks that you can place below the selected module 10 Getting Started with the Software Platform Builder Grow Stack LWIP_1 Add new stack items Link to Existing New Stacks Ethernet Protocol Services ETHERNET_1 STM32 Ethernet MAC Driver DRV_STM32_EMAC_1 STM32F2XX EMAC STM32F2XX_ETH Ethernet Protocol Services ETHERNET_1 ENC28J60 Driver DRV_ENC28J60_1 STM32 SPI Driver DRV_STM32_SPI1 STM32F2XxX SPI STM32F2XX_SPIL Ethernet Protocol Services ETHERNET_1 USB Host Service USBHOST_1 DWC USB OTG Driver DWC_USB_OTG_1 STM32F2XX USB OTG STM32F2XX_USB_OTG_HS Point to Point Protoco Services PPP 1 Modem Services MODEM 1 POSIX Serial Device SERIAL_1 STM32 USART Driver DRV_STM32_USART_1 STM32F2XX USART STM32F2XX_USART1 4 m OK Cancel 2 Select any module in any of the possible sub stacks to extend the selected stack downwards and click OK Note that when you click on a Missing Requirement the Grow Stack dialog appears automatically The Grow Stack dialog contains two tabs one to form a new stack and one to link two existing stacks If your document contains partial stacks which potentially can be combined into a single stack it will be visible in the Link to Existing tab You can link them together to form a complete stack Otherwise select the New Stacks tab Example The following
35. ike RTOS facilities peripheral access or software protocols The exact contents of a Software Platform depend on the need of your application The Software Platform Builder is used to manage your Software Platform It is both a graphical editor and a code generator Collections of software modules are delivered as Software Platform repositories The following figure shows the process to create your own Software Platform gt SWP document A Software Platform repository may contain any kind of software but typical modules include interrupt services timers peripherals hardware wrappers drivers kernel services such as POSIX multithreading device I O file system FatFs networking TCP IP graphical user interface etc The main reasons for having software modules are e Integration Modules do not live isolated Quite the contrary they need to relate and interact with other modules For instance they often define interfaces which are implemented by other modules e Software reuse Software reuse means effectively to be capable of encapsulating all the information of a component hardware and or software in a consistent manner Once this information is made Introduction to the TASKING Software Platform for ARM available higher abstraction layers can use it to customize or configure the system after little or none user intervention e Hide complexity Writing software from scratch is a time consuming activity To writ
36. ile system on a RAM disk create a directory create a file and list the directory contents This application uses the TASKING POSIX implementation 1 From the File menu select New Source File The New Source File dialog appears 2 Enter the source file name main c and click Finish The new file main c is created and ready for editing in the editor view 3 Add the following C source to the file main c include lt stdio h gt include lt swplatform h gt 26 Tutorial Creating a File System on a RAM Disk include lt fs h gt include lt dirent h gt include lt sys stat h gt define SRC_DEV dev BLOCKIO_1 define DIR_SEP list the directory contents static int dirlisting const char path DIR dir struct dirent dirent struct stat buf char path_to_file PATH_MAX dir opendir path if dir NULL printf Contents of folder Ss n path while 1 dirent readdir dir if dirent NULL break sprintf path_to_file s s s path DIR_SEP dirent gt d_name if stat path_to_file amp buf 0 if S_ISDIR buf st_mode i printf DIR t3s n dirent gt d_name a if S_ISREG buf st_mode printf FILE t s t 3d bytes n dirent gt d_name int buf st_size else printf UNK t s n dirent gt d_name printf n if closedir dir 0 27 Introduction to the TASKING Softwa
37. ilesystem Alternatively you can click the button in the main toolbar The TASKING Debug perspective is associated with the TASKING C C Debugger Because the TASKING C C perspective is still active Eclipse asks to open the TASKING Debug perspective Optionally enable the option Remember my decision and click Yes The debug session is launched This may take a few seconds The application suspends when entering the main function 29 Introduction to the TASKING Software Platform for ARM TASKING Debug Generic FileSystem SoftwarePlatform main c ARM Eclipse IDE vx yrz File Edit Source Refactor Navigate Search Project Debug Window Help rie S Mii Gy Sr O Grif R BH Si ire SOU ENRQeH SR Hieav DB Breve oro s Quick Access i S TE TASKING C C SS TASKING Debug Debug ZS st i gt 7 Bi 09 Variables 22 _ 0 Breakpoints E int Registers 32 Fro 4 Generic_FileSystem TASKING C C Debugger si B x g I 7 Group a amp ARM Simulator ARMv7 M 9 3 14 12 33 PM Su J Name Value 4 g Thread ARM Suspended Name Value Usage 1 main main c 60 0x00001d5c eT e lt no storage assigned TE 0x0 E 2Reset_Handler cstart c 269 0x0000420c eee E ts unknown gt R 00 m R2 0x65d30 a m R3 0x80000 R4 o0 gt TH am al r 4 4 52 oS 2D 2 Generic_FileSystem swpxmi main c 3 o E Disassembly 22 g Outline o int main void Address
38. int rc int main void G Create the RAM disk int rci rc mkfs SRC_DEV fatfs NULL Ramdisk false if rc lt Create the RAM disk E P ee e1dsc f b5 push r4 r7 1r printf Error mkfs returned d n rc rc mkfs SRC_DEV fatfs NULL Ramdisk false ee0e1dse 23 mov r3 0x0 001d60 4d f8 04 3d str r3 r13 4 gt f printf Mount filesystem n m m E Console 5 Tasks Ee BE of By oy gt G Memory 3 my y v oF ES a 7 ml Debug Generic_FileSystem _ Monitors oh 3e Target ARM Simulator Selected CPU type ARMv7M Register file C Program Files x86 TASKING carm vx yrz etc Communication Simulator Debug Instrument Module disimarm Using Java Link Version 1 141 Starting Debugger ad a ley m m r Writable SmartInset 60 1 button Ul The application is executed The FSS view now shows Mount filesystem Contents of folder ramdisk Create directory Contents of folder ramdisk DIR DIR1 FILE TEST TXT 4 bytes To resume execution from the Debug menu select Resume or press F8 or click on the Resume Congratulations you just made an example Software Platform application For more information about debugging an application see Chapter Debugging your Application of the Getting Started with the TASKING VX t
39. lication see Chapter Debugging your Application of the Getting Started with the TASKING VX toolset and Chapter Using the Debugger of the TASKING VX toolset for ARM User Guide 41 Introduction to the TASKING Software Platform for ARM 42 Chapter 6 Tutorial Creating a Local Repository In this tutorial we show how to create your own Software Platform repository This can be useful when you want to create your own plug ins or to adapt existing plug ins to suit your needs We assume that the Generic_Filesystem project of Chapter 4 Tutorial Creating a File System on a RAM Disk is still present in the C C Projects view 6 1 Create a Local Repository Project To use a local repository we need to create a project This does not have to be a toolset project because we do not have to compile anything It is just a container for your local plug ins Therefore it can be a general project 1 From the File menu select New Project The New Project wizard appears 2 Select General Project and click Next The Project page appears 3 Enter a name for your project for example My_Repository In the Location field you will see the location where the new project will be stored 4 Click Finish to finish the wizard and to create the project The project has now been created and is visible in the C C Projects view 6 2 Add a Software Platform Plug in You can copy existing plug ins as a starting point or you can write one from scra
40. license agreements Check the generated code for the exact license usage conditions Software services The following table contains an overview of the software services present in the generic repository Software Service Description AES Generic interface to Advanced Encryption Standard AES encryption modules Audio Service Interface to audio controller services Bluetooth HID Service Bluetooth Human Interface Device HID class Interfaces to bluetooth service Bluetooth Service Bluetooth interface Ethernet Protocol Services Service for ethernet peripherals GPS NMEA Services GPS NMEA decoder Graphics Services Service for graphics routines low level drawing functionality GUI Services The Altium Graphical User Interface AGUI contains components you can use to build a User Interface HyperText Transfer Protocol HTTP interface Interrupt Management Interrupt services Used by interrupt driven driver software 51 Introduction to the TASKING Software Platform for ARM Software Service Description JPEG Decoder Basic implementation to decode a JPEG image JPEG Encoder Basic implementation to encode a JPEG image JSON Parser Interface to YAJL s JSON generation facilities Location Services Generic interface to GPS NMEA or Simcom AT GPS services Matrix SSL TLS Modem Services SSL and TLS implementation designed for small footprint applicatio
41. m document to open it The editor consists of two sections the Software Services and the Device Stacks Introduction to the TASKING Software Platform for ARM FS myproject swpxmi xs TASKING Software Platform STM32F2171G Generated code is out of date P S sy Software Services Device Stacks Software Platform Builder The following toolbar icons are available Icon Action Description Cg Generate Code Generates the source code and adds it to your project Adds software services and or device stacks Reload Repositor Reloads the repository This can be necessary when you have updated 7 P Y Ithe repository or when you changed the contents of a local repository 3 2 Working with Device Stacks In the Device Stacks section you can build device stacks by adding modules from one or more Software Platform repositories To build a device stack you can start bottom up by choosing a peripheral or you can start top down by choosing a high level stack service Add a software service or device stack 1 From the Software Platform menu select Add or click The Add Software Services and Device Stacks dialog appears The left side shows the stack services software services and drivers The right side shows all peripherals for the selected device You can filter on a specific repository By default all available repositories are listed Getting Started with the Software Platform Builder Add Softwar
42. ns and devices Services to communicate with modems using Hayes AT commands Point to Point Protocol Services LWIP PPP service Pointer Services The pointer service keeps the current pointer position up to date depending on the input from mouse and or touchscreen Simcom AT GPS Service GPS receiver Software Timing Services Timing and timer services TCP IP Networking AutolP Automatic LinkLocal IP Configuration Touchscreen Services Interface to touchscreen controller services USB Host Bluetooth HCI Service Driver for USB Host Bluetooth HCI USB Host Hub Service Driver for USB Host Hub USB Host Keyboard Service USB Host Mass Storage Service Driver for USB Host Keyboard Driver for USB Host MSD USB Host Mouse Service Driver for USB Host Mouse USB Host Service Generic USB Host service USB Host Video Service Driver for USB Host UVC UUID Generator This module partially implements RFC4122 Generic drivers Generic drivers provide a generic interface to a certain type of peripheral If the application uses the generic interface then the hardware specific driver can be changed without the need to modify the application For example you can have a generic ADC driver that interfaces with an ADC084S021 ADC driver SPI Driver Description 802 15 4 LR WPAN AES Encryption Decryption Generic low rate wireless PAN
43. onnect any of the J Link or ST LINK debugger probes with the 20 pin JTAG SWD cable to the board Connect J Link or ST LINK to a PC with a USB cable Connect port USART1 with a serial cable to a PC Power the board with the 5V DC power adapter connected to the power jack on the board CN17 5 9 Debug the Application We are now ready to use the evaluation board to run and debug the application To see the output of the application on your PC you can use a terminal emulator 1 40 From the Debug menu select Debug USART_prinif Alternatively you can click the button in the main toolbar The TASKING Debug perspective is associated with the TASKING C C Debugger Because the TASKING C C perspective is still active Eclipse asks to open the TASKING Debug perspective Optionally enable the option Remember my decision and click Yes The debug session is launched This may take a few seconds The application suspends when entering the main function Tutorial Using a Library Wrapper File Edit Source Ref Pr glee eror a F Debug X 4 gf Thread ARM Suspended 1 main main c7 008000878 premere Project Window Help ri SFr AA aA T RANC AA EET EE AEE Quick Access i E E TASKING C C 3S TASKING Debug L main c 3 include lt stdio h gt include devices h include st_stm32_usart h USART_TypeDef usart NULL gt int main void initialize the USART de
44. oolset and Chapter Using the Debugger of the TASKING VX toolset for ARM User Guide 30 Chapter 5 Tutorial Using a Library Wrapper In this tutorial we show how to use the Software Platform as a wrapper to access library functions from STMicroelectronics You will learn how to use a UART for communication over a serial port This example uses the STM3210E EVAL evaluation board 5 1 Create a Project As explained in the previous chapter the first step is to create a C project 1 From the File menu select New TASKING ARM C C Project The New C C Project wizard appears 2 Enter a name for your project for example USART_printf In the Location field you will see the location where the new project will be stored 3 Inthe Project type box you can select whether to create an application or a library Expand TASKING ARM Application and select Empty Project This creates a project without a C source file e Click Next to continue The ARM Project Settings page appears EJ New C C Project anr ARM Project Settings gt Select a processor to continue Processor selection E Select by Architecture Expand All E Select by Core ea Atmel Expand Selecte Freescale kifo Collapse al NXP E Silicon Labs E Spansion F STMicroelectronics Texas Instruments Actions Add startup file s to the project 7 Add linker script file to the project Mim e mn a 4 Select the targe
45. other plug in options and may even add automatic services For example in this case when you set HTTPS to true this adds the Matrix SSL TLS services automatically 12 Getting Started with the Software Platform Builder Connecting peripherals to pins For most peripherals you need to specify which pins are used You can do this with the TASKING Pin Mapper 1 Adda TASKING Pin Mapper Document File New TASKING Pin Mapper Document and configure the pins as explained in Using the TASKING Pin Mapper for ARM This results in a file called myproject pincfg 2 From the Pin Mapper menu select Generate Code or click Ce The Pin Mapper sources are generated and are added to your project in the folder PinMapper The Software Platform uses the output of the TASKING Pin Mapper to configure the peripherals For example click on the STM32F2XX 2C peripheral to show its properties E Properties 3 rf STM32F2XX I2C Property Value Type Range Prototype a Stack Item Options ID STM32F2XX_12C1 Base Address 0x40005400 UINT32 Pin Configuration pincfg_i2cl_init CALLBACK void pinconfig void Interruptev 31 N This function is generated by the Pin Mapper and sets up the pins for the peripheral Interrupter 32 INTERRUPT 1 255 The Software Platform uses the function pincfg_i2c1_init to configure the STM32F2XxX I2C peripheral This function has been generated by the TASKING Pin Mapper 3 4 Generating and Usin
46. ow the specification of the interface These standards have become the de facto programming standards also for embedded environments The complete set of POSIX services as defined in the standard may be useful for large applications but the set is considered to be too large for most embedded systems Embedded systems usually have tight memory requirements may not have memory management capabilities and may not even have a secondary memory for implementing the UNIX file system For these reasons the POSIX standard recognizes the need for the creation of subsets of the operating system services The IEEE Std 1003 13 2003 edition POSIX 13 describes four real time application environment profiles and their minimum hardware requirements The TASKING POSIX implementation conforms to the PSE51 profile for Minimal Real time Systems and supports e Multi threading Standard device I O 49 Introduction to the TASKING Software Platform for ARM Standard file I O PSE52 Standard device Shared Memory routines File system interface for accessing sockets PSE53 File system interface for accessing shared memory objects Basic support for message passing PSE52 Basic support for signals FAT File System Some features have limited functionality for devices without peripheral support For more information see the TASKING POSIX Implementation 7 2 STM32 Repository The STM32 repository contains all STM32 specific content like peripheral
47. plug ins you are ready to generate the Software Platform sources for your project 1 From the Software Platform menu select Generate Code or click Ca The Software Platform sources are retrieved from the repositories and are added to your project in the folder SoftwarePlat form Tool options such as defines and include paths are added to the Generated options field in your project properties Options can also be set on the SoftwarePlatform folder and or sub folders 4 USART printf Active Debug in Includes 4 SoftwarePlatform amp Configuration amp cstart amp platform amp services USART_printf launch k USART_printf Isl f USART_printf swpxmi 2 From the File menu select Save Ctrl S or click lal The Software Platform document will be saved 36 Tutorial Using a Library Wrapper 5 6 Configure the Pins Now that the Software Platform software services and device stacks are defined you need to configure the pins of the peripheral In this case the USART You can do this with the TASKING Pin Mapper 1 From the File menu select New TASKING Pin Mapper Document The New TASKING Pin Mapper Document wizard appears Select the Project folder for the Pin Mapper document type the name of your project USART_print f or click the Browse button to select a project In the File name field enter a name for the Pin Mapper document for example USART_printf pincfg and click Next The Device an
48. re Platform for ARM 28 int return 1 return 0 return 1 main void int rc Create the RAM disk re mkfs SRC_DEV fatfs 0 NULL Ramdisk false if re lt 0 printf Error mkfs returned d n rc printf Mount filesystem n Try to mount the first partition rc mount SRC_DEV ramdisk fatfs 1 MOUNT_FLAG_RDWR MOUNT_FLAG_SYNC if rc and if that fails try the entire disk re mount SRC_DEV ramdisk fatfs 0 MOUNT_FLAG_RDWR MOUNT_FLAG_SYNC if rc printf Error mount returned d n rc dirlisting ramdisk printf Create directory n re mkdir ramdisk dirl S_IRWXU S_IRWXG S_IRWXO LE EG printf Error mkdir returned d n rc FILE f fopen ramdisk test txt w if f NULL printf Error fopen returned NULL n fwrite TEST 4 1 f fclose f r Tutorial Creating a File System on a RAM Disk dirlisting ramdisk From the File menu select Save Ctrl S or click lal The file will be saved From the Project menu select Build Generic_Filesystem or click W The project is built and a Debug folder is created with the absolute object file Generic_Filesystem abs 4 7 Debug the Application We are now ready to use the simulator to run and debug the application 1 From the Debug menu select Debug Generic_F
49. reading Software Timing Services STM32 CMSIS Core Chapter 3 Getting Started with the Software Platform Builder The Software Platform Builder is the graphical interface to manage the plug ins of the Software Platform repositories The Software Platform Builder enables you to add peripherals e build device stacks e add software services configure all software services and stack items generate code for your Software Platform 3 1 Creating a Software Platform Document To use the Software Platform Builder you need a project The Software Platform Builder becomes available when you add a special Software Platform document to your project Add a Software Platform document to an existing project 1 First make sure you have an existing project This is explained in the Getting Started manual of the toolset In this example we assume you have a project called myproject 2 From the File menu select New TASKING Software Platform Document The New Software Platform Document wizard appears 3 Select the Project folder for the Software Platform document type the name of your project myproject or click the Browse button to select a project 4 Inthe File name field enter a name for the Software Platform document for example myproject swpxmi and click Finish A new Software Platform document is added to the project with extension swpxmi TASKING Software Platform Builder editor Double click on the Software Platfor
50. rt The Import dialog appears 2 Select TASKING Software Platform Example Projects and click Next The Import Software Platform Examples dialog appears Import Soft are Platform Example Projects o a k Import Software Platform examples Select the Software Platform examples to import into the current workspace gt Example projects m B a STMicroelectronics STM32 STM320518 EVAL F STM3210B EVAL STM3210C EVAL STM3210E EVAL a E STM322xG EVAL E 7 STM322xG_ADC STM322xG_Audio_Service STM322xG_Bluetooth_HID STM322xG_Bluetooth_RFCOM E STM322xG_CAN E STM322xG_EEPROM STM322xG_EXTI STM322xG_GPIO STM322xG_GUI STM322xG_HTTPS_Webserver gt Select AIl m G aa aA Description STMicroelectronics STM32 Evaluation Board examples 3 Select the Software Platform examples you want to import into the current workspace and click Finish The original examples are copied into the current workspace and the Software Platform sources and Pin Mapper sources are generated Once the examples are in your workspace you can build the projects 16 Getting Started with the Software Platform Builder 3 6 API Reference Each repository contains detailed descriptions of its contents You can access this documentation from the Help menu Help Help Contents Software Platform Repository Reference Accessing help on individual drivers or services
51. rvices the blue stack items are the most abstract layers of functionality TCP IP Networking LWIP_1 Stack services provide standardized hardware independent access to devices Stack services are instantiated and ensure portability of your application For example if you run an application with a generic TCP IP service the application remains the same if you replace Ethernet with PPP and serial A portable TCP IP application works exactly the same whether linked to a UART or a to an EMAC peripheral since the Software Platform handles the lower level details 2 1 4 Adaptors Adaptors the grayed out stack items provide a mechanism to link higher level services to hardware specific modules Adaptors do not have options you can change By default adaptors are not visible in the device stacks You can make adaptors visible in the Preferences dialog See Section 3 7 Software Platform Builder Preferences Introduction to the TASKING Software Platform for ARM 2 2 Software Services Some services are static and not meant to be instantiated They have no direct relationship with peripherals or other services They facilitate common functionality like POSIX multithreading support They are shown in your editor at the left side of the Device Stacks Those services may also be added automatically if required by other services Software Services Software Platform Builder Cortex M Architecture Interrupt Management POSIX Multi th
52. s low level drivers and library wrappers Support is included for the following device families STMicroelectronics STM32FOxx STMicroelectronics STM32F10x STMicroelectronics STM32F2xx STMicroelectronics STM32F30x STMicroelectronics STM32F37x STMicroelectronics STM32F4xx no FP support STMicroelectronics STM32L1xx This repository contains software firmware from STMicroelectronics which is licensed under MCD ST Liberty SW License Agreement V2 You may not use this package except in compliance with this License You may obtain a copy of the License at http Awww st com software_license_agreement_liberty_v2 PDF 50 Content of the Default ARM Repositories 7 3 EF M32 Repository The EFM32 repository contains all Silicon Labs EFM32 specific content like peripherals low level drivers and library wrappers Support is included for the following device families e EFM32 Gecko e EFM32 Giant Gecko e EFM32 Leopard Gecko e EFM32 Tiny Gecko e EFM32 Wonder Gecko e EFM32 Zero Gecko This repository contains software firmware from Silicon Laboratories which is licensed See the top of each file for detailed information Basically you are free to use the Silicon Labs code for any project using Silicon Labs devices 7 4 Generic Repository Software services drivers and peripherals in the generic repository are provided as Bonus Technology as described in the Altium EULA Some third party software is included which may require special
53. t processor core or architecture for which you want to build the application In this example we select STM32F103ZG Afterwards you can always change the processor in the Project Properties for dialog 31 Introduction to the TASKING Software Platform for ARM 5 Leave the rest of the dialog as is and click Next The Target Settings page appears In order to debug your project you need to create a debug configuration Select a target For this tutorial select STMicroelectronics STM3210E Eval board e For connection select J Link over USB or ST LINK over USB Enable Add launch configuration to the project This allows you to debug your project e Leave the other tabs as is For more information see section Creating a Customized Debug Configuration in Chapter Using the Debugger of the TASKING VX toolset for ARM User Guide Click Finish to finish the wizard and to create the project The project has now been created and is the active project 2 Add a Software Platform Document Now that we have a project we can add a Software Platform document 1 From the File menu select New TASKING Software Platform Document The New Software Platform Document dialog appears Leave the project name and file name as is and click Finish A new Software Platform document is added to the active project USART_printf swpxmi TASKING Software Platform Builder editor Double click on the Software Platform document USART_printf swpxmi
54. tch In this tutorial we make a copy of a plug in that was generated in the tutorial of Chapter 4 Tutorial Creating a File System on a RAM Disk 1 From the Generic_Filesystem project right click on the ramdisk folder in SoftwarePlatform platform generic drivers and select Copy The exact path depends on the directory structure of the Software Platform repository from which the plug in is retrieved You can find out the correct path when you click the Show Resource Info button in the Properties view of the RAM Disk 43 Introduction to the TASKING Software Platform for ARM se Generic_FileSystem Active Debug 45 Binaries in Includes gt amp Debug 4 SoftwarePlatform adaptors amp Configuration amp cstart 4 platform 4 generic 4 amp drivers 4 ramdisk doc amp include amp ini amp services ic main c B Generic_FileSystem launch k Generic_FileSystem Isl j Generic_FileSystem swpxmi gt 3 My_Repository 2 Right click on the My_Repository project and select New Folder The New Folder dialog appears 3 Select the My_Repository parent folder if it has not been selected already 4 Inthe Folder name field enter a name to categorize the type of plug ins For this tutorial enter My_customized_plugins and click Finish 5 Right click on the My_customized_plugins folder and select Paste A copy of the ramdisk plug in is now present in the local repository 6 3 Modify the Sof
55. ted an unsupported device or a generic architecture Introduction to the TASKING Software Platform for ARM Growing stacks Once you have added one or more stack items you can use Grow Stack Up or Grow Stack Down from the context menu to complete your device stack I myproject swpxmi 3 _ TASKING Software Platform STM32F2171G 1 error 1 warning rear Software Services Device Stacks Software Platform Builder Cortex M Architecture Interrupt Management POSIX Multi threading Delete Delete STM32 CMSIS Core 4 Grow Stack Up lt b Grow Stack Down i ee API Reference The Grow Stack Up and Grow Stack Down menu items only become available if possibilities exist to extend the stack from the point of the selected stack item Once you have partial device stacks on the document you can extend them with other stack items to grow them to the abstraction level you wish to use in your application For an interface description of a module select API Reference To grow a stack up 1 Right click on a plug in of the existing stack and select Grow Stack Up The Grow Stack dialog appears The dialog shows all possible combinations of sub stacks that you can place on top of the selected module 2 Select any module in any of the possible sub stacks to extend the selected stack upwards and click OK To grow a stack down 1 Right click on a plug in of the existing stack and select Grow Stack Down The Grow Stack d
56. tomized_plugins 4 ramdisk gt amp doc gt amp include gt amp ini gt amp services gt main c B Generic_FileSystem launch hs Generic_FileSystem lsl E Generic_FileSystem swpxmi 47 Introduction to the TASKING Software Platform for ARM 48 Chapter 7 Content of the Default ARM Repositories The chapter describes the content of the default ARM repositories When Altium releases a new version of a repository you can update this repository by using the Available Updates wizard To check for updates 1 From the Help menu select Check for Updates The Available Updates wizard appears 2 Follow the steps in the wizard and click Finish Online repository documentation Each repository contains detailed descriptions of its contents You can access this documentation from the Help menu Help Help Contents Software Platform Repository Reference 7 1 TASKING POSIX Repository The Portable Operating System Interface POSIX is a set of well established standards that define a standardized way for an application to interface to the operating system Because of the aim of portability and readability we have chosen POSIX as our standard interfaces at application level for at least the kernel multithreading device I O and networking services The POSIX standards do not specify how services must be implemented just their semantics Implementers can choose their implementation as long as they foll
57. tware Platform Plug in As long as the name of a plug in does not change the new plug in overrules the plug in in the default repository In this tutorial we will only alter the caption the name of the stack item of the RAM disk plug in we just copied 1 Open the My_Repository project and open the ramdisk Plugirn file 44 Tutorial Creating a Local Repository 4 lc My_Repository 4 amp My_customized_plugins 4 amp ramdisk doc include 4 amp ini ba Ea F gt 7 ramdisk_large bmp ramdisk bmp ramdisk Interface e The file ramdisk Plugin appears in the editor view 2 Under the Plugin part change the line Caption RAM Disk into Caption My RAM Disk If a question appears that the file is read only and if you wish to make it writable click Yes 3 From the File menu select Save Ctrl S or click lal The file will be saved 6 4 Use the Local Repository Now that we have a local repository we want to use it in the Generic_Filesystem project that we created in Chapter 4 Tutorial Creating a File System on a RAM Disk You can use Eclipse platform URLs or a file URL to specify the location of a repository or you can use a browse button The following URLs are supported URL Description platform resource This URL is used to identify a resource located in the workspace The next path segment after resource should be the name of a project which can be followed
58. tware services This chapter describes both parts and how they are related 2 1 Device Stacks Device stacks are all about making hardware peripherals available to application code through abstract and generic software interfaces By placing more or less modules on a stack you can choose the abstraction level you want to use in your application The lowest level modules are specific for a particular hardware device On top of that you can stack higher level modules that provide more generic functionality to access the device For example at the higher abstract level you could choose to use a module to access a file system in your application At the lower levels you still can select modules to decide which specific storage device you want to access a hard drive SD card RAM drive Thus the lower level modules are more specific for a particular peripheral while the higher level modules are less hardware specific and can even be used in combination with multiple peripheral devices You can use the Software Platform Builder editor to build device stacks Example The following figure contains a HTTP device stack and a GUI device stack GUI Services AGUL1 HyperText Transfer Pointer Services Graphics Services Protocol HTTP nity POINTER GRAPHICS 1 TCP IP Networking Touchscreen Services ILI9320 LCD Module Driver parallel LWIP_1 TOUCHSCREEN _1 Ethernet Protocol STMPE811 Touchscreen Services Controller GPIO ETHERNET_1 DRV_STMP
59. vice using the library wrapper usart stm32_usart_init ST_STM32F10X_USART_1 printf Hello world n m l et i gt Y B 00 Variables 5 2o Breakpoints E ttt Registers 2N Z a 3 USART printf TASKING C C Debugger HG t B amp x Rl ot 7 Group 4 amp STMicroelectronics STM3210E Eval board STM Preme Value Name Value Usage RO 0x0 pai 2 Reset_Handler cstart c 269 0x0800076 RL On LJ R2 0x0 f m R3 o0 R4 0x2000070 ad a iias i i B Disassembly 2 oe Outline fa Address int main void a 8000878 00 b5 push ir usart stm32_usart_init ST_STM32F10X_USART_1 5 2800087a 00 20 mov ro 0x0 es00es7c ff f7 32 fe bl stm32_usart_init 080004e4 28000880 03 49 ldr r1 pc 0xc 28000882 08 60 str r r1 0x01 z initialize the USART device using the library wrapper E Console 23 Tasks Ee bE ft Be ri o 0 Memory 23 Debug USART_printf Monitors dh 3 3 Communication J Link over USB JTAG Debug Instrument Module dijlinkarm Using Flash Configuration Number of devices 1 Device Address 6x8000000 q m J button Ul Smart Insert 7 1 TEI E To resume execution from the Debug menu select Resume or press F8 or click on the Resume The application is executed When you have a terminal emulator open on your PC this shows Hello world For more information about debugging an app

Download Pdf Manuals

image

Related Search

Related Contents

CUBE U18GT取扱説明書  5月23日 - CATCH navi  Smeg FC310AL Instructions for Use  Vogel's PFW 5005  MANUAL DEL USUARIO  Gembird USB A - MicroUSB B, 1.8m  取扱説明書 - サヤマトレーディング  DJ-DP10  SMR4a2_5a2-Manual  User`s Manual Model EJA510A and EJA530A Absolute  

Copyright © All rights reserved.
Failed to retrieve file