Switching for a computer and Radxa ROCK 3A
To see the output from Radxa ROCK 3A on a computer and to have debug capabilities, do the following:
Diagram for connecting USB-UART converters and Radxa ROCK 3A
bps = 1500000, data bits = 8, stop bits = 1, parity = none, flow control = none
. Define the USB port connected to the USB-UART converter used for receiving output from Radxa ROCK 3A.To allow a computer and Radxa ROCK 3A to interact through Ethernet, perform the following actions:
dhcpcd.conf
file, which is found at the path <example name>/resources/...
).Debugging programs for Radxa ROCK 3A
To debug programs running on the Radxa ROCK 3A, you must do the following:
.gdbinit
file and add the following strings to it:set sysroot /opt/KasperskyOS-Community-Edition-<version>/sysroot-aarch64-kos
add-symbol-file <path_to_debuggee>/build/einit/EinitQemu-kss/ksm.module
set follow-fork-mode parent
set follow-exec-mode same
set detach-on-fork off
set schedule-multiple on
set serial baud 115200
target extended-remote /dev/ttyUSB[n]
CmakeLists.txt
file in the <path_to_debuggee>/einit
directory, add the GDBSTUB_KERNEL
parameter to the build_kos_hw_image ()
command call.[KDBG ] Waiting for GDB connection infinitely
will appear in the output. The application will stop while it waits for the debugger to connect./opt/KasperskyOS-Community-Edition-<version>/toolchain/bin/aarch64-kos-gdb
.[KDBG ] Connection to GDB was established
will appear in the output.For more details, refer to Preparations for debugging on the hardware platform and Initial steps of debugging on the hardware platform.
Preparing a bootable SD card for Radxa ROCK 3A
If the hdd.img
image was created when building the example, all you have to do is write the resulting image to the SD card. To do this, connect the SD card to the computer and run the following command:
# In the following command, path_to_img is the path to the image file
# [X] is the final character in the name of the SD card block device.
$ sudo pv -L 32M path_to_img | sudo dd bs=64k of=/dev/sd[X] conv=fsync
If kos-image
was created when building the example, the SD card requires additional preparations before you can write the image to it. A bootable SD card for Radxa ROCK 3A can be prepared automatically or manually. After preparing the SD card, you must copy the kos-image
file from the directory <example name>/build/einit
to the bootable area (FAT32 partition) of the prepared SD card.
To automatically prepare the bootable SD card, connect the SD card to the computer and run the following commands:
# To create a bootable drive image file (*.img),
# run the script:
$ sudo /opt/KasperskyOS-Community-Edition-<version>/common/radxa_prepare_sdcard_image.sh
# In the following command, path_to_img is the path to the image file
# of the bootable drive (this path is displayed upon completion
# of the previous command), [X] is the final character
# in the name of the SD card block device.
$ sudo pv -L 32M path_to_img | sudo dd bs=64k of=/dev/sd[X] conv=fsync
Clearing the Radxa ROCK 3A flash memory
In some editions of the Radxa ROCK 3A, the flash memory may contain a bootloader that is incompatible with the card that you have prepared according to the instructions provided above.
If you see the message "SPL: failed to boot from all boot devices"
when running examples on the Radxa ROCK 3A, you must clear the Radxa ROCK 3A flash memory before running the examples.
To clear the Radxa ROCK 3A flash memory:
rkdeveloptool
.Instructions on installing this tool are provided in the documentation: https://docs.radxa.com/en/rock3/rock3a/low-level-dev/rkdeveloptool?host-os=debian#installation-for-rkdeveloptool
Maskrom
mode:Maskrom
mode by running the following command in the terminal:$: rkdeveloptool ld
DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=104 Maskrom
rkdeveloptool db rk356x_spl_loader_ddr1056_v1.12.109_no_check_todly.bin
rkdeveloptool ef
rkdeveloptool rd