TI中文支持网
TI专业的中文技术问题搜集分享网站

TDA4VM: How to unmount Nor flash in the FLS driver of MCAL?

Part Number:TDA4VM

PSDK version:ti-processor-sdk-rtos-j721e-evm-08_04_00_06

We are attempting to unmount the Nor flash device using the FLS driver under MCAL, in order to mount it properly on the SOC side. We followed the approach of the 'OSPILeaveConfigSPI()' function in the PDK to set the OSPI to the legacy SPI mode, but we are encountering errors. Could you please advise on how to configure it correctly for unmounting this device?

Here are the changes we made:

And we found that the error reported were in the following area,

Gary Lu:

To unmount the Nor flash device using the FLS driver under MCAL in TDA4VM, you can follow these steps:

1. Locate the FLS driver configuration file in your PSDK installation. It should be present in the path `ti\mcusw\MCAL\fls\config\fls_cfg.c`.

2. Open the `fls_cfg.c` file and find the configuration for your Nor flash device. It should be defined under the `FlsDeviceConfigSet` array.

3. Look for the `FlsDeviceConfig` structure corresponding to your Nor flash device. It will have fields such as `deviceType`, `deviceBaseAddress`, and `deviceSize`.

4. To unmount the Nor flash, you need to disable the FLS driver for that device. Set the `enable` field of the `FlsDeviceConfig` structure to `FALSE`.

5. Save the changes to `fls_cfg.c` and rebuild your project.

By disabling the FLS driver for the Nor flash device, you effectively unmount it. However, please note that this method assumes you are using the FLS driver provided by MCAL and that you have correctly configured it for your Nor flash device.

,

jing jing:

There are two areas where I would like to trouble you for confirmation:

Our application scenario requires both MCU and LINUX to have read and write requirements for NOR flash. Therefore, after dynamically unmounting on the MCU side, we need to ensure that LINUX can mount it properly. Hence, I don't think rebuilding the project would be a solution.
Could you please confirm if our versions are aligned? We couldn't find the variables you mentioned. Based on your suggestion, I found the following locations. Could you please confirm if they are correct

  /*****************************************************************************
    Project: FLS_1
    Date   : 2020-09-15 13:57:01
    This file is generated by EB Tresos
    Do not modify this file, otherwise the software may behave in unexpected way
 ******************************************************************************/

CONST(struct Fls_ConfigType_s, FLS_CONFIG_DATA) FlsConfigSet =
{
    .Fls_JobEndNotification = Fee_JobEndNotification,
    .Fls_JobErrorNotification = Fee_JobErrorNotification,
    .maxReadNormalMode = 768U,
    .maxWriteNormalMode = 768U,
    .sectorList =
    {
            [0] =
            {
                .numberOfSectors = 16384U,
                .sectorPageSize = 256U,
                .sectorSize = 4096U,
                .sectorStartaddress = 1342177280U,
            },
        },
    .dacEnable = TRUE,
    .xipEnable = FALSE,
    .ospiClkSpeed = 166666666U,
    .dtrEnable = TRUE,
    .phyEnable = TRUE,
};

,

Gary Lu:

If you need to read and write NOR flash memory in both MCU and LINUX systems, it is very important to ensure that LINUX can mount it correctly after dynamically unloading it on the MCU side. Therefore, rebuilding the project may not be a solution. You can try to use some tools to ensure that LINUX can mount the NOR flash memory correctly, such as the mount command.

,

jing jing:

The current problem is that when using the OSPI driver under PDK, it has been found that if the "OSPILeaveConfigSPI" function is not called, the NOR flash cannot be mounted properly on the Linux side. Therefore, we would like to know if there is a corresponding solution in the FLS driver in MCAL. 

Based on your suggestion, is it sufficient to call the "Fls_NorOspiClose()" function on the MCU side, and then use the corresponding tools on the Linux side to mount the NOR flash? If so, could you please clarify which tools you are referring to?

,

Gary Lu:

If you are using the OSPI driver under PDK and facing issues with mounting the NOR flash on the Linux side, it is important to ensure that the necessary configuration and cleanup steps are performed correctly.

In the FLS driver in MCAL, there is a corresponding function called `Fls_Close()` that can be used to close the FLS driver and perform any necessary cleanup operations. However, it is important to note that the FLS driver in MCAL is primarily intended for use in the context of an automotive environment and may have different requirements and behavior compared to the OSPI driver in PDK.

To mount the NOR flash on the Linux side, you will typically need to use the appropriate tools and utilities provided by the Linux operating system. The specific tools and commands required may depend on the Linux distribution and configuration you are using. Here are some common steps to mount a NOR flash device on Linux:

1. Identify the device: Use the `lsblk` command or similar tools to identify the device node associated with the NOR flash. It will typically be something like `/dev/mtdX` or `/dev/mtdblockX`, where `X` is a number.

2. Create a mount point: Choose a directory on your Linux system where you want to mount the NOR flash. For example, you can create a directory called `/mnt/norflash`.

3. Mount the NOR flash: Use the `mount` command to mount the NOR flash device to the chosen mount point. The exact command will depend on the file system used on the NOR flash. For example, if the NOR flash uses the JFFS2 file system, you can use a command like `mount -t jffs2 /dev/mtdX /mnt/norflash`.

4. Access the mounted NOR flash: Once the NOR flash is successfully mounted, you can access its contents through the chosen mount point (e.g., `/mnt/norflash`).

,

jing jing:

The version of our FLS driver is in the follow picture, and we have not found the `Fls_Close()` you mentioned.

Can you please confirm if our versions are the same?

,

Gary Lu:

Hello, I have consulted the engineer, it will take some time, thank you

,

jing jing:

Okay, thank you ! Looking forward to your prompt reply.

,

Gary Lu:

Please be patient. Thank you

赞(0)
未经允许不得转载:TI中文支持网 » TDA4VM: How to unmount Nor flash in the FLS driver of MCAL?
分享到: 更多 (0)