This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-AM243: Read from FlashROM using NVM_APP_read()

Part Number: LP-AM243
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

Hi team,

I develop application using ind_comms_sdk_am243x_09_02_00_15.

I checked flash reading and writing, with lower program.

I write the data "0F0F0F0F0F.....", and read it.

But, read data sometimes changes to "0b" from "0f".

Could you tell me why this happen, and how to perceive and avoid this.

    uint8_t write_flash[32]={0};
    uint8_t read_flash[32]={0};

    OSAL_MEMORY_memset(write_flash,0x0F,32);

    //write "0F0F0F0F....." to flash
    error = NVM_APP_write(  NVM_TYPE_FLASH,
                        CONFIG_FLASH0,
                        0x400000,
                        32,
                        (void*)write_flash
                        );
                        
    //read from same section of flash 
    error = NVM_APP_read(  NVM_TYPE_FLASH,
                        CONFIG_FLASH0,
                        0x400000,
                        32,
                        (void*)read_flash
                        );

    for(uint32_t i=0;i<32;i++){
        OSAL_printf("%02x",read_flash[i]);
    }
    //the result "0f0f0b0f0b0b0f0f0f0f0..."
    OSAL_printf("\r\n");  

Best regard,

Oyama

  • Hi Oyama,

    Thanks for your query.

    Assigning thread to Industrial communication expert.

    Regards

    Ashwani

  • Hi team,

    Has there been any progress?

    Can you reproduce it?

    Best regard,

    Oyama

  • Hi Oyama,

    Could you let me know which application are you using here? This will help us in reproducing the issue at our side

    Regards,
    Prajith

  • Hi Prajith,

    I use ethercat_slave_demo

    regards,

    Oyama

  • Hello Oyama,

    I could not reproduce the issue you specified here. I used the same code you shared in EtherCAT Slave Simple demo example from ind_comms_sdk_am243x_09_02_00_15 and tested. Even I executed your code in a loop and did not observe any data mismatch.

    Could you please let me know how frequently you observe this issue at your end? Also, could you please share the log when you observe this issue. 

    Please try to check for the errors during writing/reading data to/from the flash when you observe the data mismatch. The below code snippet is for your reference.

    error = NVM_APP_write(      NVM_TYPE_FLASH,
                                CONFIG_FLASH0,
                                0x400000,
                                32,
                                (void*)write_flash
                         );
    if (error != NVM_ERR_SUCCESS)
    {
        OSAL_printf("Write Error!!! \r\n");
    }
    
    error = NVM_APP_read(  NVM_TYPE_FLASH,
                            CONFIG_FLASH0,
                            0x400000,
                            32,
                            (void*)read_flash
                            );
    if (error != NVM_ERR_SUCCESS)
    {
        OSAL_printf("Read Error!!! \r\n");
    }


    Kind Regards,

  • Hi Harsha,

    It happens frequently, and no error happens.

    This is write_flash after set 0x0F.

    This is read_flash soon after reading flash. 

    And this is a log this time.

    Best regard,

    Oyama

  • Hello Oyama,

    Thanks for the screenshots and the information. Since I could not reproduce this issue at my end, I would ask you to try out the following steps to identify the cause for this issue.

    1. Please flash the application and check if the application runs without any error messages. Load the .appimage in UART boot mode using the UART uniflash python script and when flashing is done change to OPSI boot mode and reboot. 

    2. Please check if there are any flash configuration mismatch in syscfg when compared to SDK example flash configurations.

    3. Please use a different offset in the flash to check if same error can be reproduced at different offsets in the flash.

    4. If you have another AM243x LP hardware, then check if the same error can be reproduced.

    5. Try with the default EtherCAT SDK example without any additional modifications except writing and reading to/from the flash.

    6. Try to download and upload a sample file via FoE and compare the files to check if there is a data mismatch.

    Kind Regards,

  • Hi Harsha,

    There are results of check this issue,

    1. Data breaking was not happened by OSPI boot

    4. I have a AM64, but it was not happened in UART boot

    5. Data breaking was occurred in UART boot 

    Is it problem coming from hardware? 

    Best regard,

    Oyama

  • Hello Oyama,

    1. Data breaking was not happened by OSPI boot - Please let me know if writing and reading from the flash at offset 0x400000 is ok in this case or the application is running without any errors.

    4. I understand that the writing and reading to/from the flash is ok on AM64x EVM.

    5. I understand that the problem is again seen on AM243x LP target board. It can also be due to a hardware issue. Every flash has limited write cycles and may be some sectors on your flash have problem. Please check for item 2 and 3 on AM243x LP. 

    Kind Regards,