Cortex M0+ -
Function
NVIC
MPU
Debug
GPIO
DMA
REQUEST
INTERRUPT
MEMORY
DMA
REQUEST
INTERRUPT
MEMORY
Cortex M0+
NVIC
MPU
Debug
GPIO
CORTEX M0+ & DMA
NVIC
MPU
Debug
GPIO
Cortex M0+
The ARM Cortex-M0+ processor is a very low gate count, highly energy efficient processor that is intended for microcontroller and deeply embedded applications that require an area optimized, low-power processor.
Cortex M0+
Cortex M0+ : Function
Discuss the features of Cortex
Intended Learning Outcome
Features
Interfaces
Configuration
IOPORT:
Configuration
Functional Description
32-bit RISC processor
• The ARMv6-M Thumb® instruction set.
• Thumb-2 technology.
• An ARMv6-M compliant 24-bit SysTick timer.
• A 32-bit hardware multiplier. This is the standard single-cycle multiplier
• The ability to have deterministic, fixed-latency, interrupt handling.
• Load/store multiple instructions that can be abandoned and restarted to facilitate rapid interrupt handling.
• C Application Binary Interface compliant exception model. This is the ARMv6-M, C Application Binary Interface (CABI) compliant exception model that enables the use of pure C functions as interrupt handlers.
• Low power sleep-mode entry us
Features
The Nested Vectored Interrupt Controller (NVIC) features are:
• 26 external interrupt inputs, each with four levels of priority.
• Dedicated Non-Maskable Interrupt (NMI) input (which can be driven from any standard interrupt source)
• Support for both level-sensitive and pulse-sensitive interrupt lines.
• Wake-up Interrupt Controller (WIC), providing ultra-low power sleep mode support. • Relocatable vector table.
NVIC features
SIO
NVIC
Intended Learning Outcome
How and what registers are used in NVIC
NVIC
External interrupt signals connect to the Nested Vectored Interrupt Controller (NVIC), and the NVIC prioritizes the interrupts.
Software can set the priority of each interrupt. The NVIC and the Cortex-M0+ processor core are closely coupled, providing low latency interrupt processing and efficient processing of late arriving interrupts
All NVIC registers are only accessible using word transfers. Any attempt to read or write a halfword or byte individually is unpredictable.
“Nested" refers to the fact that interrupts can themselves be interrupted, by higher-priority interrupts. "Vectored" refers to the hardware dispatching each interrupt to a distinct handler routine
SysTick timer
• A 24-bit system timer (SysTick).
• Additional configurable priority SysTick interrupt.
Low power modes
The implementation includes a WIC (Wakeup Interrupt Controller). This enables the processor and NVIC to be put into a very low-power sleep mode leaving the WIC to identify and prioritize interrupts.
The processor fully implements the Wait For Interrupt (WFI), Wait For Event (WFE) and the Send Event (SEV) instructions. In addition, the processor also supports the use of SLEEPONEXIT, that causes the processor core to enter sleep mode when it returns from an exception handler to Thread mode.
NVIC register summary
Lets talk about memory
the "0" in the last position indicates that there is no onboard non-volatile flash memory, but it still includes the 16 KB ROM for essential functions.
Total SRAM: 264 KB
Total ROM: 16 KB.
XIP Flash Memory: Typically up to 16 MB, though dependent on external flash.
SRAM: 264 KB
There are four 16k x 32-bit banks (64kB each) and two 1k x 32-bit banks (4kB each).
Memory
Address Map
MPU
Intended Learning Outcome
How and what registers are used in MPU
• Eight user-configurable memory regions.
• Eight sub-region disables per region.
• Execute never (XN) support.
• Default memory map support.
MPU features
DEBUG
Intended Learning Outcome
Debug How to set different debugging in RP2040 using their registers
• Four hardware breakpoints.
• Two watchpoints.
• Program Counter Sampling Register (PCSR) for non-intrusive code profiling.
• Single step and vector catch capabilities.
• Support for unlimited software breakpoints using BKPT instruction.
• Non-intrusive access to core peripherals and zero-waitstate system slaves through a compact bus matrix. A debugger can access these devices, including memory, even when the processor is running.
• Full access to core registers when the processor is halted.
• Core Sight compliant debug access through a Debug Access Port (DAP) supporting Serial Wire debug connections.
Debug features
The processor is implemented with a low gate count Debug Access Port (DAP). The low gate count Debug Access Port (DAP) provides a Serial Wire debug-port, and connects to the processor slave port to provide full system-level debug access.
Debug Access Port
GPIO
DMA
Direct Memory Access
DMA:
The RP2040 Direct Memory Access (DMA) controller has separate read and write master connections to the bus fabric, and performs bulk data transfers on a processor’s behalf. This leaves processors free to attend to other tasks, or enter low-power sleep states.
Direct Memory Access
Intended Learning Outcome
Illustrate Direct Memory Access
Direct Memory Access
32 bits in size, one read access and one write access every clock cycle
• Memory-to-peripheral: a peripheral signals the DMA when it needs more data to transmit. The DMA reads data from an array in RAM or flash, and writes to the peripheral’s data FIFO.
• Peripheral-to-memory: a peripheral signals the DMA when it has received data. The DMA reads this data from the peripheral’s data FIFO, and writes it to an array in RAM.
• Memory-to-memory: the DMA transfers data between two buffers in RAM, as fast as possible
There are 12 independent channels, each which supervise a sequence of bus transfers, usually in one of the following scenarios:
Direct Memory Access
CONTROL AND STATUS REGISTERS
TRANSFER SIZE CAN BE EITHER 32, 16, OR 8 BITS
CHAIN_TO
Making the DMA more autonomous means that much less processor supervision is required: overall this allows the system to do more at once, or to dissipate less power.
We do all these to :
Configuring Channels
Each channel has four control/status registers
• READ_ADDR is a pointer to the next address to be read
• WRITE_ADDR is a pointer to the next address to be written to
• TRANS_COUNT shows the number of transfers remaining in the current transfer sequence,
• CTRL is used to configure all other aspects of the channel’s behaviour, to enable/disable it, and to check for completion.
Configuring Channels
Read and Write Addresses
For example:
• If the address does not increment (e.g. it is the address of a peripheral FIFO), and the next transfer sequence is to/from that same address, there is no need to write to the register again.
• When transferring to/from a consecutive series of buffers in memory (e.g. scattering and gathering), an address register will already have incremented to the start of the next buffer at the completion of a transfer.
Configuring Channels
Transfer Count
Configuring Channels
Control/Status
Starting Channels
3 ways to start a channel
Aliases and Triggers
Starting Channels
Trigger registers do not start the channel if
Starting Channels
Chaining
"ping-pong" configuration
This feature is configured through the CHAIN_TO field in the channel CTRL register.
Starting Channels
Null Triggers and Chain Interrupts
By default, a channel will generate an interrupt each time it finishes a transfer sequence, unless that channel’s IRQ is masked in INTE0 or INTE1
The channel CTRL register has a field called IRQ_QUIET
Data Request (DREQ)
Peripherals produce or consume data at their own pace. If the DMA simply transferred data as fast as possible, loss or corruption of data would ensue. DREQs are a communication channel between peripherals and the DMA, which enables the DMA to pace transfers according to the needs of the peripheral.
Data Request (DREQ)
Use of DREQ in DMA
Intended Learning Outcome
Credit-based DREQ Scheme
The RP2040 DMA is designed for systems where:
The area and power cost of large peripheral data FIFOs is prohibitive
The bandwidth demands of individual peripherals may be high, e.g. >50% bus injection rate for short periods
Bus latency is low, but multiple masters may be competing for bus access
Direct Memory Access
Addressing ‘em
Direct Memory Access
Configure ‘em
Sniff Hardware
Sniff hardware is a generic term used to describe a piece of hardware or a component in a computer system that is capable of observing, monitoring, or interacting with data transfers on specific channels or buses.
A checksum is a mathematical value calculated from the data to check for errors or verify data integrity. The statement suggests that the sniff hardware may be involved in the calculation or monitoring of this checksum as data is transferred
In A DMA device, what value should I write to the control and status register and at which address,
If:
In A DMA device, what value should I write to the control and status register and at which address,
If:
In A DMA device, what value should I write to the control and status register and at which address,
If:
In A DMA device, what value should I write to the control and status register and at which address,
If:
1 | 0 | 1 | x | x | x | x | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | x | x | x | x | x | 1 | 0 | 1 | 0 | 1 | 1 |
The DMA registers start at a base address of 0x50000000
CH2_CTRL_TRIG
31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Register name: CH1_CTRL_TRIG
Base Address: 0x50000000
Offset Address: