ARM ® RMTarget IntegrationGuide


Table of Contents

Preface
About this book
Intended audience
Using this book
Typographical conventions
Further reading
Feedback
Feedback on RMTarget
Feedback on this book
1. Introduction to RealMonitor
1.1. About RealMonitor
1.2. About RealMonitor functionality
1.3. The development of RealMonitor
1.4. How RealMonitor works
1.5. RealMonitor system requirements
2. Introduction to RMTarget
2.1. About RMTarget
2.1.1. Small code and data size
2.1.2. Small execution overhead
2.1.3. Low interrupt latency
2.1.4. Tool chain support
2.1.5. Thumb ® support
2.2. Preparing a RealMonitor-enabled image
2.3. RMTarget source files
2.4. Porting RMTarget
2.4.1. Porting to a new processor
2.4.2. Porting to a newboard
2.4.3. Adding a new build target
3. RealMonitor Demonstrations
3.1. About the RealMonitor demonstrations
3.2. Directory structure of the RealMonitordemonstrations
3.3. Rebuilding the RealMonitor demonstrations
3.4. Initialization of the RealMonitordemonstrations
3.4.1. Caches
3.4.2. Interrupt controller initialization
3.4.3. Stack initialization
3.4.4. RealMonitor exception handlers installation
3.4.5. RMTarget library initialization
3.4.6. μHAL-specific initialization
3.5. Non-μHAL RealMonitor application demonstration
3.5.1. Procedure for runningthe RealMonitor application demonstration
3.6. μHAL RealMonitor application demonstration
3.7. LEDs demonstration
3.7.1. About the LEDs demonstration
3.7.2. Implementation
3.7.3. Sharing interrupts
3.7.4. Procedure for running the LEDs demonstration
3.7.5. Debugging test script for the LEDsdemonstration
4. Building RMTarget
4.1. Building RMTarget using CodeWarriorIDE
4.1.1. Building using CodeWarrior IDE
4.1.2. Linking using CodeWarrior IDE
4.2. Building RMTarget using the makefile
4.2.1. Building using the Makefile
4.2.2. Rebuilding the RMTarget library
4.2.3. Linking using armlink
4.2.4. Building RMTarget with your application
4.3. Determining library size
4.4. Types of build options
4.4.1. System configuration build macros
4.4.2. Data logging build option
4.4.3. Debugging build options
4.4.4. Packet support build options
4.4.5. Automatic build options
4.4.6. Processor configuration build options
4.4.7. Miscellaneous build options
4.5. RMTarget build options and macros
4.5.1. RM_BOARD
4.5.2. RM_PROCESSOR
4.5.3. RM_BUILD_PATH
4.5.4. RM_OPT_DATALOGGING
4.5.5. RM_OPT_STOPSTART
4.5.6. RM_OPT_SOFTBREAKPOINT
4.5.7. RM_OPT_HARDBREAKPOINT
4.5.8. RM_OPT_HARDWATCHPOINT
4.5.9. RM_OPT_SEMIHOSTING
4.5.10. RM_OPT_SAVE_FIQ_REGISTERS
4.5.11. RM_OPT_READBYTES
4.5.12. RM_OPT_WRITEBYTES
4.5.13. RM_OPT_READHALFWORDS
4.5.14. RM_OPT_WRITEHALFWORDS
4.5.15. RM_OPT_READWORDS
4.5.16. RM_OPT_WRITEWORDS
4.5.17. RM_OPT_EXECUTECODE
4.5.18. RM_OPT_GETPC
4.5.19. RM_OPT_COMMANDPROCESSING
4.5.20. RM_OPT_READ
4.5.21. RM_OPT_WRITE
4.5.22. RM_OPT_READWRITE
4.5.23. RM_OPT_SYNCCACHES
4.5.24. RM_OPT_SYNC_BY_VA
4.5.25. RM_PROCESSOR_NAME
4.5.26. RM_PROCESSOR_REVISION
4.5.27. RM_PROCESSOR_HAS_EICE_RT
4.5.28. RM_PROCESSOR_HAS_EICE_10
4.5.29. RM_PROCESSOR_USE_SYNCCACHES
4.5.30. RM_PROCESSOR_USE_SYNC_BY_VA
4.5.31. RM_PROCESSOR_NEEDS_NTRST_FIX
4.5.32. RM_EXECUTECODE_SIZE
4.5.33. RM_OPT_GATHER_STATISTICS
4.5.34. RM_DEBUG
4.5.35. RM_OPT_BUILDIDENTIFIER
4.5.36. RM_OPT_SDM_INFO
4.5.37. RM_OPT_MEMORYMAP
4.5.38. RM_OPT_USE_INTERRUPTS
4.5.39. RM_FIFOSIZE
4.5.40. CHAIN_VECTORS
4.6. Default RMTarget settings
5. Integration
5.1. About RMTarget integration
5.2. Integration procedure
5.2.1. Adding stacks
5.2.2. Handling exceptions
5.2.3. Calling the RMTarget initializationfunction
5.3. Other integration considerations
5.3.1. SWI numbers
5.3.2. Interrupt latency
5.3.3. Linking with μHAL
5.3.4. Using the AFS chaining library
5.4. Integrating RMTarget into an RTOS
5.4.1. Overview of the threads solution
5.4.2. DCC driver
5.4.3. The monitor thread
5.4.4. The exception-processing thread
5.4.5. Stopping and restarting
5.4.6. Implementation
6. Application Program Interface
6.1. RealMonitor naming conventions anddata types
6.1.1. Naming conventions
6.1.2. Basic data types
6.1.3. Complex data types
6.2. Data structures
6.2.1. rm_DispatchTable
6.2.2. IMP_GlobalState
6.2.3. rm_CapabilitiesTable
6.3. Control and monitoring structures
6.3.1. rm_ExecuteCodeBuffer
6.3.2. RM_ExecuteCodeBlock
6.3.3. RM_Registers
6.3.4. RM_RegisterAccess
6.3.5. RM_Statistics
6.3.6. rm_MemoryMap
6.3.7. rm_SDM_Info
6.4. Assembly language macros
6.4.1. RM_IRQ_GETSTATUS
6.4.2. RM_IRQ_ENABLE
6.4.3. RM_IRQ_DISABLE
6.4.4. RM_DCC_READWORD
6.4.5. RM_DCC_WRITEWORD
6.4.6. RM_DCC_GETSTATUS
6.4.7. RM_DEBUG_READ_MOE
6.4.8. RM_DEBUG_ENABLE
6.5. Initialization functions
6.5.1. RM_Init()
6.5.2. rm_InitCommsState()
6.5.3. RM_InitVectors()
6.6. μHAL interfacing functions
6.6.1. RM_uHAL_Init()
6.6.2. rm_uHAL_IRQTest()
6.6.3. rm_uHAL_IRQHandler()
6.7. Exception handling functions
6.7.1. RM_InstallVector()
6.7.2. rm_GetExceptionTableBase()
6.7.3. RM_UndefHandler()
6.7.4. rm_nTRST_Fix()
6.7.5. RM_SWIHandler()
6.7.6. RM_PrefetchAbortHandler()
6.7.7. RM_DataAbortHandler()
6.7.8. RM_IRQHandler()
6.7.9. RM_IRQHandler2()
6.7.10. rm_RunningToStopped()
6.7.11. rm_Common_RunningToStopped()
6.7.12. rm_RestoreUndefAndReturn()
6.7.13. rm_ExceptionDuringProcessing()
6.7.14. rm_Panic()
6.8. Cache handling functions
6.8.1. rm_Cache_SyncAll()
6.8.2. rm_Cache_SyncRegion()
6.8.3. rm_Cache_SyncVA()
6.9. Data logging functions
6.9.1. RM_SendPacket()
6.9.2. rm_EmptyFifo()
6.9.3. rm_NextMessage()
6.10. Communication functions
6.10.1. rm_RX()
6.10.2. rm_TX()
6.10.3. rm_Poll()
6.10.4. RM_PollDCC()
6.10.5. rm_TransmitData()
6.10.6. rm_FillTransmitBuffer()
6.10.7. rm_ReceiveData()
6.10.8. rm_SetPending()
6.10.9. rm_SetRX()
6.10.10. rm_RXDone()
6.10.11. rm_RXDoneSetPending()
6.10.12. rm_SetTX()
6.10.13. rm_TXDone()
6.10.14. rm_SendPendingData()
6.10.15. rm_SetPendingSendPending()
6.10.16. rm_RXDoneSetPendingSendPending()
6.10.17. rm_TXPend()
6.10.18. rm_PendTX()
6.10.19. rm_EnableRXTX()
6.10.20. rm_EnableTX()
6.10.21. rm_ResetComms()
6.11. Starting and stopping the foregroundapplication
6.11.1. rm_StoppedLoop()
6.11.2. rm_StoppedToRunning()
6.12. Opcode handlers for the RealMonitorchannel
6.12.1. rm_SendPendingData()
6.12.2. rm_NOP()
6.12.3. rm_GetCapabilities()
6.12.4. rm_ReturnGetCapabilitiesPayload()
6.12.5. rm_Stop()
6.12.6. rm_Go()
6.12.7. rm_ReadData()
6.12.8. rm_ReadBytes()
6.12.9. rm_ReadBytesPayload()
6.12.10. rm_ReadHalfWords()
6.12.11. rm_ReadHalfWordsPayload()
6.12.12. rm_ReadWords()
6.12.13. rm_ReadWordsPayload()
6.12.14. rm_SetupRead()
6.12.15. rm_GetReadAddress()
6.12.16. rm_GetReadLength()
6.12.17. rm_ReadHeader()
6.12.18. rm_ContinueRead()
6.12.19. rm_WriteBytes()
6.12.20. rm_WriteBytesPayload()
6.12.21. rm_WriteHalfWords()
6.12.22. rm_WriteHalfWordsPayload()
6.12.23. rm_WriteWords()
6.12.24. rm_WriteWordsPayload()
6.12.25. rm_SetupWrite()
6.12.26. rm_SetWriteAddress()
6.12.27. rm_WriteData()
6.12.28. rm_ContinueWrite()
6.12.29. rm_ExecuteCode()
6.12.30. rm_CallExecuteCodeBuffer()
6.12.31. rm_GetPC()
6.12.32. rm_GetPCCounts()
6.12.33. rm_GetPCHeader()
6.12.34. rm_DoGetPC()
6.12.35. rm_SyncCaches()
6.12.36. rm_SyncCaches_Address()
6.12.37. rm_SyncCaches_Length()
6.12.38. rm_SkipPacketPayload()
6.12.39. rm_DoSkipPacketPayload()
7. RealMonitor Protocol
7.1. About the RealMonitor protocol
7.2. Escape sequence handling
7.3. Packet formats
7.3.1. Packet structure
7.3.2. Host-to-target messages
7.3.3. Target-to-host controller messages
7.4. Connecting to a target
7.5. Disconnecting from a target
7.6. RealMonitor packets
7.6.1. NOP
7.6.2. GetCapabilities
7.6.3. Stop
7.6.4. Go
7.6.5. GetPC
7.6.6. SyncCaches
7.6.7. ExecuteCode
7.6.8. InitializeTarget
7.6.9. ReadBytes
7.6.10. WriteBytes
7.6.11. ReadHalfWords
7.6.12. WriteHalfWords
7.6.13. ReadWords
7.6.14. WriteWords
7.6.15. ReadRegisters
7.6.16. WriteRegisters
7.6.17. ReadCPRegister
7.6.18. WriteCPRegister
7.6.19. Ok
7.6.20. Error
7.6.21. Stopped
7.6.22. SoftBreak
7.6.23. HardBreak
7.6.24. HardWatch
7.6.25. SWI
7.6.26. Undef
7.6.27. PrefetchAbort
7.6.28. DataAbort
7.7. Format of the capabilities table
7.7.1. Tag 0x00000000, End-of-table marker
7.7.2. Tag 0x00000001, RealMonitor version number
7.7.3. Tag 0x00000002, Configuration word
7.7.4. Tag 0x00000003, Pointer to the build identifier string
7.7.5. Tag 0x00000010, Pointer to the RealMonitor state byte
7.7.6. Tag 0x00000011, Pointer to the channelfilter block
7.7.7. Tag 0x00000012, Pointer to the registerblock
7.7.8. Tag 0x00000013,Pointer to the error block
7.7.9. Tag 0x00000014, Pointer to the register accessibilityblock
7.7.10. Tag 0x00000015, Pointer to the executioninformation block
7.7.11. Tag 0x00000016, Pointer to memorydescriptor block
7.7.12. Tag 0x00000017, Pointer to the SDM information string
7.8. Data logging
Glossary

List of Figures

1.1. RealMonitor components
1.2. RealMonitor as a state machine
2.1. RMTarget source files
3.1. RealMonitor demonstrations sourcefiles
4.1. Setting build options for the assembler
4.2. Setting build options for the C compiler
5.1. Exception handlers
6.1. Format of the error block
6.2. Format of the stack
6.3. Format of the stack when stopping
6.4. Packet buffering
6.5. Processing a NOP packet
6.6. Processing a GetCapabilities packet
6.7. Processing a Stop packet
6.8. Processing a Go packet
6.9. Processing a ReadBytes packet
6.10. Processing a ReadHalfWords packet
6.11. Processing a ReadWords packet
6.12. Processing a WriteBytes packet
6.13. Processing of a WriteHalfWords packet
6.14. Processing of a WriteWords packet
6.15. Processing an ExecuteCode Packet
6.16. Processing a GetPC packet
6.17. Processing of a SyncCaches packet
7.1. Normal compared to quoted data stream
7.2. Structure of RealMonitor protocolpackets
7.3. NOP packet transmission
7.4. GetCapabilities packet transmission
7.5. Stop packet transmission
7.6. Go packet transmission
7.7. GetPC packet transmission
7.8. SyncCaches packet transmission
7.9. ExecuteCode packet transmission
7.10. InitializeTarget packet transmission
7.11. ReadBytes packet transmission
7.12. Transferring six bytes from targetto host
7.13. WriteBytes packet transmission
7.14. Transferring six bytes from hostto target
7.15. ReadHalfWords packet transmission
7.16. Transferring four halfwords fromtarget to host
7.17. WriteHalfWords packet transmission
7.18. Transferring four halfwords fromhost to target
7.19. ReadWords packet transmission
7.20. Transferring one word in either direction
7.21. WriteWords packet transmission
7.22. ReadRegisters packet transmission
7.23. WriteRegisters packet transmission
7.24. Ok packet transmission
7.25. Error packet transmission
7.26. Stopped packet transmission
7.27. SoftBreak packet transmission
7.28. HardBreak packet transmission
7.29. HardWatch packet transmission
7.30. SWI packet transmission
7.31. Undef packet transmission
7.32. PrefetchAbort packet transmission
7.33. DataAbort packet transmission
7.34. Format of the version word
7.35. Error block format
7.36. Format of the memory descriptor block

ProprietaryNotice

Words and logos marked with ® or ™ are registered trademarks or trademarksowned by ARM Limited, except as otherwise stated below in this proprietarynotice. Other brands and names mentioned herein may be the trademarksof their respective owners.

Neither the whole nor any part of the information containedin, or the product described in, this document may be adapted orreproduced in any material form except with the prior written permissionof the copyright holder.

The product described in this document is subject to continuousdevelopments and improvements. All particulars of the product andits use contained in this document are given by ARM in good faith.However, all warranties implied or expressed, including but notlimited to implied warranties of merchantability, or fitness forpurpose, are excluded.

This document is intended only to assist the reader in theuse of the product. ARM Limited shall not be liable for any lossor damage arising from the use of any information in this document,or any error or omission in such information, or any incorrect useof the product.

Revision History
Revision A December 2000 Firstrelease
Copyright © 2000 ARM Limited. All rights reserved.. All rights reserved. ARM DUI 0142A
Non-Confidential