Platform: Radxa A527 (Cubie A5E) SDK: Tina Linux (Allwinner) | Kernel 5.15 Target Hardware: Waveshare RS485/CAN HAT (B) [MCP2515 CAN + SC16IS752 UART]
1. Kernel Configuration
Modifications were made to the Linux 5.15 kernel configuration (make kernel_menuconfig) to enable support for the HAT’s specific controllers on the SPI bus:
-
Enabled CAN Support: Activated
CONFIG_CAN_MCP251X(Microchip MCP251x SPI CAN controllers). -
Enabled Serial Support: Activated
CONFIG_SERIAL_SC16IS7XX(NXP SC16IS7xx serial drivers) with SPI interface support enabled.
2. Device Tree Modification (board.dts)
The Device Tree Source was patched to map the physical SPI connections and define the external crystal frequencies required for correct baud rate generation.
-
SPI1 Interface: Enabled
&spi1status tookay. -
Pin Multiplexing (Pinctrl): Manually defined
spi1_pins_aandspi1_sleep_pins_anodes (mapping pinsPB13,PB14,PB15for MOSI/MISO/CLK andPB10for CS), as the base BSP was missing these definitions for the A527 target. -
Peripheral Nodes:
-
CAN (
can@0): Mapped to Chip Select 0. Configured with an 8MHz fixed clock (mcp2515compatible) and assigned interruptPB11. -
RS485 (
rs485@1): Mapped to Chip Select 1. Configured with a 14.7456MHz fixed clock (nxp,sc16is752compatible) and assigned interruptPB12.
-
-
Correction: Removed references to undefined regulators (
vdd-supply = <®_3v3>) to resolve build-time phandle errors.
3. Build & Packaging
-
Successfully resolved syntax errors (duplicate node definitions) and missing reference errors in the DTS.
-
Compiled the kernel and generated the target firmware image using the Tina build system:
-
./build.sh(Kernel/RootFS compilation) -
./build.sh pack(Packed into Allwinner.imgformat).
-
4. Deployment Strategy
- Target Image:
tina_a527_cubie_a5e_uart0.img(~3.1GB).
Its not flashing well on SD card. what to do