05-13-2024 10:11 AM
Hello! I have a roboRIO 1.0 that installed FRC 2024 firmware image. For a little experiment I tried compiling custom kernel from https://github.com/ni/linux/tree/nilrt-academic/master/4.14, and installed it using instructions from https://github.com/ni/nilrt/blob/nilrt/master/kirkstone/docs/README.kernel.md. There has been no problem (except for NI services and kernel module not loading, but the kernel booted successfully and everything else is normal, including ssh) until yesterday when I deployed a version with a little modification to the boot script. So I actually changed original bootscript.txt in the kernel tree (as written at https://github.com/ni/linux/blob/e167d2ccda8e812cd7aa99fefc59269c854952ce/scripts/package/buildnipkg...) to
if test ${DeviceCode} -eq 0x7AAE; then
setenv set_args 'setenv bootargs ${consoleparam} root=/dev/mmcblk0p3 rw ${usb_gadget_args} rcu_nocbs=all rootdelay=1 $othbootargs'
else
setenv set_args 'setenv bootargs ${consoleparam} $mtdparts ubi.mtd=boot-config ubi.mtd=root root=ubi1:rootfs rw rootfstype=ubifs ${usb_gadget_args} rcu_nocbs=all $othbootargs'
fi
# usb host or device mode switching
if test -n ${otg_usb_en} && test ${otg_usb_en} -eq 1; then
fdt addr ${loadaddr} && fdt get value fdtname /configurations/config_${DeviceCode} fdt && fdt get addr fdtaddr /images/${fdtname} data && fdt addr ${fdtaddr} && if itest.l ${usb_otgsc_id:-ffffffff} == 0; then
fdt set /amba@0/usb@${otg_usb_base_addr} dr_mode host;
elif itest.l ${usb_otgsc_id:-ffffffff} == 100; then
fdt set /amba@0/usb@${otg_usb_base_addr} dr_mode peripheral;
fi;
fi
# wireless region switching
if test -n ${wirelessRegionFactory} && test -n ${wireless_board_id} && test -n ${wlan_sdio_base_addr}; then
fdt addr ${loadaddr} && fdt get value fdtname /configurations/config_${DeviceCode} fdt && fdt get addr fdtaddr /images/${fdtname} data && fdt addr ${fdtaddr} && fdt set /amba@0/sdhci@${wlan_sdio_base_addr}/wlan@0 atheros,board-id ${wireless_board_id} && fdt set /amba@0/sdhci@${wlan_sdio_base_addr}/wlan@0 atheros,region-code ${wirelessRegionFactory};
fi
# cRIO-9068 doesn't have USB gadget, so skip it on that device
if test ${DeviceCode} != 0x76D6; then
# myRIO should use ethaddr for the USB gadget to ensure a persistent address
if test ${DeviceCode} == 0x762F || test ${DeviceCode} == 0x76D3; then
usb_gadget_addr=${ethaddr}
else
usb_gadget_addr=${usbgadgetethaddr}
fi
usb_gadget_args="g_ether.idVendor=${USBVendorID} g_ether.idProduct=${USBProductID} g_ether.iProduct=\"${USBProduct} [${hostname}]\" g_ether.iSerialNumber=${serial#} g_ether.dev_addr=${usb_gadget_addr} g_ether.bcdDevice=${USBDevice}"
fi
if test -n \"$bootscriptenvrun\" ; then run bootscriptenvrun; fi
silent_tmp=${silent}
setenv silent
echo "Booting LabVIEW RT..."
setenv silent ${silent_tmp}
test -n "$manufacturer" ||
setenv manufacturer National Instruments &&
setenv .flags manufacturer:so &&
saveenv;
run set_args
bootm ${loadaddr}#config_${DeviceCode}
which content is extracted from original linux_runmode.itb in an attempt to bring normal NI services and kernel modules up with this custom kernel. I then followed the exact same step for flashing, but when roboRIO boots up, it runs into unrecoverable error, with yellow status light constantly blinking.
I have followed the steps in https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000kOHkCAM without any success, recovery led still blinking yellow after USB read activities (as indicated by led on my USB). I have also tried USB-to-Serial adapter connected to UART pins on MXP port, but there is no output.
I have also read somewhere else on this forum that there is a special version of recovery.cfg that includes a full firmware recovery, and is sent via email. If that can solve my case, please send it to me. If not, then what can I do to recover my roboRIO to original FRC firmware? Thank you!
P/S: The reason for me to do this is to try flashing custom FPGA bitstream to roboRIO and then communicate with the logic via uio module, and that's why I have to compile custom kernel.
Solved! Go to Solution.
05-15-2024 12:21 AM
Hello it's me again. I was able to solve it, by using `recovery.cfg`, and even if you see the status led blinking (indicating failure) when using `recovery.cfg`, you have to boot it to safe mode right after that by holding reset for 5 secs, and it will boot to safe mode. After getting to safe mode, I SSH into it and put the original `linux_runmode.itb` in, and it boots normally.
05-15-2024 08:47 AM
Hi giangvinhloc610,
I'm Matthew with NI. I'm glad to see you found a path back to a working state.
I do want to note that a custom kernel and/or fpga profile's are not permitted in the FRC competition, but it's great that you're getting your hands on with Linux RT for learning!