Focused on Rockchip solutions development

Rockchip RK3506 Flexbus Development Guide: From Hardware Design to Linux Driver Debugging

In industrial data acquisition, waveform generation, and embedded display projects, the interface between the processor and its peripherals can become a major design challenge. Software-driven GPIO toggling struggles to maintain consistent high-speed timing, while existing SPI or other dedicated controllers may not match the peripheral protocol.

The RK3506 Flexbus offers another option for these interface requirements. Its configurable hardware timing and data transfer mechanisms provide a way to connect certain external digital interfaces to the processor.

However, interface names alone do not determine compatibility. Before choosing Flexbus, developers need to verify data direction, clocking, control signals, available pins, and the driver implementation in the target board support package (BSP).

Flexbus, short for Flexible Bus, is a configurable digital interface controller in the RK3506. It can adapt to certain standard or application-specific interface timings. Rockchip’s datasheet lists external ADCs, DACs, DVP cameras, and QSPI LCD panels as typical applications. [1]

The ADCs and DACs in these applications are external converters. Flexbus transfers digital sample data or digital output codes; it does not perform analog conversion. External circuitry remains responsible for the analog front end, reference voltage, filtering, and output drive.

A complete Flexbus implementation has three parts:

  • Hardware connections: Pin multiplexing, logic levels, bit order, and clock direction.
  • Controller and driver configuration: Data width, timing, transfer length, and interrupt handling.
  • Application data handling: Buffer management, processing throughput, error recovery, and application protocols.

All three must work together. Enabling a device tree node alone does not establish reliable data acquisition or output.

The RK3506 Technical Reference Manual describes separate transmit and receive channels. The Flexbus0 data port supports input or output, while the Flexbus1 data port is used for input. The controller also supports built-in DMA and ping-pong operation using two addresses. [2]

ResourceData Direction and Typical UseDevelopment Considerations
Flexbus0 data portTransmit or receive; typical uses include DAC outputInput, output, and combined modes must match the driver implementation
Flexbus1 data portReceive; typical uses include ADC acquisitionVerify external clocking and sampling conditions
Controller DMAMoves data between the interface and memoryHandle addresses, lengths, synchronization, and buffer ownership correctly
Ping-pong buffering capabilityProvides a hardware basis for alternating between two buffersContinuous operation still requires driver coordination and timely application processing

Flexbus0 and Flexbus1 are not two identical, freely interchangeable general-purpose interfaces. To determine whether a particular transmit/receive combination can run simultaneously, check the controller mode, shared resources, and target BSP.

Parallel ADC Data Acquisition

For an ADC with a parallel digital output, Flexbus can be evaluated as a receiving interface. Start by checking the output width, valid data window, sampling edge, and any additional signals such as BUSY, data-ready, or channel indicators.

An ADC is not automatically compatible with Flexbus simply because it is a converter. For devices with I²C or SPI interfaces, evaluate the corresponding dedicated controller first.

Parallel DACs and Waveform Generation

For a DAC with parallel inputs, Flexbus can be evaluated for transmitting digital code streams. Key considerations include the relationship between output data and the clock, the default output during startup, and the behavior when the data supply stops.

In actuator-control applications, define a safe output value for fault conditions at the system level. The output state after application software exits should be intentional and predictable.

DVP Camera Interfaces

DVP integration involves the pixel clock, line-valid signal, frame synchronization, and pixel data. In addition to electrical connections, verify support in the image capture driver, sensor control interface, and upper-level video framework.

Support for an image interface does not imply MIPI CSI-2 reception capability, nor does it establish a complete image-processing or video-encoding pipeline.

QSPI LCDs and Custom Interfaces

For a QSPI LCD, verify the number of active data lines and timing during the command, address, and data phases, along with chip-select hold behavior and readback requirements. For other custom peripherals, break the protocol into individual phases and determine whether the controller can implement each operation.

If the protocol requires complex dynamic handshaking, multiple independent clock domains, or strict real-time conditional behavior, also evaluate an FPGA, CPLD, or another interface solution.

Build a Peripheral Interface Requirements Table

Complete the following checks before schematic design to reduce the risk of discovering an incompatible interface during driver development.

ItemInformation to Confirm
PeripheralFull part number, datasheet revision, and digital interface mode
Data directionInput only, output only, or direction changes between phases
Data formatWidth, bit order, signed or unsigned representation, and valid bit positions
Clock relationshipClock source, operating frequency, sampling edge, and idle state
Control signalsChip select, reset, enable, synchronization, and data-valid signals
Electrical requirementsI/O voltage, input thresholds, drive strength, and loading
Data continuityWhether transfers can pause, sample loss is acceptable, and flow control is available
Software baselineSDK version, driver mode, available examples, and application interface

Verify Pins for the Exact Chip and Package

Do not determine pin locations from the RK3506 family name alone. Use the exact chip variant, package, and board schematic to check whether the required Flexbus signals are accessible and whether they share pins with Ethernet, display, or other peripherals.

When using a system-on-module (SoM), check the carrier-board connector pinout as well. A function supported by the chip may not be fully exposed by the module.

Confirm Logic-Level Compatibility

Check both the relevant RK3506 I/O power domain and the peripheral’s digital interface supply. If level translators are required, evaluate propagation delay, channel-to-channel skew, direction control, and power-up behavior in addition to voltage compatibility.

On a parallel bus, excessive differences in delay between data lines can reduce the receiver’s valid sampling window.

Route According to the Timing Budget

PCB layout should account for relative clock-to-data delay, continuous reference planes, return paths, and connector discontinuities. Keep clock traces away from strong interference sources such as switching power nodes.

Avoid applying a fixed length-matching tolerance or series resistor value without considering the operating frequency and timing requirements. Determine termination requirements and resistor values from driver characteristics, interconnect behavior, and measurements.

RK3506 Flexbus
RK3506 Flexbus

Step 1: Record the Hardware and Software Baseline

At a minimum, record the chip variant, board revision, SDK release, kernel commit, and device tree actually loaded by the system.

uname -a
cat /proc/device-tree/model
dmesg | less

Different vendors may provide different driver implementations for the same chip. Without version information, debugging results can be difficult to reproduce.

Step 2: Locate the Implementation in Your Source Tree

Run the following command from the kernel source root:

rg -n -i 'flexbus' drivers include Documentation arch/arm/boot/dts

Look for the controller driver, mode-specific drivers, Kconfig entries, device tree binding documentation, and examples for the target board. Directory layouts vary between SDKs, so adjust the search scope to your source tree.

Do not copy device tree nodes directly from the RK3576 or another platform. Even when function names match, register addresses, clocks, resets, pin groups, and supported modes may differ.

Step 3: Enable the Required Kernel Configuration

Use the current Kconfig definitions to verify that the controller driver, target mode driver, and required subsystems are enabled. After compilation, confirm that the driver is included in the image or modules deployed to the board.

ADC, DAC, camera, and display applications may use different upper-level interfaces through IIO, video, or display subsystems. Follow the interface exposed by the actual driver rather than assuming every Flexbus mode provides a common character device.

Step 4: Configure and Validate the Device Tree

Check the following:

  • The controller and target function nodes are enabled.
  • Pin groups match the board connections and have no multiplexing conflicts.
  • Clock and reset resources are complete.
  • Data direction, width, and timing properties are supported by the driver.
  • Peripheral power, reset, and associated control interfaces are configured.

Device tree properties are not arbitrary parameter names. Each property should have a corresponding definition in the current binding documentation or implementation in the driver’s parsing code.

A generic DTS template without board-level validation can be misleading. Use the RK3506 configuration provided with your BSP as the starting point and verify each change against the hardware.

Step 5: Validate the Link with Low-Speed, Short Transfers

Begin with a clock below the target rate and short data blocks. If the peripheral provides test patterns or digital loopback, use those features first.

Useful test patterns include all zeros, all ones, alternating bits, incrementing counters, and walking-bit patterns. These help identify stuck levels, reversed bit order, data misalignment, and missing samples.

Use an oscilloscope to inspect voltage levels, edges, and overshoot, and a logic analyzer to check protocol sequencing. Receiving data in software does not, by itself, demonstrate adequate electrical timing margin.

Distinguish Between Three Data Widths

The peripheral’s valid data width, the bus transfer width, and the memory storage width may differ. For example, a 12-bit sample might occupy a 16-bit storage unit, but the actual arrangement must be confirmed from the driver implementation and peripheral format.

Calculate bandwidth using the actual number of stored bytes. When parsing data, account for valid bit positions, sign extension, and byte order.

Manage Buffers Through the DMA API

Kernel drivers should use the Linux DMA API to manage DMA addresses and cache coherency. A normal userspace pointer is not a DMA address, and physical addresses should not be inferred without a valid mapping.

Define when the CPU or DMA engine owns each buffer and when that buffer may be read, modified, or reused.

Check Length Units and End-of-Transfer Handling

A register’s transfer length may represent bytes, data units, or another quantity. Check both the technical manual and current driver before configuring it.

Test transfers that do not fill an entire block. Verify the valid data length, any padding, and application parsing so that padding is not mistaken for samples.

Ping-Pong Buffering Does Not Guarantee Lossless Capture

Double buffering allows hardware transfers and CPU processing to overlap. If the application cannot keep up over time, buffers may still be overwritten or overflow.

For continuous acquisition, record block sequence numbers, valid sample counts, error flags, and timing information. For sources without flow control, define what happens when no free buffer remains.

Start with the application’s data volume, then determine whether the interface and system can sustain it.

Memory data rate = Samples per second × Stored bytes per sample.

For example, assume an application requires 10 MS/s and stores each sample in 16 bits:

10,000,000 × 2 = 20,000,000 B/s, or approximately 20 MB/s

Buffering 100 ms of data would require approximately 2 MB in theory. This is a calculation example, not a verified RK3506 performance result. Additional capacity is needed for scheduling jitter, copying, algorithm processing, and storage stalls.

For a clocked parallel interface, estimate theoretical data-line throughput as follows:

Theoretical throughput = Interface clock frequency
                        × Valid transfers per clock cycle
                        × Data width in bits ÷ 8

Theoretical throughput is not the same as sustained application throughput. The proportion of valid data, DDR contention, interrupt frequency, cache management, and application processing can all affect the result.

Measure interface reception, memory movement, application reads, and final processing separately to identify the actual bottleneck.

SymptomCheck FirstRecommended Action
No clock outputClock direction, clock gating, pin multiplexing, and transfer trigger conditionsConfirm which endpoint supplies the clock in the selected mode and measure during transfer startup
Data is all zeros or all onesPeripheral operation, wiring, logic levels, and enable stateConfirm that valid transitions exist at the peripheral output
Clearly incorrect valuesBit order, byte order, valid bit positions, and sign extensionApply known test codes and verify each bit
Intermittent misalignment or unexpected code changesSampling edge, timing margin, and signal integrityReduce the rate and examine the clock-to-data relationship
Transfer timeoutMissing external clock, unmet data conditions, interrupt problems, or DMA faultsCorrelate waveforms, logs, interrupt counts, and driver state
Short transfers work but continuous operation failsBuffer reuse, insufficient application throughput, and memory contentionRecord block sequence numbers, queue depth, and error counts
Samples are lost when networking or display tasks startSystem bandwidth or scheduling pressureAdd workloads individually and measure when the problem appears
DVP images show displaced lines or incorrect colorsSynchronization polarity, data mapping, and pixel orderingUse the sensor’s test pattern and verify one setting at a time

Change one key variable at a time and retain before-and-after logs and waveforms. Changing frequency, pins, and buffer settings together makes the root cause difficult to isolate.

A prototype that receives one data block is only the starting point. Product validation should cover:

  1. Functional coverage: Normal startup, stop, repeated startup, and different transfer lengths.
  2. Data integrity: Bit order, valid length, block order, and loss detection.
  3. System stress: Concurrent display, networking, storage, and algorithm workloads.
  4. Fault recovery: Peripheral resets, interrupted clocks, transfer timeouts, and application termination.
  5. Environmental operation: Testing under the product’s specified temperature, power, and cable conditions.
  6. Version traceability: Schematics, BOM, device tree, kernel commit, and test program versions.

Write acceptance criteria as measurable conditions, such as a defined data rate, operating duration, and maximum permitted error count. A general statement that the system “works normally” is insufficient for production approval.

How Does RK3506 Flexbus Differ from Standard GPIO?

Standard GPIO provides pin-level input and output control. Flexbus provides dedicated timing and data transfer mechanisms. For higher data rates or continuous streams, evaluate hardware interface support rather than relying on repeated software-driven GPIO toggling as a stable high-speed bus.

Can Flexbus Replace an FPGA?

Flexbus may be suitable for some simple interface adaptations. Complex logic, multiple parallel processing paths, and strict real-time control require a separate assessment. Protocol complexity, latency, and resource requirements should determine whether an FPGA is needed.

Are Flexbus and DSMC the Same Interface?

No. Rockchip lists Flexbus and DSMC as separate peripheral resources. [3] Distinguish streaming-interface requirements from external memory or local-bus access requirements, then verify the appropriate controller and driver.

Can I Reuse Flexbus Examples from Other Rockchip Platforms?

Their development approach can be useful, but porting requires checking RK3506 resource definitions, driver versions, and board connections. Device tree addresses, clocks, resets, and pin configurations must be reviewed rather than copied unchanged.

What Is the Maximum Flexbus Transfer Rate?

The usable rate depends on the exact chip documentation, operating mode, peripheral timing, PCB implementation, and driver validation. Evaluate sustained throughput and error rate under the intended operating conditions rather than promising sampling performance based on a clock frequency alone.

Successful RK3506 Flexbus development connects the peripheral protocol, electrical timing, driver configuration, and memory data handling into a verifiable data path. Confirming interface compatibility first, followed by low-speed tests, DMA validation, and system stress testing, can reduce later PCB revisions and debugging effort.

If you are developing an RK3506-based data acquisition device, industrial controller, or custom display product, contact the LST engineering team to discuss interface requirements, hardware and PCB design, Linux driver adaptation, and PCBA manufacturing and testing. Sharing the peripheral part number, target data rate, system version, and existing schematic helps accelerate a feasibility review.

Recent Posts

Whatsapp
Whatsapp
Email
Email
wechat
wechat
wechat

Get a Quote

Our product experts and technicians will answer your questions within 24 hours.

We use cookies to ensure that we give you the best experience on our website.