Kernel use request_firmware_nowait err:Direct firmware load for xxxx.bin failed with error -2

Hi,
I am currently developing ISP firmware upgrades. During testing, I found that when calling request_firmware_nowait function in the kernel,

an error message appears: “Direct firmware load for /lib/firmware/OAX4000_download.bin failed with error -2”.

And “CONFIG_FW_LOADER=y” has been configured in kernel config, and the OAX4000_download.bin file has been copied to the /lib/firmware/ directory. What is the reason?
SW: JetPack_5.1.1_R35.3.1

*** Please note that this reply is generated by LLM automatically ***

To address the issue you’re encountering with the error message “Direct firmware load for libfirmware/OAX4000/download.bin failed with error 2” during ISP firmware upgrades on the Jetson AGX Orin platform, let’s break down the key components and potential solutions.

  1. CONFIG_FW_LOADER Configuration: You’ve mentioned that CONFIG_FW_LOADER has been configured in the kernel config. This is a crucial step as it enables the firmware loader support in the kernel, allowing it to load firmware files for various devices.

  2. OAX4000download.bin File Placement: You’ve also confirmed that the OAX4000download.bin file has been copied to the lib/firmware directory. This is the correct location for firmware files, as the kernel looks for firmware files in this directory when loading them.

  3. Error Code 2: The error code 2 typically indicates that the file was not found. Given that you’ve placed the OAX4000download.bin file in the correct directory, this might seem contradictory. However, there are a few potential reasons for this discrepancy:

    • File Permissions: Ensure that the file permissions for OAX4000download.bin are set correctly. The file should be readable by the user or group that the kernel or the process attempting to load the firmware belongs to.
    • File Name and Path: Double-check that the file name and path are correctly specified in the kernel configuration or in the code that’s attempting to load the firmware. A typo or incorrect path could lead to the file not being found.
    • Kernel Module Loading: If the firmware loader is a kernel module, ensure that it is properly loaded before attempting to load the firmware. You can check the kernel logs or use lsmod to verify if the module is loaded.
  4. JetPack Version: You’re using JetPack 5.1.1 (R35.3.1). While this information is useful for context, the issue you’re facing seems more related to kernel configuration and firmware loading rather than a specific JetPack version issue. However, it’s always a good idea to check the release notes for your JetPack version to see if there are any known issues related to firmware loading.

  5. Comparison with Other Platforms: If you’re developing on other Jetson platforms (like Jetson Xavier NX or Jetson AGX Xavier), ensure that the firmware file and kernel configurations are correctly set up for those platforms as well. The payloads_t23x directory mentioned in the context is specific to Jetson AGX Orin devices, so ensure you’re using the correct directories and configurations for your specific hardware.

  6. Debugging Steps:

    • Verify the kernel logs for any messages related to firmware loading.
    • Check the file system to ensure the OAX4000download.bin file is in the correct location and has the correct permissions.
    • If possible, try loading the firmware manually using tools like fw_load or by using the request_firmware function in a test program to isolate the issue.

By methodically checking each of these potential issues, you should be able to identify and resolve the problem preventing the OAX4000download.bin firmware from loading correctly on your Jetson AGX Orin platform.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

hello Kevin_Wang2025,

may I know the details of ISP firmware upgrades.

you may see-also OTA update, for instance, please refer to Updating Jetson Linux with Image-Based Over-the-Air Update for the approach updating Bootloader only.

Hi Jerry,
I have achieve v4l2sd_ops function for isp upgrade programer,
`static long ox05b1s_v4l2subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct ox05b1s *priv = v4l2_get_subdev_hostdata(sd);
int ret = 0;

switch (cmd) {
case VIDIOC_PRIVATE_IOCTL_ISP_UPGRADE:
	dev_info(&client->dev, "Handling isp upgrade ioctl\n");
	// Add code to handle sensor mode changes if needed
	ret = OAX4000_upgrade(priv);
	break;

default:
	dev_err(&client->dev, "Unknown ioctl command: %u\n", cmd);
	ret = -ENOIOCTLCMD;
	break;
}

return ret;

}`

but when I use ioctrl to test,
`#define VIDIOC_PRIVATE_IOCTL_ISP_UPGRADE _IOW(‘V’, BASE_VIDIOC_PRIVATE + 0, int)

int test_my_new_cmd(int subdev_fd)
{
int cmd;
int ret;

ret = ioctl(subdev_fd, VIDIOC_PRIVATE_IOCTL_ISP_UPGRADE, &cmd);
if (ret < 0) {
    perror("Failed to execute MY_NEW_CMD");
    return ret;
}

// 验证结果
printf("Command executed successfully\n");
return 0;

}

int main()
{
int fd = open(“/dev/v4l-subdev4”, O_RDWR);
if (fd < 0) {
perror(“Failed to open device\n”);
return -1;
}
test_my_new_cmd(fd);

    close(fd);

}`the testcase report “Inappropriate ioctl for device”, please tell me how to use and test the v4l2sd_ops, thank you!

hello Kevin_Wang2025,

it’s related to driver IOCTL implementation.
you may see-also Tutorials page for the training slides, [Develop a V4L2 Sensor Driver] for reference.

Hi Jerry,
I have study the 《2025-Jetson-Camera-and-Driver-Development-Public-With-Audio-Final.pptx》course, but it doesn’t show how to implement the
"const struct v4l2_subdev_ops v4l2sd_ops;" parameter in struct tegracam_device,
please check if it can work for application use ioctl command to control the /dev/v4l-subdev
device? And please check if my codes is right? Thank you!

hello Kevin_Wang2025,

you may see-also reference driver,
$public_sources/r36.4.4/Linux_for_Tegra/source/kernel_src/nvidia-oot/drivers/media/platform/tegra/camera/tegracam_v4l2.c
for instance,

static struct v4l2_subdev_ops v4l2sd_ops = { 
        .video  = &v4l2sd_video_ops,
static struct v4l2_subdev_video_ops v4l2sd_video_ops = {
        .s_stream       = v4l2sd_stream,
static int v4l2sd_stream(struct v4l2_subdev *sd, int enable)
{...}

Hi Jerry,
How app to get data from fill_string_ctrl handle which in “struct tegracam_ctrl_ops”? Thanks!

hello Kevin_Wang2025,

it shows the operations from app side, you’ll need to implement the sensor driver to have controls.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.